diff --git a/.cnb.yml b/.cnb.yml index 346310a88..9f29ab8c2 100644 --- a/.cnb.yml +++ b/.cnb.yml @@ -23,5 +23,4 @@ $: - docker stages: - name: install dependencies - script: pnpm install - + script: pnpm install diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index a57ee81d6..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true, - es6: true, - }, - extends: ['eslint:recommended', 'prettier'], - plugins: ['html', 'prettier'], - rules: { - 'prettier/prettier': ['error', {}, { usePrettierrc: true }], - 'no-console': ['warn', { allow: ['warn', 'error'] }], - }, -}; diff --git a/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml b/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml index 8f1908e1d..6f4da6f68 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml @@ -1,7 +1,7 @@ name: 反馈 Bug description: 通过 github 模板进行 Bug 反馈。 -title: "[组件名称] 描述问题的标题" -labels: [🐞 bug,🧐 unconfirmed] +title: '[组件名称] 描述问题的标题' +labels: [🐞 bug, 🧐 unconfirmed] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml b/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml index dab32894e..924375177 100644 --- a/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml +++ b/.github/ISSUE_TEMPLATE/feature-report.zh-CN.yml @@ -1,7 +1,7 @@ name: 反馈新功能 description: 通过 github 模板进行新功能反馈。 -title: "[组件名称] 描述问题的标题" -labels: [💪🏻 enhancement,🧐 unconfirmed] +title: '[组件名称] 描述问题的标题' +labels: [💪🏻 enhancement, 🧐 unconfirmed] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/new-component.zh-CN.md b/.github/ISSUE_TEMPLATE/new-component.zh-CN.md index 05b48991c..b9e486b1e 100644 --- a/.github/ISSUE_TEMPLATE/new-component.zh-CN.md +++ b/.github/ISSUE_TEMPLATE/new-component.zh-CN.md @@ -4,21 +4,21 @@ about: 新组件招募 title: '' labels: '' assignees: '' - --- -## 组件名称中英文 +## 组件名称中英文 ### 交互稿 + 交互稿: ### 设计稿 @@ -42,4 +42,3 @@ issue label 需要设置为 help wanted,发起招募 详细提交过程请参考:[如何贡献](https://tdesign.tencent.com/about/contributing)。 欢迎填写[《贡献者加入意向收集》](https://wj.qq.com/s2/9772260/7cbe/)问卷加入 TDesign 贡献者群,参与过程中遇到的各类问题可以得到实时解答和指引。 - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99ba26e17..dbe84dece 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: ci on: pull_request: - branches: [ main] + branches: [main] types: [opened, synchronize, reopened] jobs: diff --git a/.github/workflows/pkg-pr-new.yml b/.github/workflows/pkg-pr-new.yml index d24140fc1..cba559249 100644 --- a/.github/workflows/pkg-pr-new.yml +++ b/.github/workflows/pkg-pr-new.yml @@ -31,7 +31,7 @@ jobs: - run: pnpm --filter '@tdesign/site-components' --filter '@tdesign/theme-generator' run build - run: pnpm dlx pkg-pr-new publish './packages/site-components' './packages/theme-generator' - + build-tdesign-vue-site: if: github.repository == 'Tencent/tdesign' && github.event_name == 'pull_request' needs: build @@ -278,14 +278,13 @@ jobs: - run: pnpm uniapp build:npm - - run: pnpm -C packages/tdesign-uniapp/example build:h5 --mode preview + - run: pnpm -C packages/tdesign-uniapp/example build:h5 --mode preview - uses: actions/upload-artifact@v7 with: name: tdesign-uniapp-site path: packages/tdesign-uniapp/site/dist - retention-days: 5 - + retention-days: 5 build-site: if: github.repository == 'Tencent/tdesign' && github.event_name == 'pull_request' diff --git a/.github/workflows/service-update-schedule.yml b/.github/workflows/service-update-schedule.yml index bd8bc7a34..c5a8c5518 100644 --- a/.github/workflows/service-update-schedule.yml +++ b/.github/workflows/service-update-schedule.yml @@ -5,12 +5,12 @@ name: service-update-schedule on: workflow_dispatch: schedule: - - cron: "0 0 * * 5" + - cron: '0 0 * * 5' jobs: create-report: # prevents this action from running on forks - if: github.repository == 'Tencent/tdesign' + if: github.repository == 'Tencent/tdesign' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.gitignore b/.gitignore index 0edfaf6b9..6faa593d7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,8 @@ static_site lib ## test -coverage \ No newline at end of file +coverage + +## lint cache +.eslintcache +.stylelintcache \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg index b56767669..da9948310 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 75026c68d..1992ce5ef 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,13 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" +npx lint-staged || exit $? -npx lint-staged && log_emails=$(git config user.email) && if [[ ${log_emails} =~ '@tencent.com' ]];then echo 本地提交邮箱 $log_emails 校验非法,需要本地更改重新提交 && exit 2;else echo 邮箱 $log_emails 校验通过;fi +log_emails=$(git config user.email) +case "$log_emails" in + *@tencent.com) + echo "本地提交邮箱 $log_emails 校验非法,需要本地更改重新提交" + exit 2 + ;; + *) + echo "邮箱 $log_emails 校验通过" + ;; +esac diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index ed9d846b1..799067e14 100755 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname "$0")/_/husky.sh" - -npx czg --hook || true \ No newline at end of file +npx czg --hook || true diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 000000000..c8a0283bd --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,11 @@ +node_modules +.pnpm-store + +# build output +_site +dist +results +static_site +lib +coverage +_data diff --git a/.stylelintrc.js b/.stylelintrc.js index b1096f08f..067ed8e05 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -1,12 +1,28 @@ module.exports = { extends: ['stylelint-config-standard', 'stylelint-config-standard-less'], + overrides: [ + { + files: ['**/*.vue'], + customSyntax: 'postcss-html', + }, + { + // 内置主题 token 由 TDesign 设计平台导出并直接 import ?raw 使用, + // 保留其原始格式(百分比透明度等),不参与本地格式治理 + files: ['**/themes/built-in/css/**/*.css'], + rules: { + 'alpha-value-notation': null, + 'custom-property-empty-line-before': null, + 'no-duplicate-selectors': null, + }, + }, + ], rules: { - 'number-leading-zero': 'never', 'color-function-notation': 'legacy', 'alpha-value-notation': 'number', // TODO 后面统一改 class 小写 且 BEM,当前按警告提示 + // 兼容 tdoc 插件(vite-plugin-tdoc)生成的固定目录类名 tdesign-toc_* 'selector-class-pattern': [ - '^[a-z]+([-]?[a-z0-9]+)*(__[a-z0-9]([-]?[a-z0-9]+)*)?(--[a-z0-9]([-]?[a-z0-9]+)*)?$', + '^[a-z]+([-]?[a-z0-9]+)*(__[a-z0-9]([-]?[a-z0-9]+)*)?(--[a-z0-9]([-]?[a-z0-9]+)*)?$|^tdesign-toc_', { resolveNestedSelectors: true, message: 'Expected class selector "%s" to be lowercase and BEM format', @@ -14,5 +30,35 @@ module.exports = { }, ], 'media-feature-range-notation': 'prefix', + // 存量 less 中存在同优先级选择器靠书写顺序覆盖的写法,放开该规则以避免大规模重构引发样式回归; + // 该规则检查的是「低优先级选择器出现在高优先级之后」,与 Less 嵌套展开无关。 + // 注意:本次不治理此项,新代码仍应避免低优先级覆盖高优先级的写法。 + 'no-descending-specificity': null, + + // TDesign 设计 token 采用 camelCase 命名(如 --td-font-size-title-extraLarge、--td-comp-paddingLR-xs), + // 属于设计规范约定,不对 custom property 名称做 kebab-case 强制 + 'custom-property-pattern': null, + // 字体名保持原始大小写(PingFang SC、Microsoft YaHei 等),不做小写化 + 'value-keyword-case': null, + // 关键帧名称沿用设计 token 命名风格 + 'keyframes-name-pattern': null, + // Vue 单文件组件使用 :deep() 等作用域样式伪类 + 'selector-pseudo-class-no-unknown': [ + true, + { + ignorePseudoClasses: ['deep', 'global', 'slotted'], + }, + ], + // 设计系统需要保留 -webkit- / -moz- 等厂商前缀以兼容旧版 Safari / 小程序等运行时, + // 不交由 stylelint 移除(自动前缀由构建侧 postcss/autoprefixer 负责) + 'property-no-vendor-prefix': null, + 'value-no-vendor-prefix': null, + 'selector-no-vendor-prefix': null, + 'at-rule-no-vendor-prefix': null, + // 保留历史写法(如 rgba() 兼容函数、小数点精度),避免对已上线样式造成回归 + 'color-function-alias-notation': null, + 'number-max-precision': null, + // 设计系统会声明特定字体(如 PingFang SC、TCloud Number),不强制追加通用字体族 + 'font-family-no-missing-generic-family-keyword': null, }, }; diff --git a/.vscode/settings.json b/.vscode/settings.json index 873aba2af..b71924499 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,30 +1,28 @@ { - "typescript.preferences.importModuleSpecifier": "relative", + "js/ts.preferences.importModuleSpecifier": "relative", + "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"], - "[html]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "stylelint.validate": ["css", "less", "vue"], + + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.fixAll.stylelint": "explicit" }, - "[typescriptreact]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascriptreact]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescript]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[vue]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "cSpell.words": ["miniprogram", "tdesign", "uniapp"], + + "[html]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[javascript]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[typescript]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[vue]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[json]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[jsonc]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[markdown]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[css]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[less]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[yaml]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + + "prettier.requireConfig": true, + "files.eol": "\n", + + "cSpell.words": ["miniprogram", "tdesign", "uniapp", "stylelint", "postcss", "wxss", "husky", "pnpm"], "cSpell.ignorePaths": ["pnpm-lock.yaml", "node_modules", ".git", ".vscode"] } diff --git a/README.md b/README.md index 7441b8e87..59253feb7 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ The following are the repositories for TDesign: ### Repositories for Mobile Components -| Repository | Description | Status | -| ----------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) | Wechat MiniProgram UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-miniprogram/latest&color=blue)](https://npmjs.com/package/tdesign-miniprogram) | -| [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) | Vue3.x Mobile UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-vue/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-vue) | +| Repository | Description | Status | +| ----------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) | Wechat MiniProgram UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-miniprogram/latest&color=blue)](https://npmjs.com/package/tdesign-miniprogram) | +| [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) | Vue3.x Mobile UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-vue/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-vue) | | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) | React Mobile UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-react/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-react) | | [tdesign-flutter](https://github.com/Tencent/tdesign-flutter) | Flutter UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=latest.version&url=https://pub.dev/api/packages/tdesign_flutter&color=blue)](https://pub.dev/packages/tdesign_flutter) | | [tdesign-uniapp](https://github.com/Tencent/tdesign-miniprogram) | Uniapp UI components lib for TDesign | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/@tdesign/uniapp/latest&color=blue)](https://npmjs.com/package/@tdesign/uniapp) | @@ -139,7 +139,6 @@ For more information, refer to the guide section of each component, such as [But https://tdesign.tencent.com/contributor.html - ## Contributing Guide Any contributions to TDesign are welcome. Please read [《contributing for TDesign》](https://tdesign.tencent.com/about/contributing) for more information. diff --git a/README_zh-CN.md b/README_zh-CN.md index e052a5383..a00682c7e 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -25,10 +25,10 @@ TDesign 是一个 `multi-repo`, TDesign 有如下代码仓库: ### 移动端组件库 -| 仓库 | 描述 | 状态 | -| ----------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) | TDesign 微信小程序组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-miniprogram/latest&color=blue)](https://npmjs.com/package/tdesign-miniprogram) | -| [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) | TDesign Vue3.x 移动端组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-vue/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-vue) | +| 仓库 | 描述 | 状态 | +| ----------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [tdesign-miniprogram](https://github.com/Tencent/tdesign-miniprogram) | TDesign 微信小程序组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-miniprogram/latest&color=blue)](https://npmjs.com/package/tdesign-miniprogram) | +| [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) | TDesign Vue3.x 移动端组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-vue/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-vue) | | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) | TDesign React 移动端组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/tdesign-mobile-react/latest&color=blue)](https://npmjs.com/package/tdesign-mobile-react) | | [tdesign-flutter](https://github.com/Tencent/tdesign-flutter) | TDesign Flutter 组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=latest.version&url=https://pub.dev/api/packages/tdesign_flutter&color=blue)](https://pub.dev/packages/tdesign_flutter) | | [tdesign-uniapp](https://github.com/Tencent/tdesign-miniprogram) | TDesign Uniapp 组件库 | [![LTS](https://img.shields.io/badge/dynamic/json?style=flat-square&label=LTS&query=version&url=https://registry.npmjs.org/@tdesign/uniapp/latest&color=blue)](https://npmjs.com/package/@tdesign/uniapp) | diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index efa0541d1..e3e37b5a9 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -43,4 +43,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]. [homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/docs/awesome_zh-CN.md b/docs/awesome_zh-CN.md index d9dabd23d..d6d356386 100644 --- a/docs/awesome_zh-CN.md +++ b/docs/awesome_zh-CN.md @@ -42,10 +42,10 @@ title: 社区资源 ## 📦 插件和工具 -名称 | 描述 ---|-- -[unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)
[unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) | 用于自动引入 TDesign 桌面端 [Vue2](https://github.com/Tencent/tdesign-vue)、[Vue3](https://github.com/Tencent/tdesign-vue-next) 的组件,使用请参考 [自动引入章节](https://tdesign.tencent.com/vue/getting-started#%E8%87%AA%E5%8A%A8%E5%BC%95%E5%85%A5) -[formilyjs/tdesign-react](https://github.com/formilyjs/tdesign-react) | 结合 Formily & tdesign-react 组件库能力的社区贡献产品 +| 名称 | 描述 | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)
[unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) | 用于自动引入 TDesign 桌面端 [Vue2](https://github.com/Tencent/tdesign-vue)、[Vue3](https://github.com/Tencent/tdesign-vue-next) 的组件,使用请参考 [自动引入章节](https://tdesign.tencent.com/vue/getting-started#%E8%87%AA%E5%8A%A8%E5%BC%95%E5%85%A5) | +| [formilyjs/tdesign-react](https://github.com/formilyjs/tdesign-react) | 结合 Formily & tdesign-react 组件库能力的社区贡献产品 | ## 📄 文章 diff --git a/docs/design/TDesign_Axure_Library Guide.md b/docs/design/TDesign_Axure_Library Guide.md index d3fa5439e..d543fc4eb 100644 --- a/docs/design/TDesign_Axure_Library Guide.md +++ b/docs/design/TDesign_Axure_Library Guide.md @@ -2,11 +2,7 @@ V1.1.0_2022/08/18 - - ------- - - +--- ## **元件库简介** @@ -17,39 +13,35 @@ V1.1.0_2022/08/18 - 兼容并济:兼容Axure8.0及以上版本,Windows 与 Mac 平台通用,内容持续更新 - 官方用户群:微信或企业微信扫码加入,随时与官方交流,获取最新动态 - ![image (1)](https://user-images.githubusercontent.com/18713847/185081301-a795df6f-6c9c-47ca-b6dc-29e7df49f4aa.png) - ------- - + ![image (1)](https://user-images.githubusercontent.com/18713847/185081301-a795df6f-6c9c-47ca-b6dc-29e7df49f4aa.png) +--- ## **一、下载及安装** 1. 访问[TDesign 设计资源库](https://tdesign.tencent.com/source)下载最新版 Axure 元件库 -![image (2)的副本](https://user-images.githubusercontent.com/18713847/185081512-4e533237-2586-421b-b0c6-99590d43d2c8.png) + ![image (2)的副本](https://user-images.githubusercontent.com/18713847/185081512-4e533237-2586-421b-b0c6-99590d43d2c8.png) 2. 打开 Axure,找到【元件库面板】 -![image (3)](https://user-images.githubusercontent.com/18713847/185081770-c6f4aa1d-be20-425a-b804-ec488820f3ab.png) + ![image (3)](https://user-images.githubusercontent.com/18713847/185081770-c6f4aa1d-be20-425a-b804-ec488820f3ab.png) 3. 单击元件库面板右上角【选项】按钮,在下拉菜单中点击【载入元件库】按钮 -![image (4)](https://user-images.githubusercontent.com/18713847/185081881-e4d590c9-e7b4-44cc-9aa2-4ca0d32f6119.png) + ![image (4)](https://user-images.githubusercontent.com/18713847/185081881-e4d590c9-e7b4-44cc-9aa2-4ca0d32f6119.png) 4. 选择【TDesign_Axure_Library_Web_1.1.0.rplib】 -![image (5)](https://user-images.githubusercontent.com/18713847/185081963-96eec0d0-e658-4644-a102-b6fd8bbad228.png) + ![image (5)](https://user-images.githubusercontent.com/18713847/185081963-96eec0d0-e658-4644-a102-b6fd8bbad228.png) 5. 稍等片刻,导入完成后就可以在元件库面板看到已装载的 TDesign 元件库了 -![image (7)](https://user-images.githubusercontent.com/18713847/185082174-c174ef19-9e60-42e7-9fd8-4542843a9b19.png) - - + ![image (7)](https://user-images.githubusercontent.com/18713847/185082174-c174ef19-9e60-42e7-9fd8-4542843a9b19.png) ## **二、使用元件库** 1. 在元件库中找到需要的元件,你也可以通过搜索元件名称找到需要的元件 2. 将元件拖动到画布 -![image (6)](https://user-images.githubusercontent.com/18713847/185082382-c638e0ab-401d-44f1-9bf3-8bb2bc10bb03.png) + ![image (6)](https://user-images.githubusercontent.com/18713847/185082382-c638e0ab-401d-44f1-9bf3-8bb2bc10bb03.png) 3. 解除编组(shift+command+g),删除不需要的元件,修改现有元件内容(注:按钮、列表等做了自适应设计,可以根据文本宽度自动扩充宽度) -![image (8)](https://user-images.githubusercontent.com/18713847/185082523-fa4f182b-94a9-478d-a4d9-213f02a0e4c6.png) + ![image (8)](https://user-images.githubusercontent.com/18713847/185082523-fa4f182b-94a9-478d-a4d9-213f02a0e4c6.png) 4. 完成设计后,点击右上角【预览】按钮即可在浏览中查看(注:按钮等元素已内置 hover、点击等状态) -![image (9)](https://user-images.githubusercontent.com/18713847/185082653-e3e126a7-7c2d-4e97-b34e-12e30455b86c.png) + ![image (9)](https://user-images.githubusercontent.com/18713847/185082653-e3e126a7-7c2d-4e97-b34e-12e30455b86c.png) diff --git a/docs/design/offices-task_zh-CN.md b/docs/design/offices-task_zh-CN.md index afca6122a..a12a413ff 100644 --- a/docs/design/offices-task_zh-CN.md +++ b/docs/design/offices-task_zh-CN.md @@ -1,225 +1,225 @@ ---- -title: 中后台高频任务设计方法 -description: 明确整体框架和页面布局后,根据业务场景,对相关任务流程进行设计。 -isDesign: true ---- - -中后台产品虽服务不同业务,但存在非常同质化的高频任务,掌握这些任务的设计方法,可有效提高中后台的交互体验。 - -## 数据筛选与查询 - -按所需条件或类型选择需要的数据项、或查询数据结果的任务。常应用于「[仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) 」「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base)」。 - -### A 查询后生效 - -何时使用:当用户对数据查询范围有明确针对性,需要对数据进行一系列筛选过滤的使用场景时,可使用查询器进行一次性提交生效。 - -核心流程:选择条件 - 触发查询 - 获得结果数据 - 清空条件 - -相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 - - - -### B 立即生效 - -何时使用:当数据查询范围较为随机,用户需要反复、多次修改条件时,可实时显示筛选结果,来提高查询效率。 - -核心流程:条件选择 - 获得结果数据 -条件修改 - 获得结果数据 - -相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 - - - -### 其他场景:折叠条件 - -何时使用:当筛选项过多,全部显示会增加用户信息识别效率,可只显示高频选项,其他选项折叠,需要时自定义展开。 - -核心流程:展开条件 - 条件选择 - 获得结果数据 - -相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 - - - 图示:隐藏固定选项的条件 - - - 图示:隐藏固定选项的条件 - -### 其他场景:条件模版保存与调用 - -何时使用:当用户的筛选需求个性化较强,需要根据自身需要使用筛选项时,提供可自定义保存的筛选器。 - -核心流程:条件选择 - 保存为模版 -模版调用 - -相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 - - - -
- -## 表格批量操作 - -对报表中的多项数据进行统一操作的任务。常应用于「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base)」。 - -### A 所见即所得 - -何时使用:当批量操作按钮为主要或高频操作时,无论是否已选择数据,均在页面给用户见即所得的操作预期。 - -核心流程:选择要操作的内容 - 进行操作 - 显示操作结果 - -相关组件:[表格](/vue/components/table)、[按钮](/vue/components/button)、[多选框](/vue/components/checkbox)、[下拉菜单](/vue/components/dropdown)、[全局提示](/vue/components/message) 等 - - - -### B 选择后触发 - -何时使用:当页面已有主要按钮,批量操作为次级或非高频操作时,可在选择数据后显示操作区。 - -核心流程:选择要操作的内容 - 进行操作 - 显示操作结果 - -相关组件:[下拉框](/vue/components/dropdown) 、[多选框](/vue/components/checkbox) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 - - - -
- -## 效果预览 - -当编辑或改变的数据未最终生效时,提前用户了解编辑或改变的数据效果的任务。常用于「[仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) 」「 [结果页](https://tdesign.tencent.com/starter/vue/#/result/success) 」「 [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」 。 - -### A 异步触发 - -何时使用:当需要配置或调整的元素较多、或实时刷新效果有延迟,需要集中预览效果时。常在页面整体出现预览。 - -核心流程:填写表单/或配置项-点击预览-进行预览 - -相关组件:[表单](/vue/components/form)、[按钮](/vue/components/button)、[输入框](/vue/components/input)、[上传](/vue/components/upload)、[下拉菜单](/vue/components/dropdown)、[单选框](/vue/components/radio)、[多选框](/vue/components/checkbox)、[选择器](/vue/components/select) 等 - - - -### B 同步预览 - -何时使用:在配置设置项或信息元素过程中,需要实时关注最终效果、或观察配置项变化时。常用在页面局部出现预览。 - -核心流程:填写表单/设置项-进行预览 - -相关组件:[表单](/vue/components/form)、[按钮](/vue/components/button)、[输入框](/vue/components/input)、[上传](/vue/components/upload)、[下拉菜单](/vue/components/dropdown)、[单选框](/vue/components/radio)、[多选框](/vue/components/checkbox)、[选择器](/vue/components/select) 等 - - - -
- -## 新手指引 - -为新用户提供功能介绍或使用说明等信息的指引性任务。是在任意页面都会经常出现的基础任务。 - -### A 阻断式指引 - -何时使用:当需要用户必读、或在指引过程中不建议用户做其他操作时,让用户聚焦关注指引内容。 - -核心流程:触发引导 - 逐步查看引导 - 结束引导 - -相关组件:[对话框](/vue/components/dialog) - - - -### B 非阻断式引导 - -何时使用:当指引内容为辅助说明、或需要在操作界面的同时查看指引时,让用户可选择的使用指引。 - -核心流程:触发引导 - 逐步查看引导 或 忽视引导继续操作界面 - 结束引导 - -相关组件:[气泡确认框](/vue/components/popconfirm)、[弹出层](/vue/components/popup)、[文字提示](/vue/components/tooltip) - - - -### 其他场景:主动触发引导 - -何时使用:当指引内容较多、或用户需要反复查看时,可提供用户可主动触发的入口。 - -核心流程:触发引导 - 选择任务 - 进入引导 - 逐步查看引导 - 结束引导 - -相关组件:[气泡确认框](/vue/components/popconfirm)、[弹出层](/vue/components/popup)、[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog) 等 - - - -
- -## 数据导入 - -将本地数据导入到中后台系统中的任务。常应用于[列表页](https://tdesign.tencent.com/starter/vue/#/list/base) 。 - -### A 逐个文件导入 - -何时使用:当需要轻量快速导入数据并显示结果、或待导入的数据格式较集中时,可逐个快速导入。 - -核心流程:触发导入 - 选择要导入的一个文件 - 开始导入 - 收到导入结果 - -相关组件:[按钮](/vue/components/button)、[上传](/vue/components/upload)、[全局提示](/vue/components/message)、[表格](/vue/components/table)、[列表](/vue/components/list)、[文字提示](/vue/components/tooltip) 等 - - - -### B 批量文件导入 - -何时使用:当待导入的数据较复杂、或数据文件有多个,可批量上传后,再导入需要的数据。 - -核心流程:触发导入 - 选择上传文件的方式 - 批量上传文件 - 确认批量文件的上传结果 - 导入文件 - -相关组件:[按钮](/vue/components/button)、[上传](/vue/components/upload)、[全局提示](/vue/components/message)、[表格](/vue/components/table)、[列表](/vue/components/list)、[对话框](/vue/components/dialog) 等 - - - -
- -## 状态流转 - -在使用某条数据项的过程中,对该项数据的状态进行调整或变化的任务。常应用于「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base) 」「 [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」「[结果页](https://tdesign.tencent.com/starter/vue/#/result/success) 」。 - -### A 通过详情进行状态流转 - -何时使用:当单条信息内容较多或较复杂时,需要用户查看信息详情、明确详情内容内容后,再进行状态流转决策。 - -核心流程:在列表中选定数据项 - 查看数据详情 - 选择要流转的状态 - 确定流转 - 显示流转结果 - -相关组件:[步骤条](/vue/components/steps)、[表格](/vue/components/table)、[表单](/vue/components/form)、[下拉菜单](/vue/components/dropdown)、[按钮](/vue/components/button) 等 - - - -### B 通过列表摘要进行状态流转 - -何时使用:当单条信息内容较少,在标题或摘要中即可了解,或无需校验详情内容即可进行状态流转决策时。 - -核心流程:在列表中选定数据项 - 选择要流转的状态 - 显示流转结果 - -相关组件:[列表](/vue/components/list)、[表格](/vue/components/table)、[下拉菜单](/vue/components/dropdown)、[按钮](/vue/components/button) 等 - - - -
- -## 任务引导 - -当用户需要完成某个任务或使用某项功能时,为用户提供必要的指导或说明的任务。常应用于「[详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」「[结果页](https://tdesign.tencent.com/starter/vue/#/result/success)」。 - -### A 任务开始前的引导 - -何时使用:当任务较复杂、或任务执行前需做必要准备时,给用户相关引导或提示。 - -核心流程:查看引导内容 - 按引导执行任务 - -相关组件:[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog)、[步骤条](/vue/components/steps)、[卡片](/vue/components/card)、[按钮](/vue/components/button) 等 - - - -### B 任务结束后的引导 - -何时使用:当任务结束后,其结果与另一任务相关、或任务完成后的数据会触发其他操作时,给用户后续操作的引导或提示。 - -核心流程:执行任务 - 查看任务结果引导 - 选择是否根据引导执行下一任务 - -相关组件:[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog)、[步骤条](/vue/components/steps)、[卡片](/vue/components/card)、[按钮](/vue/components/button) 等 - - - -
- - +--- +title: 中后台高频任务设计方法 +description: 明确整体框架和页面布局后,根据业务场景,对相关任务流程进行设计。 +isDesign: true +--- + +中后台产品虽服务不同业务,但存在非常同质化的高频任务,掌握这些任务的设计方法,可有效提高中后台的交互体验。 + +## 数据筛选与查询 + +按所需条件或类型选择需要的数据项、或查询数据结果的任务。常应用于「[仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) 」「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base)」。 + +### A 查询后生效 + +何时使用:当用户对数据查询范围有明确针对性,需要对数据进行一系列筛选过滤的使用场景时,可使用查询器进行一次性提交生效。 + +核心流程:选择条件 - 触发查询 - 获得结果数据 - 清空条件 + +相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 + + + +### B 立即生效 + +何时使用:当数据查询范围较为随机,用户需要反复、多次修改条件时,可实时显示筛选结果,来提高查询效率。 + +核心流程:条件选择 - 获得结果数据 -条件修改 - 获得结果数据 + +相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 + + + +### 其他场景:折叠条件 + +何时使用:当筛选项过多,全部显示会增加用户信息识别效率,可只显示高频选项,其他选项折叠,需要时自定义展开。 + +核心流程:展开条件 - 条件选择 - 获得结果数据 + +相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 + + + 图示:隐藏固定选项的条件 + + + 图示:隐藏固定选项的条件 + +### 其他场景:条件模版保存与调用 + +何时使用:当用户的筛选需求个性化较强,需要根据自身需要使用筛选项时,提供可自定义保存的筛选器。 + +核心流程:条件选择 - 保存为模版 -模版调用 + +相关组件:[时间选择器](/vue/components/timepicker) 、[日期选择器](/vue/components/datepicker) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 + + + +
+ +## 表格批量操作 + +对报表中的多项数据进行统一操作的任务。常应用于「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base)」。 + +### A 所见即所得 + +何时使用:当批量操作按钮为主要或高频操作时,无论是否已选择数据,均在页面给用户见即所得的操作预期。 + +核心流程:选择要操作的内容 - 进行操作 - 显示操作结果 + +相关组件:[表格](/vue/components/table)、[按钮](/vue/components/button)、[多选框](/vue/components/checkbox)、[下拉菜单](/vue/components/dropdown)、[全局提示](/vue/components/message) 等 + + + +### B 选择后触发 + +何时使用:当页面已有主要按钮,批量操作为次级或非高频操作时,可在选择数据后显示操作区。 + +核心流程:选择要操作的内容 - 进行操作 - 显示操作结果 + +相关组件:[下拉框](/vue/components/dropdown) 、[多选框](/vue/components/checkbox) 、[输入框](/vue/components/input) 、[选择器](/vue/components/select) 、[按钮](/vue/components/button) 、[表格](/vue/components/table) 等 + + + +
+ +## 效果预览 + +当编辑或改变的数据未最终生效时,提前用户了解编辑或改变的数据效果的任务。常用于「[仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) 」「 [结果页](https://tdesign.tencent.com/starter/vue/#/result/success) 」「 [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」 。 + +### A 异步触发 + +何时使用:当需要配置或调整的元素较多、或实时刷新效果有延迟,需要集中预览效果时。常在页面整体出现预览。 + +核心流程:填写表单/或配置项-点击预览-进行预览 + +相关组件:[表单](/vue/components/form)、[按钮](/vue/components/button)、[输入框](/vue/components/input)、[上传](/vue/components/upload)、[下拉菜单](/vue/components/dropdown)、[单选框](/vue/components/radio)、[多选框](/vue/components/checkbox)、[选择器](/vue/components/select) 等 + + + +### B 同步预览 + +何时使用:在配置设置项或信息元素过程中,需要实时关注最终效果、或观察配置项变化时。常用在页面局部出现预览。 + +核心流程:填写表单/设置项-进行预览 + +相关组件:[表单](/vue/components/form)、[按钮](/vue/components/button)、[输入框](/vue/components/input)、[上传](/vue/components/upload)、[下拉菜单](/vue/components/dropdown)、[单选框](/vue/components/radio)、[多选框](/vue/components/checkbox)、[选择器](/vue/components/select) 等 + + + +
+ +## 新手指引 + +为新用户提供功能介绍或使用说明等信息的指引性任务。是在任意页面都会经常出现的基础任务。 + +### A 阻断式指引 + +何时使用:当需要用户必读、或在指引过程中不建议用户做其他操作时,让用户聚焦关注指引内容。 + +核心流程:触发引导 - 逐步查看引导 - 结束引导 + +相关组件:[对话框](/vue/components/dialog) + + + +### B 非阻断式引导 + +何时使用:当指引内容为辅助说明、或需要在操作界面的同时查看指引时,让用户可选择的使用指引。 + +核心流程:触发引导 - 逐步查看引导 或 忽视引导继续操作界面 - 结束引导 + +相关组件:[气泡确认框](/vue/components/popconfirm)、[弹出层](/vue/components/popup)、[文字提示](/vue/components/tooltip) + + + +### 其他场景:主动触发引导 + +何时使用:当指引内容较多、或用户需要反复查看时,可提供用户可主动触发的入口。 + +核心流程:触发引导 - 选择任务 - 进入引导 - 逐步查看引导 - 结束引导 + +相关组件:[气泡确认框](/vue/components/popconfirm)、[弹出层](/vue/components/popup)、[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog) 等 + + + +
+ +## 数据导入 + +将本地数据导入到中后台系统中的任务。常应用于[列表页](https://tdesign.tencent.com/starter/vue/#/list/base) 。 + +### A 逐个文件导入 + +何时使用:当需要轻量快速导入数据并显示结果、或待导入的数据格式较集中时,可逐个快速导入。 + +核心流程:触发导入 - 选择要导入的一个文件 - 开始导入 - 收到导入结果 + +相关组件:[按钮](/vue/components/button)、[上传](/vue/components/upload)、[全局提示](/vue/components/message)、[表格](/vue/components/table)、[列表](/vue/components/list)、[文字提示](/vue/components/tooltip) 等 + + + +### B 批量文件导入 + +何时使用:当待导入的数据较复杂、或数据文件有多个,可批量上传后,再导入需要的数据。 + +核心流程:触发导入 - 选择上传文件的方式 - 批量上传文件 - 确认批量文件的上传结果 - 导入文件 + +相关组件:[按钮](/vue/components/button)、[上传](/vue/components/upload)、[全局提示](/vue/components/message)、[表格](/vue/components/table)、[列表](/vue/components/list)、[对话框](/vue/components/dialog) 等 + + + +
+ +## 状态流转 + +在使用某条数据项的过程中,对该项数据的状态进行调整或变化的任务。常应用于「[列表页](https://tdesign.tencent.com/starter/vue/#/list/base) 」「 [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」「[结果页](https://tdesign.tencent.com/starter/vue/#/result/success) 」。 + +### A 通过详情进行状态流转 + +何时使用:当单条信息内容较多或较复杂时,需要用户查看信息详情、明确详情内容内容后,再进行状态流转决策。 + +核心流程:在列表中选定数据项 - 查看数据详情 - 选择要流转的状态 - 确定流转 - 显示流转结果 + +相关组件:[步骤条](/vue/components/steps)、[表格](/vue/components/table)、[表单](/vue/components/form)、[下拉菜单](/vue/components/dropdown)、[按钮](/vue/components/button) 等 + + + +### B 通过列表摘要进行状态流转 + +何时使用:当单条信息内容较少,在标题或摘要中即可了解,或无需校验详情内容即可进行状态流转决策时。 + +核心流程:在列表中选定数据项 - 选择要流转的状态 - 显示流转结果 + +相关组件:[列表](/vue/components/list)、[表格](/vue/components/table)、[下拉菜单](/vue/components/dropdown)、[按钮](/vue/components/button) 等 + + + +
+ +## 任务引导 + +当用户需要完成某个任务或使用某项功能时,为用户提供必要的指导或说明的任务。常应用于「[详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) 」「[结果页](https://tdesign.tencent.com/starter/vue/#/result/success)」。 + +### A 任务开始前的引导 + +何时使用:当任务较复杂、或任务执行前需做必要准备时,给用户相关引导或提示。 + +核心流程:查看引导内容 - 按引导执行任务 + +相关组件:[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog)、[步骤条](/vue/components/steps)、[卡片](/vue/components/card)、[按钮](/vue/components/button) 等 + + + +### B 任务结束后的引导 + +何时使用:当任务结束后,其结果与另一任务相关、或任务完成后的数据会触发其他操作时,给用户后续操作的引导或提示。 + +核心流程:执行任务 - 查看任务结果引导 - 选择是否根据引导执行下一任务 + +相关组件:[文字提示](/vue/components/tooltip)、[对话框](/vue/components/dialog)、[步骤条](/vue/components/steps)、[卡片](/vue/components/card)、[按钮](/vue/components/button) 等 + + + +
+ + diff --git a/docs/design/offices_zh-CN.md b/docs/design/offices_zh-CN.md index 9c6c9713e..a716f49d3 100644 --- a/docs/design/offices_zh-CN.md +++ b/docs/design/offices_zh-CN.md @@ -12,76 +12,59 @@ isDesign: true 在 Web 前端设计当中,中台与后台具有同质性,可看作同一类型来思考设计方法。通过 TDesign 提供的组件能力快速搭建好用的中后台系统,通常可以分三步:选择合适的页面框架-设计页面间的任务流程-合理使用组件。 - ## 中后台页面框架的选择 页面框架由「页面导航」与「页面布局」两部分组成。同时,TDesign 提供常见的页面模版,可根据需要直接选择合适的模版。 - ### 页面导航 导航是指:在页面中引导用户找到功能和理解信息层级,可分为整站导航与区域导航两大类。 - -| 导航分类 | 定义 |相关组件 | -| :--------- | :----------------------------------------------------------- | :----------------------------------------------------------- | -| 整站导航 | 对整个网站系统的最大颗粒度模块的引导,也称为全局导航或总导航。| [导航菜单](/vue/components/menu) -| 区域导航 | 对某一模块下的页面,进行引导和分类的导航,也称为情景导航。 | [固钉](/vue/components/affix) 、[锚点](/vue/components/anchor)、[面包屑](/vue/components/breadcrumb)、[下拉菜单](/vue/components/dropdown)、[分页](/vue/components/pagination)、[步骤条](/vue/components/steps)、[选项卡](/vue/components/tabs) - +| 导航分类 | 定义 | 相关组件 | +| :------- | :------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 整站导航 | 对整个网站系统的最大颗粒度模块的引导,也称为全局导航或总导航。 | [导航菜单](/vue/components/menu) | +| 区域导航 | 对某一模块下的页面,进行引导和分类的导航,也称为情景导航。 | [固钉](/vue/components/affix) 、[锚点](/vue/components/anchor)、[面包屑](/vue/components/breadcrumb)、[下拉菜单](/vue/components/dropdown)、[分页](/vue/components/pagination)、[步骤条](/vue/components/steps)、[选项卡](/vue/components/tabs) | - ### 页面布局 页面布局是指:将导航和信息内容在页面中进行合理安排和分布,由「[栅格](/vue/components/grid)」和「[布局](/vue/components/layout)」组成。 - - 不同布局的选择依据,通常为:1 功能模块的数量。2 功能与功能之间的相关性。 TDesign主要提供3种布局方式:上下布局、左右布局、混合布局。 - #### 上下结构的布局 主要特征:导航在上信息内容在下的布局。横向导航空间有限,左右点击效率低。 何时使用:1 功能模块数量较少时(一般小于 9 个)。2 各模块间关联较弱、需要做明确区分或无需频繁切换时。 - #### 左右结构的布局 主要特征:导航在左信息内容在右的布局。纵向空间具有较好延展性,上下点击效率高。 何时使用:1 功能模块数量较多时。2 各模块间有一定相关性、或需要在模块间频繁切换时。 - #### 混合结构的布局 主要特征:将上下、左右相结合的综合布局。横纵空间优势互补,在展示和操作上都具有较好的延展性和包容性。 何时使用:1 功能模块数量较多时。2 各模块间有父子或交叉关系、 需要按层级展示时。 - - - - ## 常见的中后台页面 TDesign提供了中后台系统常见的页面模板,涵盖多种高频任务在页面中的典型布局方式。 -| 典型页面模板 | 相关高频任务 | -| :--------- | :----------------------------------------------------------- | -| [仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[效果预览](/design/offices-task#效果预览)、[新手指引](/design/offices-task#新手指引) | -| [列表页](https://tdesign.tencent.com/starter/vue/#/list/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[表格批量操作](/design/offices-task#表格批量操作)、[数据导入](/design/offices-task#数据导入)、[效果预览](/design/offices-task#效果预览)、[状态流转](/design/offices-task#状态流转)、[任务引导](/design/offices-task#任务引导) 、[新手指引](/design/offices-task#新手指引) | -| [表单页](https://tdesign.tencent.com/starter/vue/#/form/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[任务引导](/design/offices-task#任务引导)、[效果预览](/design/offices-task#效果预览)、[新手指引](/design/offices-task#新手指引) | -| [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[状态流转](/design/offices-task#状态流转)、[数据导入](/design/offices-task#数据导入)、[效果预览](/design/offices-task#效果预览) | -| [结果页](https://tdesign.tencent.com/starter/vue/#/result/success) | [状态流转](/design/offices-task#状态流转)、[新手指引](/design/offices-task#新手指引)、[任务引导](/design/offices-task#任务引导) | -| [个人页](https://tdesign.tencent.com/starter/vue/#/user/index) | [新手指引](/design/offices-task#新手指引)、[效果预览](/design/offices-task#效果预览) | -| [登录页](https://tdesign.tencent.com/starter/vue/#/login) | [新手指引](/design/offices-task#新手指引)、[任务引导](/design/offices-task#任务引导) | - - - +| 典型页面模板 | 相关高频任务 | +| :----------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [仪表盘](https://tdesign.tencent.com/starter/vue/#/dashboard/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[效果预览](/design/offices-task#效果预览)、[新手指引](/design/offices-task#新手指引) | +| [列表页](https://tdesign.tencent.com/starter/vue/#/list/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[表格批量操作](/design/offices-task#表格批量操作)、[数据导入](/design/offices-task#数据导入)、[效果预览](/design/offices-task#效果预览)、[状态流转](/design/offices-task#状态流转)、[任务引导](/design/offices-task#任务引导) 、[新手指引](/design/offices-task#新手指引) | +| [表单页](https://tdesign.tencent.com/starter/vue/#/form/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[任务引导](/design/offices-task#任务引导)、[效果预览](/design/offices-task#效果预览)、[新手指引](/design/offices-task#新手指引) | +| [详情页](https://tdesign.tencent.com/starter/vue/#/detail/base) | [数据筛选与查询](/design/offices-task#数据筛选与查询)、[状态流转](/design/offices-task#状态流转)、[数据导入](/design/offices-task#数据导入)、[效果预览](/design/offices-task#效果预览) | +| [结果页](https://tdesign.tencent.com/starter/vue/#/result/success) | [状态流转](/design/offices-task#状态流转)、[新手指引](/design/offices-task#新手指引)、[任务引导](/design/offices-task#任务引导) | +| [个人页](https://tdesign.tencent.com/starter/vue/#/user/index) | [新手指引](/design/offices-task#新手指引)、[效果预览](/design/offices-task#效果预览) | +| [登录页](https://tdesign.tencent.com/starter/vue/#/login) | [新手指引](/design/offices-task#新手指引)、[任务引导](/design/offices-task#任务引导) | diff --git a/docs/faq_zh-CN.md b/docs/faq_zh-CN.md index 9eba8784b..28801b50a 100644 --- a/docs/faq_zh-CN.md +++ b/docs/faq_zh-CN.md @@ -18,4 +18,5 @@ title: 常见问题 - 非受控用法:既初始值用法,不传入 value 属性,使用对应的初始值属性 defaultValue 设置组件初始状态,此时组件会在内部维护该状态,用户通过交互触发更新事件 onChange 之后,组件内部直接更新组件状态。 ### 如何在设计工具 Sketch 中使用 TDesign -有两种方式,一是可以使用 TDesign 提供的 Sketch 源文件,它包括桌面端及移动端(近期上线),也可以使用 TDesign 提供的 Sketch 插件,具体使用方式请参考 [《插件使用手册》](https://doc.weixin.qq.com/doc/w3_m_OkshgETGpoGB?scode=AJEAIQdfAAoYvGqGCUAL8AZgbdAFw)。 \ No newline at end of file + +有两种方式,一是可以使用 TDesign 提供的 Sketch 源文件,它包括桌面端及移动端(近期上线),也可以使用 TDesign 提供的 Sketch 插件,具体使用方式请参考 [《插件使用手册》](https://doc.weixin.qq.com/doc/w3_m_OkshgETGpoGB?scode=AJEAIQdfAAoYvGqGCUAL8AZgbdAFw)。 diff --git a/docs/introduce.md b/docs/introduce.md index 5cee63086..84e2dfcf6 100644 --- a/docs/introduce.md +++ b/docs/introduce.md @@ -44,7 +44,7 @@ TDesign currently supports [multiple platforms and mainstream front-end UI frame | [tdesign-mobile-vue](https://github.com/Tencent/tdesign-mobile-vue) | Vue3.x Mobile UI components lib for TDesign | `1.0 LTS` | | [tdesign-mobile-react](https://github.com/Tencent/tdesign-mobile-react) | React Mobile UI components lib for TDesign | `1.0 LTS` | | [tdesign-flutter](https://github.com/Tencent/tdesign-flutter) | Flutter UI components lib for TDesign | `1.0 LTS` | -| [tdesign-uniapp](https://github.com/Tencent/tdesign-miniprogram) | Uniapp UI components lib for TDesign | `1.0 LTS` | +| [tdesign-uniapp](https://github.com/Tencent/tdesign-miniprogram) | Uniapp UI components lib for TDesign | `1.0 LTS` | ### Repositories for Common diff --git a/docs/tech.md b/docs/tech.md index a58c431c8..446da5798 100644 --- a/docs/tech.md +++ b/docs/tech.md @@ -37,7 +37,7 @@ UI development is shared among multiple implementation frameworks such as React, ```js // button.tsx -import "./button.less"; +import './button.less'; ``` ## Guidelines diff --git a/docs/tech_zh-CN.md b/docs/tech_zh-CN.md index 378a9ccae..f32ce467d 100644 --- a/docs/tech_zh-CN.md +++ b/docs/tech_zh-CN.md @@ -3,6 +3,7 @@ title: 整体方案 --- 请参考 [《TDesign 组件库技术方案指北》](https://mp.weixin.qq.com/s?__biz=Mzg3MjYwODA1OA==&mid=2247515208&idx=1&sn=166d4a5313cadbb80d2a401edf46b455) + ## 仓库结构说明 每个仓库对应一个组件库技术栈实现,包含各自技术栈实现代码和一个 [tdesign-common](https://github.com/Tencent/tdesign-common) 子仓库,子仓库作为公共库包含: @@ -41,7 +42,7 @@ UI 开发(HTML & CSS)是由 React/Vue 等多个实现框架共用的。各 // button.tsx // 先引入临时的样式文件用于开发功能,待 UI 开发完成之后需要与 UI 样式对齐并删除 less 文件 -import "./button.less"; +import './button.less'; ``` ## 规范 @@ -83,13 +84,13 @@ feat 与 fix 提交将被用于生成 changelog ## 技术选型 -| 类目 | 方案 | 参考链接 | -| ------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 开发语言 | ts | [http://www.typescriptlang.org/](http://www.typescriptlang.org/) | -| 样式语言 | less | [http://lesscss.org/](http://lesscss.org/) | +| 类目 | 方案 | 参考链接 | +| ------------ | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- | +| 开发语言 | ts | [http://www.typescriptlang.org/](http://www.typescriptlang.org/) | +| 样式语言 | less | [http://lesscss.org/](http://lesscss.org/) | | 构建工具 | vite 组件库本地开发
rollup 组件库打包 | [https://vitejs.dev/](https://vitejs.dev/)
[https://www.rollupjs.com/](https://www.rollupjs.com/) | -| 测试工具 | jest
cypress e2e 测试 | [https://jestjs.io/](https://jestjs.io/)
[https://www.cypress.io/](https://www.cypress.io/) | -| web-vue | vue@2.x | [https://github.com/vuejs/vue](https://github.com/vuejs/vue) | -| web-vue-next | vue@3.x | [https://github.com/vuejs/vue-next](https://github.com/vuejs/vue-next) | -| mobile-vue | vue@3.x | [https://github.com/vuejs/vue-next](https://github.com/vuejs/vue-next) | -| react | react@16.x | [https://github.com/facebook/react](https://github.com/facebook/react) | +| 测试工具 | jest
cypress e2e 测试 | [https://jestjs.io/](https://jestjs.io/)
[https://www.cypress.io/](https://www.cypress.io/) | +| web-vue | vue@2.x | [https://github.com/vuejs/vue](https://github.com/vuejs/vue) | +| web-vue-next | vue@3.x | [https://github.com/vuejs/vue-next](https://github.com/vuejs/vue-next) | +| mobile-vue | vue@3.x | [https://github.com/vuejs/vue-next](https://github.com/vuejs/vue-next) | +| react | react@16.x | [https://github.com/facebook/react](https://github.com/facebook/react) | diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..c5cf3457e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,148 @@ +import js from '@eslint/js'; +import prettierConfig from 'eslint-config-prettier'; +import pluginVue from 'eslint-plugin-vue'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { + ignores: [ + '**/node_modules/**', + '.pnpm-store/**', + '**/dist/**', + '**/lib/**', + '**/_data/**', + '**/_site/**', + '**/results/**', + '**/static_site/**', + '**/coverage/**', + // site + 'site/plugins/tdoc/**', + 'site/public/**', + 'site/src/pages/design/assets/motion/**', + ], + }, + + js.configs.recommended, + ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + ...pluginVue.configs['flat/recommended'], + prettierConfig, + + { + linterOptions: { + reportUnusedDisableDirectives: 'error', + }, + rules: { + 'no-console': ['warn', { allow: ['warn', 'error'] }], + // smart 模式允许 `== null` / `!= null` 这类惯用写法,其余松散比较强制严格相等 + eqeqeq: ['error', 'smart'], + 'no-var': 'error', + 'prefer-const': 'error', + // 允许空的箭头函数/方法:项目里大量用作默认回调、清理钩子等有意为之的空实现 + '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions', 'methods'] }], + }, + }, + + { + // 浏览器端源码:仅注入浏览器全局,避免误用 Node 专有全局 + files: ['site/src/**'], + languageOptions: { + globals: { + ...globals.browser, + aegis: 'readonly', + NProgress: 'readonly', + }, + }, + }, + + { + // Node 端源码:仅注入 Node 全局 + files: ['services/**', 'packages/*/script/**', 'packages/*/config/**'], + languageOptions: { + globals: { + ...globals.node, + }, + }, + }, + + { + files: ['**/*.{ts,tsx,mts,cts}'], + rules: { + 'no-undef': 'off', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + }, + }, + + { + files: ['**/*.vue'], + languageOptions: { + parserOptions: { + parser: tseslint.parser, + }, + }, + rules: { + 'no-undef': 'off', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + 'vue/multi-word-component-names': 'off', + 'vue/no-deprecated-slot-attribute': 'off', + 'vue/require-default-prop': 'off', + 'vue/no-unused-refs': 'error', + 'vue/no-useless-template-attributes': 'error', + }, + }, + + { + // Node CommonJS 配置文件(module.exports / require) + files: [ + '**/*.cjs', + 'services/**/*.js', + '.commitlintrc.js', + '.prettierrc.js', + '.stylelintrc.js', + 'site/postcss.config.js', + ], + languageOptions: { + globals: { + ...globals.node, + }, + }, + rules: { + '@typescript-eslint/no-require-imports': 'off', + 'no-console': 'off', + }, + }, + + { + files: [ + 'packages/auto-release-collection/**', + 'packages/site-components/script/**', + 'packages/site-components/vite.config.ts', + ], + rules: { + 'no-console': 'off', + }, + }, + + { + files: ['site/src/pages/home/banner.vue'], + rules: { + 'no-console': ['warn', { allow: ['warn', 'error', 'time', 'timeEnd', 'log'] }], + }, + }, + + { + // 这些文件仅渲染受信任的内容:本地导入的 SVG 常量、i18n 文案、站点配置或服务端渲染的文档正文 + files: [ + 'packages/theme-generator/src/**/*.vue', + 'site/src/components/design-source.vue', + 'site/src/pages/about/release.vue', + 'site/src/pages/design/motion.vue', + ], + rules: { + 'vue/no-v-html': 'off', + }, + }, +); diff --git a/package.json b/package.json index ab33d04b6..0bde56a50 100644 --- a/package.json +++ b/package.json @@ -12,30 +12,44 @@ "site:preview": "pnpm run build:components && pnpm run --filter tdesign-site site:preview", "auto-release-collection": "pnpm run --filter auto-release-collection start", "test": "pnpm -r run --if-present test", - "lint": "pnpm -r run --if-present lint", - "lint:fix": "pnpm -r run --if-present lint:fix", + "lint": "run-s lint:parallel typecheck", + "lint:parallel": "run-p lint:css lint:js lint:eslint", + "lint:css": "stylelint \"**/*.{css,wxss,less,vue}\" --allow-empty-input --cache", + "lint:js": "prettier --check \"**/*.{vue,js,ts,jsx,tsx,json,md}\"", + "lint:eslint": "eslint . --max-warnings 0 --cache", + "lint:css:fix": "stylelint \"**/*.{css,wxss,less,vue}\" --fix --allow-empty-input --cache", + "lint:js:fix": "prettier --write \"**/*.{vue,js,ts,jsx,tsx,json,md}\"", + "lint:eslint:fix": "eslint . --fix --max-warnings 0 --cache", + "lint:fix": "pnpm run lint:css:fix && pnpm run lint:js:fix && pnpm run lint:eslint:fix", + "typecheck": "pnpm -r run --if-present typecheck", + "format": "pnpm run lint:js:fix", "build": "pnpm -r run --if-present build", - "prepare": "husky install" + "prepare": "husky" }, "license": "MIT", "dependencies": { "prismjs": "^1.29.0" }, "devDependencies": { - "@commitlint/cli": "^8.2.0", - "@commitlint/config-conventional": "^8.2.0", - "cz-conventional-changelog": "^3.0.2", - "eslint": "^7.32.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-html": "^7.1.0", - "eslint-plugin-prettier": "^4.2.1", - "husky": "^8.0.0", - "lint-staged": "^16.3.4", - "prettier": "^2.8.8", - "rimraf": "^3.0.2", - "stylelint": "^15.10.3", - "stylelint-config-standard": "^34.0.0", - "stylelint-config-standard-less": "^2.0.0" + "@commitlint/cli": "^21.2.4", + "@commitlint/config-conventional": "^21.2.4", + "@eslint/js": "^10.0.1", + "cz-conventional-changelog": "^3.3.0", + "eslint": "^10.13.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-vue": "^10.11.1", + "globals": "^17.13.0", + "husky": "^9.1.7", + "lint-staged": "^17.6.0", + "npm-run-all2": "^9.0.3", + "postcss-html": "^2.0.0", + "prettier": "^3.9.10", + "rimraf": "^6.1.3", + "stylelint": "^17.16.0", + "stylelint-config-standard": "^40.0.0", + "stylelint-config-standard-less": "^4.1.0", + "typescript-eslint": "^8.72.0", + "vue-eslint-parser": "^10.4.1" }, "engines": { "pnpm": ">=9.0.0" @@ -46,18 +60,24 @@ } }, "lint-staged": { - "**/*.{vue,js,ts,tsx}": [ - "eslint --fix", + "**/*.vue": [ + "stylelint --fix", + "eslint --fix --no-warn-ignored", + "prettier --write" + ], + "**/*.{js,ts,jsx,tsx,mts,cts}": [ + "eslint --fix --no-warn-ignored", "prettier --write" ], "**/*.html": [ "prettier --write" ], - "**/*.{json,jsonc}": [ + "**/*.{json,jsonc,md}": [ "prettier --write" ], - "**/*.less": [ - "stylelint --fix" + "**/*.{css,less,wxss}": [ + "stylelint --fix", + "prettier --write" ] } } diff --git a/packages/auto-release-collection/.eslintrc.js b/packages/auto-release-collection/.eslintrc.js deleted file mode 100644 index 8f7f17b5d..000000000 --- a/packages/auto-release-collection/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - root: true, - extends: ['plugin:@typescript-eslint/recommended'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - ignorePatterns: ['dist', 'node_modules'], - rules: {}, -}; diff --git a/packages/auto-release-collection/package.json b/packages/auto-release-collection/package.json index 2e1dcae29..ec89cafff 100644 --- a/packages/auto-release-collection/package.json +++ b/packages/auto-release-collection/package.json @@ -7,7 +7,6 @@ "prebuild": "rimraf dist/*", "dev": "tsx watch src/index.ts", "start": "tsx src/index.ts", - "lint": "eslint --ext .ts src", "build": "tsc" }, "keywords": [], @@ -17,8 +16,6 @@ "@actions/github": "^6.0.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.6.0", - "@typescript-eslint/parser": "^5.6.0", "nodemon": "^3.1.7", "tsx": "^4.19.3", "typescript": "^5.9.3" diff --git a/packages/auto-release-collection/src/utils.ts b/packages/auto-release-collection/src/utils.ts index 9070533de..ab10e6312 100644 --- a/packages/auto-release-collection/src/utils.ts +++ b/packages/auto-release-collection/src/utils.ts @@ -43,8 +43,8 @@ export function getReleaseData() { * 22号:生成这个月的15号 - 21号的版本 */ - let START_DATE = ''; - let END_DATE = ''; + let START_DATE: string; + let END_DATE: string; const today = new Date(); @@ -108,7 +108,7 @@ export function getReleaseData() { } export function getReleaseContent(projectOutputs: string[]) { - return projectOutputs.filter((output) => output.trim() != '').join('\n'); + return projectOutputs.filter((output) => output.trim() !== '').join('\n'); } export function createRelease(tag: string, title: string, content: string) { diff --git a/packages/site-components/.eslintrc.js b/packages/site-components/.eslintrc.js deleted file mode 100644 index c7e580faa..000000000 --- a/packages/site-components/.eslintrc.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - root: true, - extends: ['./../../.eslintrc.js'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - }, - rules: { - 'no-undef': 'off', - 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], - }, -}; diff --git a/packages/site-components/README.md b/packages/site-components/README.md index 7d486cfe6..4b2ec790a 100755 --- a/packages/site-components/README.md +++ b/packages/site-components/README.md @@ -20,8 +20,8 @@ npm build ```javascript // import @tdesign/site-components es module and style -import "@tdesign/site-components"; -import "@tdesign/site-components/lib/styles/style.css"; +import '@tdesign/site-components'; +import '@tdesign/site-components/lib/styles/style.css'; // splice webcomponents into pages diff --git a/packages/site-components/config/header.ts b/packages/site-components/config/header.ts index 804aad6bd..aea803c8e 100755 --- a/packages/site-components/config/header.ts +++ b/packages/site-components/config/header.ts @@ -96,11 +96,9 @@ export const getHeaderConfig = (): HeaderConfig => { const intranet = isIntranet(); const en = isEn(); - const headerItems: Array = [ - { name: en ? 'Design' : '设计语言', path: jumpLocation('/design'), type: 'main', target: '_self' }, - { name: en ? 'Resources' : '设计资源', path: jumpLocation('/source'), type: 'main', target: '_self' }, - { name: en ? 'Components' : '前端组件', type: 'base', target: '_self' }, - { name: en ? 'Icons' : '图标', path: jumpLocation('/icons'), type: 'main', target: '_self' }, + const headerItems: (HeaderItem | null)[] = [ + { name: en ? 'Design' : '设计', path: jumpLocation('/design'), type: 'main', target: '_self' }, + { name: en ? 'Components' : '基础组件', path: jumpLocation('/vue/overview'), type: 'base', target: '_self' }, intranet ? { name: en ? 'Industry component' : '行业组件', path: '/trade', type: 'main', target: '_self' } : null, { name: en ? 'Templates' : '页面模板', diff --git a/packages/site-components/index.html b/packages/site-components/index.html index c7ea23251..9abced3e4 100755 --- a/packages/site-components/index.html +++ b/packages/site-components/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/site-components/package.json b/packages/site-components/package.json index 3d59c6e4b..e5701cf94 100755 --- a/packages/site-components/package.json +++ b/packages/site-components/package.json @@ -8,7 +8,6 @@ "watch": "vite build --watch", "build": "vite build --debug", "typecheck": "tsc --noEmit", - "lint": "eslint src config script --ext .ts", "test": "vitest run --coverage", "test:watch": "vitest" }, @@ -35,8 +34,6 @@ "@types/nprogress": "^0.2.3", "@types/prismjs": "^1.26.5", "@types/qrcode": "^1.5.5", - "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", "@vitest/coverage-v8": "^5.0.3", "fs-extra": "^10.0.0", "happy-dom": "^15.11.7", diff --git a/packages/site-components/script/compile-less.ts b/packages/site-components/script/compile-less.ts index 02f547454..2e1e03b40 100755 --- a/packages/site-components/script/compile-less.ts +++ b/packages/site-components/script/compile-less.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import fs from 'fs-extra'; import { execSync } from 'child_process'; diff --git a/packages/site-components/src/__tests__/td-doc-popup.spec.ts b/packages/site-components/src/__tests__/td-doc-popup.spec.ts index ca5eeeef5..196ae4bbe 100644 --- a/packages/site-components/src/__tests__/td-doc-popup.spec.ts +++ b/packages/site-components/src/__tests__/td-doc-popup.spec.ts @@ -2,13 +2,13 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import type { Mock } from 'vitest'; import docPopup from '../components/td-doc-popup'; -type PopupHost = { +interface PopupHost { reference: { offsetWidth: number }; placement: string; portalClass: string; portalStyle: string; querySelector: Mock; -}; +} const visibleProp = docPopup.visible as unknown as { connect: (host: PopupHost) => () => void; diff --git a/packages/site-components/src/components/td-ai-button/style.less b/packages/site-components/src/components/td-ai-button/style.less index ac53f6e7a..015ec8e97 100644 --- a/packages/site-components/src/components/td-ai-button/style.less +++ b/packages/site-components/src/components/td-ai-button/style.less @@ -2,8 +2,10 @@ .TDesign-ai-button { border-radius: 6px; border: none; - box-shadow: 0 2px 4px -1px rgba(0, 255, 240, .12), 0 4px 5px 0 rgba(0, 71, 255, .08), - 0 1px 10px 0 rgba(0, 102, 255, .05); + box-shadow: + 0 2px 4px -1px rgba(0, 255, 240, 0.12), + 0 4px 5px 0 rgba(0, 71, 255, 0.08), + 0 1px 10px 0 rgba(0, 102, 255, 0.05); cursor: pointer; background: conic-gradient(#00c3ff, #4ceb1b, #0062ff, #a07cf3, #00c3ff); height: 32px; diff --git a/packages/site-components/src/components/td-ai-button/utils.ts b/packages/site-components/src/components/td-ai-button/utils.ts index 5bfc3cd75..2107ef7fd 100644 --- a/packages/site-components/src/components/td-ai-button/utils.ts +++ b/packages/site-components/src/components/td-ai-button/utils.ts @@ -144,12 +144,11 @@ const createTooltips = (framework: string, generateDemo: boolean, selectedText: tooltip.addEventListener('mousedown', () => { unmountTooltips(); - let prompt = ''; - if (generateDemo) { - prompt = generatePrompt(framework, component, selectedText); - } else { - prompt = component ? `请为我解释${component}的${selectedText}的定义` : `请为我解释${selectedText}的定义`; - } + const prompt = generateDemo + ? generatePrompt(framework, component, selectedText) + : component + ? `请为我解释${component}的${selectedText}的定义` + : `请为我解释${selectedText}的定义`; sendMessage(prompt); }); return tooltip; diff --git a/packages/site-components/src/components/td-backtop/style.less b/packages/site-components/src/components/td-backtop/style.less index bf9de799e..bbd913341 100755 --- a/packages/site-components/src/components/td-backtop/style.less +++ b/packages/site-components/src/components/td-backtop/style.less @@ -14,20 +14,20 @@ box-sizing: border-box; backdrop-filter: blur(10px); background-color: var(--component-border); - cursor: pointer; - transition: all .2s ease; + transition: all 0.2s ease; opacity: 0; visibility: hidden; color: var(--text-secondary); - + &.show { opacity: 1; visibility: visible; } - + &:hover { color: var(--text-primary); + .TDesign-backtop__inner { transform: scale(0.95); } @@ -42,7 +42,7 @@ align-items: center; background-color: var(--bg-color-container-transparent); box-sizing: border-box; - transition: all .2s ease; + transition: all 0.2s ease; svg { width: 20px; @@ -51,4 +51,3 @@ } } } - diff --git a/packages/site-components/src/components/td-code-block/style.less b/packages/site-components/src/components/td-code-block/style.less index 7a4377a80..0a9c4f558 100755 --- a/packages/site-components/src/components/td-code-block/style.less +++ b/packages/site-components/src/components/td-code-block/style.less @@ -1,12 +1,12 @@ -@import "../../styles/prism-theme.less"; -@import "../../styles/prism-theme-dark.less"; +@import '../../styles/prism-theme.less'; +@import '../../styles/prism-theme-dark.less'; :host { display: block; } .TDesign-code-block { - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; border-radius: 6px; border: 1px solid var(--component-border); position: relative; @@ -54,7 +54,7 @@ height: 1px; position: absolute; left: 0; - bottom: 0px; + bottom: 0; z-index: 10; background: var(--brand-main); transition: all 0.2s var(--anim-time-fn-easing); @@ -76,12 +76,11 @@ color: var(--text-primary); &:hover { - &::-webkit-scrollbar-thumb { background-color: var(--bg-color-scroll); } } - + &::-webkit-scrollbar { width: 12px; height: 12px; @@ -91,7 +90,7 @@ &::-webkit-scrollbar-corner { width: 0; } - + &::-webkit-scrollbar-thumb { border-radius: 6px; border: 4px solid transparent; diff --git a/packages/site-components/src/components/td-code/style.less b/packages/site-components/src/components/td-code/style.less index b2ecc3a33..b2f38a001 100755 --- a/packages/site-components/src/components/td-code/style.less +++ b/packages/site-components/src/components/td-code/style.less @@ -10,5 +10,5 @@ } .TDesign-code { - font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } diff --git a/packages/site-components/src/components/td-contributors/style.less b/packages/site-components/src/components/td-contributors/style.less index 3cab14920..bc38be0ea 100755 --- a/packages/site-components/src/components/td-contributors/style.less +++ b/packages/site-components/src/components/td-contributors/style.less @@ -1,5 +1,4 @@ .TDesign-contributors { - .title { font-weight: bold; font-size: 20px; @@ -20,7 +19,7 @@ height: 40px; border-radius: 100%; } - + .avatar { width: 40px; height: 40px; diff --git a/packages/site-components/src/components/td-doc-aside/style.less b/packages/site-components/src/components/td-doc-aside/style.less index d6440400f..4b979db9d 100755 --- a/packages/site-components/src/components/td-doc-aside/style.less +++ b/packages/site-components/src/components/td-doc-aside/style.less @@ -19,7 +19,9 @@ background-color: var(--bg-color-container); color: var(--text-secondary); box-shadow: var(--aside-box-shadow); - transition: transform .2s var(--anim-time-fn-easing), outline .2s var(--anim-time-fn-easing); + transition: + transform 0.2s var(--anim-time-fn-easing), + outline 0.2s var(--anim-time-fn-easing); outline: 9999px solid transparent; &.hide { @@ -36,7 +38,7 @@ } &::after { - content: ""; + content: ''; width: 100%; height: 100px; position: absolute; @@ -50,7 +52,7 @@ font-size: 16px; height: 40px; line-height: 40px; - font-family: TencentSansW7; + font-family: 'TencentSansW7', sans-serif; } &__extra { @@ -62,7 +64,7 @@ } .TDesign-doc-aside-mask { - content: ""; + content: ''; position: fixed; left: 0; top: 0; @@ -77,13 +79,13 @@ left: var(--aside-width); top: 160px; border-radius: 0 3px 3px 0; - box-shadow: 2px 0 8px rgba(0, 0, 0, .26); + box-shadow: 2px 0 8px rgba(0, 0, 0, 0.26); width: 40px; height: 40px; align-items: center; justify-content: center; background-color: var(--bg-color-container); - transition: all .2s var(--anim-time-fn-easing); + transition: all 0.2s var(--anim-time-fn-easing); display: var(--collapse-display); .icon svg { @@ -92,14 +94,13 @@ color: var(--text-primary); } } - + .TDesign-doc-sidenav { height: 100%; padding: 0 0 0 12px; overflow: auto; &:hover { - &::-webkit-scrollbar-thumb { background-color: var(--bg-color-scroll); } @@ -117,9 +118,8 @@ background-color: transparent; } } - -.TDesign-doc-sidenav-group { +.TDesign-doc-sidenav-group { &__title { display: flex; align-items: center; @@ -132,7 +132,7 @@ margin-top: 8px; border-radius: var(--border-radius); } - + &__children { overflow: hidden; } @@ -148,14 +148,13 @@ height: 40px; padding: 0 12px; line-height: 40px; - text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); text-decoration: none; border-radius: var(--border-radius); - transition: all .2s linear; + transition: all 0.2s linear; gap: 8px; &:hover { @@ -176,9 +175,9 @@ &__tag { font-size: 12px; padding: 2px 4px; - color: #F5BA18; + color: #f5ba18; border-radius: 3px; - transition: .2s linear; + transition: 0.2s linear; background: rgba(245, 186, 24, 0.1); } } diff --git a/packages/site-components/src/components/td-doc-badge/style.less b/packages/site-components/src/components/td-doc-badge/style.less index 8b9ed571b..325f7a0a7 100755 --- a/packages/site-components/src/components/td-doc-badge/style.less +++ b/packages/site-components/src/components/td-doc-badge/style.less @@ -1,4 +1,4 @@ .TDesign-doc-badge { position: relative; z-index: 500; -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-changelog/style.less b/packages/site-components/src/components/td-doc-changelog/style.less index d7cbee5a2..50c7e5496 100755 --- a/packages/site-components/src/components/td-doc-changelog/style.less +++ b/packages/site-components/src/components/td-doc-changelog/style.less @@ -1,261 +1,259 @@ .TDesign-doc-changelog { - &__overlay { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.3); - z-index: 10000; - - .hidden & { - display: none; - } + &__overlay { + position: fixed; + inset: 0; + background-color: rgba(0, 0, 0, 0.3); + z-index: 10000; + + .hidden & { + display: none; + } + } + + &__drawer { + position: fixed; + top: 0; + right: 0; + width: 500px; + height: 100vh; + background-color: var(--bg-color-container); + z-index: 100001; + box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + color: var(--text-primary); + transition: + transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), + opacity 0.35s ease; + + @media screen and (max-width: 960px) { + width: 85vw; } - &__drawer { - position: fixed; - top: 0; - right: 0; - width: 500px; - height: 100vh; - background-color: var(--bg-color-container); - z-index: 100001; - box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1); - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - color: var(--text-primary); - - transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease; - - @media screen and (max-width: 960px) { - width: 85vw; - } - - .visible & { - transform: translateX(0); - opacity: 1; - } + .visible & { + transform: translateX(0); + opacity: 1; + } - .hidden & { - transform: translateX(100%); - opacity: 0; - } + .hidden & { + transform: translateX(100%); + opacity: 0; + } - &-header { - display: flex; - justify-content: space-between; - align-items: center; - height: 56px; - box-shadow: var(--header-box-shadow); - - p { - position: relative; - font-size: 16px; - left: 16px; - height: 24px; - font-weight: 600; - } + &-header { + display: flex; + justify-content: space-between; + align-items: center; + height: 56px; + box-shadow: var(--header-box-shadow); - button { - background: transparent; - border: none; - cursor: pointer; - padding: 2px; - - svg { - width: 20px; - height: 20px; - color: var(--text-primary); - } - } + p { + position: relative; + font-size: 16px; + left: 16px; + height: 24px; + font-weight: 600; + } + + button { + background: transparent; + border: none; + cursor: pointer; + padding: 2px; + + svg { + width: 20px; + height: 20px; + color: var(--text-primary); } + } + } - &-body { - position: relative; - padding: 16px; - overflow-y: auto; - height: calc(100vh - 80px); + &-body { + position: relative; + padding: 16px; + overflow-y: auto; + height: calc(100vh - 80px); - &:hover { - &::-webkit-scrollbar-thumb { - background-color: var(--bg-color-scroll); - } - } + &:hover { + &::-webkit-scrollbar-thumb { + background-color: var(--bg-color-scroll); + } + } + + &::-webkit-scrollbar { + width: 12px; + height: 12px; + background: transparent; + } + + &::-webkit-scrollbar-corner { + width: 0; + } + + &::-webkit-scrollbar-thumb { + border-radius: 6px; + border: 4px solid transparent; + background-clip: content-box; + background-color: transparent; + } + } + } + + &__logs { + position: relative; + display: flex; + flex-direction: column; + gap: 16px; + + // 竖线 + &:not(:has(&-empty))::after { + content: ''; + position: absolute; + top: 32px; + left: 15px; + width: 2px; + height: 100%; + background: var(--brand-main); + } - &::-webkit-scrollbar { - width: 12px; - height: 12px; - background: transparent; - } + // 一个版本 + &-version { + position: relative; + padding-left: 32px; + + &:last-of-type { + &::after { + content: ''; + position: absolute; + left: 15px; + top: 30px; + z-index: 10; + width: 8px; + height: 105%; + background: var(--bg-color-docpage); + } + } - &::-webkit-scrollbar-corner { - width: 0; - } + &-header { + display: flex; + align-items: center; + margin: 10px 0; + + // 圆点 + &::before { + content: ''; + position: absolute; + left: 12px; + width: 8px; + height: 8px; + border: 2px solid var(--brand-main); + background: var(--bg-color-docpage); + outline: 8px solid var(--bg-color-docpage); + box-sizing: border-box; + border-radius: 50%; + z-index: 10; + } - &::-webkit-scrollbar-thumb { - border-radius: 6px; - border: 4px solid transparent; - background-clip: content-box; - background-color: transparent; - } + // 版本号 + span { + font-size: 18px; + font-weight: 600; + color: var(--text-primary); } - } - &__logs { - position: relative; - display: flex; - flex-direction: column; - gap: 16px; - - // 竖线 - &:not(:has(&-empty))::after { - content: ''; - position: absolute; - top: 32px; - left: 15px; - width: 2px; - height: 100%; - background: var(--brand-main); + // 日期 + code { + position: relative; + left: 8px; + color: var(--text-primary); + background: var(--bg-color-tag); + border-radius: 3px; + margin: 0 2px; + padding: 2px 8px; + font-size: 12px; + font-weight: 400; + line-height: 20px; + } + } + + // 一种变更类型 + &-section { + h3 { + font-size: 16px; + font-weight: 700; + color: var(--text-primary); + margin-bottom: 8px; } - // 一个版本 - &-version { - position: relative; - padding-left: 32px; - - &:last-of-type { - &::after { - content: ''; - position: absolute; - left: 15px; - top: 30px; - z-index: 10; - width: 8px; - height: 105%; - background: var(--bg-color-docpage); - } - } + // 日志详情 + ul { + margin: 0; + padding-left: 20px; + list-style-type: disc; + font-size: 14px; - &-header { - display: flex; - align-items: center; - margin: 10px 0; - - // 圆点 - &::before { - content: ''; - position: absolute; - left: 12px; - width: 8px; - height: 8px; - border: 2px solid var(--brand-main); - background: var(--bg-color-docpage); - outline: 8px solid var(--bg-color-docpage); - box-sizing: border-box; - border-radius: 50%; - z-index: 10; - } - - // 版本号 - span { - font-size: 18px; - font-weight: 600; - color: var(--text-primary); - } - - // 日期 - code { - position: relative; - left: 8px; - color: var(--text-primary); - background: var(--bg-color-tag); - border-radius: 3px; - margin: 0 2px; - padding: 2px 8px; - font-size: 12px; - font-weight: 400; - line-height: 20px; - } - } + ul { + padding-left: 22px; - // 一种变更类型 - &-section { - h3 { - font-size: 16px; - font-weight: 700; - color: var(--text-primary); - margin-bottom: 8px; - } - - // 日志详情 - ul { - margin: 0; - padding-left: 20px; - list-style-type: disc; - font-size: 14px; - - ul { - padding-left: 22px; - - li { - list-style-type: circle; - } - } - - li { - padding-left: 6px; - margin-bottom: 6px; - line-height: 22px; - color: var(--text-primary); - } - - a { - color: var(--brand-main); - text-decoration: none; - - &:hover { - color: var(--brand-main-hover); - } - } - } + li { + list-style-type: circle; } - } + } - &-empty { - color: var(--text-secondary); - text-align: center; - padding: 30px 0; - font-style: italic; - } + li { + padding-left: 6px; + margin-bottom: 6px; + line-height: 22px; + color: var(--text-primary); + } - &__loading { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 128px; + a { color: var(--brand-main); + text-decoration: none; - &-icon { - width: 32px; - height: 32px; - border-radius: 50%; - background: conic-gradient(from 90deg at 50% 50%, #fff 0deg, currentColor 360deg); - -webkit-mask: radial-gradient(transparent calc(50% - 0.5px), #fff 50%); - mask: radial-gradient(transparent calc(50% - 0.5px), #fff 50%); - animation: spin 1s linear infinite; - -webkit-animation: spin 1s linear infinite; + &:hover { + color: var(--brand-main-hover); } + } + } + } + } - @keyframes spin { - from { - transform: rotate(0deg); - } + &-empty { + color: var(--text-secondary); + text-align: center; + padding: 30px 0; + font-style: italic; + } - to { - transform: rotate(360deg); - } - } + &__loading { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 128px; + color: var(--brand-main); + + &-icon { + width: 32px; + height: 32px; + border-radius: 50%; + background: conic-gradient(from 90deg at 50% 50%, #fff 0deg, currentColor 360deg); + -webkit-mask: radial-gradient(transparent calc(50% - 0.5px), #fff 50%); + mask: radial-gradient(transparent calc(50% - 0.5px), #fff 50%); + -webkit-animation: spin 1s linear infinite; + animation: spin 1s linear infinite; + } + + @keyframes spin { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); } + } } -} \ No newline at end of file + } +} diff --git a/packages/site-components/src/components/td-doc-content/style.less b/packages/site-components/src/components/td-doc-content/style.less index a838a4f49..f22d34549 100755 --- a/packages/site-components/src/components/td-doc-content/style.less +++ b/packages/site-components/src/components/td-doc-content/style.less @@ -3,23 +3,23 @@ flex-direction: column; position: relative; background: var(--bg-color-docpage); - + &.hidden { opacity: 0; visibility: hidden; } - + &.show { opacity: 1; visibility: visible; - transition: all .2s linear; + transition: all 0.2s linear; } - + .TDesign-doc-body { min-height: calc(100vh - var(--footer-height)); color: var(--text-primary); padding-right: var(--content-padding-right); - + &__inner { width: 100%; padding: 64px var(--content-padding-left-right) 120px var(--content-padding-left-right); @@ -42,7 +42,7 @@ background-color: var(--bg-color-scroll); border-radius: 100%; cursor: pointer; - transition: all .2s linear; + transition: all 0.2s linear; opacity: 0; visibility: hidden; color: var(--text-secondary); @@ -57,4 +57,4 @@ background-color: var(--text-disabled); } } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-copy/style.less b/packages/site-components/src/components/td-doc-copy/style.less index e6289a6d8..a01b8a297 100755 --- a/packages/site-components/src/components/td-doc-copy/style.less +++ b/packages/site-components/src/components/td-doc-copy/style.less @@ -3,7 +3,6 @@ position: relative; &.dark { - .TDesign-doc-copy__inner:hover { background-color: var(--bg-color-component-hover); } @@ -17,10 +16,10 @@ border-radius: var(--border-radius); cursor: pointer; user-select: none; - transition: all .1s; + transition: all 0.1s; display: inline-flex; color: var(--text-secondary); - + &:hover { color: var(--text-primary); background-color: var(--bg-color-demo-hover); @@ -38,12 +37,15 @@ line-height: 22px; visibility: hidden; opacity: 0; - transition: all .2s linear; + transition: all 0.2s linear; background-color: var(--bg-color-container); - box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, .05), 0px 8px 10px 1px rgba(0, 0, 0, .06), 0px 5px 5px -3px rgba(0, 0, 0, .1); + box-shadow: + 0 3px 14px 2px rgba(0, 0, 0, 0.05), + 0 8px 10px 1px rgba(0, 0, 0, 0.06), + 0 5px 5px -3px rgba(0, 0, 0, 0.1); &::after { - content: ""; + content: ''; z-index: 2; width: 0; height: 0; diff --git a/packages/site-components/src/components/td-doc-demo/index.ts b/packages/site-components/src/components/td-doc-demo/index.ts index dc754ed05..a8c5d55a1 100644 --- a/packages/site-components/src/components/td-doc-demo/index.ts +++ b/packages/site-components/src/components/td-doc-demo/index.ts @@ -87,12 +87,12 @@ export default define({ }, }, render: (host) => { - let { code, language, showCode, mode, theme, currentLangIndex, languages, activeStyleMap } = host; + const { code, language, showCode, mode, theme, currentLangIndex, languages, activeStyleMap } = host; const languageArr = typeof languages === 'string' ? languages.split(',') : []; const tabsDisplay = languageArr.length > 0 && - languageArr.filter((lang) => host.dataset?.[lang] || host.dataset?.[lang.toLocaleLowerCase()]).length == + languageArr.filter((lang) => host.dataset?.[lang] || host.dataset?.[lang.toLocaleLowerCase()]).length === languageArr.length; const currentLang = languageArr[currentLangIndex] || ''; diff --git a/packages/site-components/src/components/td-doc-demo/style.less b/packages/site-components/src/components/td-doc-demo/style.less index a2308636b..16951dd87 100755 --- a/packages/site-components/src/components/td-doc-demo/style.less +++ b/packages/site-components/src/components/td-doc-demo/style.less @@ -1,7 +1,7 @@ /* stylelint-disable */ -@import "../../styles/prism-theme.less"; -@import "../../styles/prism-theme-dark.less"; +@import '../../styles/prism-theme.less'; +@import '../../styles/prism-theme-dark.less'; .TDesign-doc-demo { margin: 24px 0 48px; @@ -21,7 +21,7 @@ position: relative; &::after { - content: ""; + content: ''; width: 100%; height: 20px; position: absolute; @@ -35,7 +35,6 @@ background-color: var(--bg-color-component-hover); } } - } &__footer { @@ -59,7 +58,7 @@ border-radius: var(--border-radius); cursor: pointer; user-select: none; - transition: all .1s; + transition: all 0.1s; display: inline-flex; color: var(--text-secondary); @@ -95,7 +94,7 @@ background-color: var(--bg-color-scroll); } } - + &::-webkit-scrollbar { width: 12px; height: 12px; @@ -105,7 +104,7 @@ &::-webkit-scrollbar-corner { width: 0; } - + &::-webkit-scrollbar-thumb { border-radius: 6px; border: 4px solid transparent; @@ -152,18 +151,15 @@ color: var(--text-secondary); word-break: keep-all; white-space: nowrap; - transition: background .2s; + transition: background 0.2s; &:hover, &.active { color: var(--text-interactive); - } &:hover { background: var(--bg-color-demo-hover); } - } - -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-empty/style.less b/packages/site-components/src/components/td-doc-empty/style.less index dfb673474..8fa75a37f 100755 --- a/packages/site-components/src/components/td-doc-empty/style.less +++ b/packages/site-components/src/components/td-doc-empty/style.less @@ -1,8 +1,8 @@ .TDesign-doc-empty { - .light { display: var(--theme-block-light-display); } + .dark { display: var(--theme-block-dark-display); } diff --git a/packages/site-components/src/components/td-doc-footer/index.ts b/packages/site-components/src/components/td-doc-footer/index.ts index 09af565ea..b31a4283a 100644 --- a/packages/site-components/src/components/td-doc-footer/index.ts +++ b/packages/site-components/src/components/td-doc-footer/index.ts @@ -41,7 +41,7 @@ const groupCodeMap = { design: designGroup, } satisfies Record; -const communityPlatforms: Array<{ type: GroupType; name: string; icon: string }> = [ +const communityPlatforms: { type: GroupType; name: string; icon: string }[] = [ { type: 'vue', name: 'Vue', icon: vueLogo }, { type: 'wx', name: 'MiniProgram', icon: wxLogo }, { type: 'react', name: 'React', icon: reactLogo }, diff --git a/packages/site-components/src/components/td-doc-header/index.ts b/packages/site-components/src/components/td-doc-header/index.ts index 098c8d320..eeb13e387 100644 --- a/packages/site-components/src/components/td-doc-header/index.ts +++ b/packages/site-components/src/components/td-doc-header/index.ts @@ -55,12 +55,7 @@ function checkDescribeLineOverflow(host: HeaderHost & HTMLElement): void { function handleModeChange(themeMode: string, host: HeaderHost & HTMLElement): void { if (!host.shadowRoot) return; const splineEl = host.shadowRoot.querySelector('#__iframe__'); - let splineUrl = ''; - if (themeMode === 'dark') { - splineUrl = getSplineUrl(`${host.spline}-dark`) || ''; - } else { - splineUrl = getSplineUrl(host.spline) || ''; - } + const splineUrl = themeMode === 'dark' ? getSplineUrl(`${host.spline}-dark`) || '' : getSplineUrl(host.spline) || ''; if (splineEl && splineUrl && splineUrl !== splineEl.src) { clearTimeout(timer); splineEl.setAttribute('style', 'max-height: 0;'); @@ -73,7 +68,7 @@ function iframeOnload(host: HeaderHost & HTMLElement): void { const iframeEl = host.shadowRoot.querySelector('#__iframe__'); clearTimeout(timer); timer = setTimeout(() => { - iframeEl && + if (iframeEl) iframeEl.setAttribute( 'style', ` @@ -142,7 +137,7 @@ export default define({ const background = shadowRoot.querySelector('.TDesign-doc-header__background') ?? document.createElement('div'); const changelogEntry = - shadowRoot.querySelector('#TDesign-doc-changelog__entry') ?? document.createElement('div'); + shadowRoot.querySelector('.TDesign-doc-changelog__entry') ?? document.createElement('div'); const title = shadowRoot.querySelector('.TDesign-doc-header__info-title') ?? document.createElement('div'); const describe = @@ -168,7 +163,7 @@ export default define({ }); Object.assign(changelogEntry.style, { opacity: 1, visibility: 'visible' }); Object.assign(background.style, { position: 'fixed', top: '0', left: asideWidth }); - tabs && + if (tabs) Object.assign(tabs.style, { position: 'fixed', top: '64px', @@ -184,7 +179,7 @@ export default define({ Object.assign(describe.style, { opacity: 0, visibility: 'hidden' }); Object.assign(background.style, { position: 'absolute', top: 'unset', left: '0' }); - tabs && Object.assign(tabs.style, { position: 'absolute', top: '228px' }); + if (tabs) Object.assign(tabs.style, { position: 'absolute', top: '228px' }); Object.assign(issue.style, { position: 'absolute', top: 'calc(100% - 48px - 12px)' }); } } else { @@ -198,7 +193,7 @@ export default define({ Object.assign(changelogEntry.style, { opacity: 1, visibility: 'visible' }); Object.assign(describe.style, { opacity: 1, visibility: 'visible' }); Object.assign(background.style, { position: 'absolute', top: 'unset', left: '0' }); - tabs && Object.assign(tabs.style, { position: 'absolute', top: '228px' }); + if (tabs) Object.assign(tabs.style, { position: 'absolute', top: '228px' }); Object.assign(issue.style, { position: 'absolute', top: 'calc(100% - 48px - 12px)' }); Object.assign(thumb.style, { opacity: 1, visibility: 'visible' }); } @@ -255,9 +250,11 @@ export default define({ }; return html` - ${splineUrl - ? html` ` - : html``} + ${ + splineUrl + ? html` ` + : html`` + }
@@ -265,33 +262,39 @@ export default define({
- ${docInfo - ? html` -
-

${docInfo.title}

- ${changelog && isChangelogComponentRegistered && (isComponentPage() || isGlobalConfigPage()) - ? html` - - ` - : html``} -
-
- ${host.shouldShowPopup - ? html` - -
-
-
- ` - : html` -
- `} -
- ` - : html``} + ${ + docInfo + ? html` +
+

${docInfo.title}

+ ${ + changelog && isChangelogComponentRegistered && (isComponentPage() || isGlobalConfigPage()) + ? html` + + ` + : html`` + } +
+
+ ${ + host.shouldShowPopup + ? html` + +
+
+
+ ` + : html` +
+ ` + } +
+ ` + : html`` + }
diff --git a/packages/site-components/src/components/td-doc-header/style.less b/packages/site-components/src/components/td-doc-header/style.less index b4f954877..0f4416564 100755 --- a/packages/site-components/src/components/td-doc-header/style.less +++ b/packages/site-components/src/components/td-doc-header/style.less @@ -6,7 +6,6 @@ @media screen and (max-width: 960px) { --spline-visible: hidden; - --inner-padding-y: 12px; --info-top: 14px; --title-font-size: 32px; @@ -93,7 +92,10 @@ text-align: left; line-height: 42px; margin: 0; - transition: top 0.2s var(--anim-time-fn-easing), opacity 0.2s linear, visibility 0.2s linear; + transition: + top 0.2s var(--anim-time-fn-easing), + opacity 0.2s linear, + visibility 0.2s linear; } &-describe { @@ -105,6 +107,7 @@ width: 100%; box-sizing: border-box; transition: all 0.2s linear; + &-line { display: -webkit-box; -webkit-box-orient: vertical; @@ -119,9 +122,8 @@ } } -#TDesign-doc-changelog__entry { +.TDesign-doc-changelog__entry { all: unset; - height: 24px; display: inline-flex; align-items: center; justify-content: center; diff --git a/packages/site-components/src/components/td-doc-header/td-doc-issue/style.less b/packages/site-components/src/components/td-doc-header/td-doc-issue/style.less index d242f5c82..5865f8d37 100755 --- a/packages/site-components/src/components/td-doc-header/td-doc-issue/style.less +++ b/packages/site-components/src/components/td-doc-header/td-doc-issue/style.less @@ -1,5 +1,4 @@ :host { - position: absolute; right: 24px; top: calc(100% - 48px - 12px); @@ -23,7 +22,7 @@ .item { border-radius: var(--border-radius); - transition: all .2s; + transition: all 0.2s; display: flex; align-items: center; padding: 5px 8px; diff --git a/packages/site-components/src/components/td-doc-history/index.ts b/packages/site-components/src/components/td-doc-history/index.ts index 2dbe700bf..9a54052b1 100644 --- a/packages/site-components/src/components/td-doc-history/index.ts +++ b/packages/site-components/src/components/td-doc-history/index.ts @@ -24,12 +24,14 @@ export default define({ return html`
- ${content - ? content - : html` - Last Update: - ${transformTime(time)} - `} + ${ + content + ? content + : html` + Last Update: + ${transformTime(time)} + ` + }
`.css`${style}`; }, diff --git a/packages/site-components/src/components/td-doc-history/style.less b/packages/site-components/src/components/td-doc-history/style.less index 54547c5bb..93cb21ee4 100644 --- a/packages/site-components/src/components/td-doc-history/style.less +++ b/packages/site-components/src/components/td-doc-history/style.less @@ -26,4 +26,4 @@ margin-right: 4px; color: var(--text-secondary); } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-layout/index.ts b/packages/site-components/src/components/td-doc-layout/index.ts index 1c0dd2a6b..6b0a18e36 100644 --- a/packages/site-components/src/components/td-doc-layout/index.ts +++ b/packages/site-components/src/components/td-doc-layout/index.ts @@ -21,7 +21,7 @@ export default define({ window.NProgress = NProgress; window.addEventListener('load', onLoad); - !host.loaded && NProgress.start(); + if (!host.loaded) NProgress.start(); return () => window.removeEventListener('load', onLoad); }, diff --git a/packages/site-components/src/components/td-doc-layout/style.less b/packages/site-components/src/components/td-doc-layout/style.less index 54be0c019..ce733f728 100755 --- a/packages/site-components/src/components/td-doc-layout/style.less +++ b/packages/site-components/src/components/td-doc-layout/style.less @@ -13,10 +13,10 @@ .TDesign-body { min-height: 100vh; - transition: all .2s var(--anim-time-fn-easing); + transition: all 0.2s var(--anim-time-fn-easing); &.row { margin-left: var(--content-margin-left); } } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-phone/index.ts b/packages/site-components/src/components/td-doc-phone/index.ts index 71a6951ea..28c8df310 100644 --- a/packages/site-components/src/components/td-doc-phone/index.ts +++ b/packages/site-components/src/components/td-doc-phone/index.ts @@ -135,24 +135,28 @@ export default define({ html`
- ${headless - ? html`` - : html` -
-
- - -
- - - -
-
- ${href && - html``} + ${ + headless + ? html`` + : html` +
+
+ + +
+ + + +
+
+ ${ + href && + html`` + } +
-
- `} + ` + }
diff --git a/packages/site-components/src/components/td-doc-phone/style.less b/packages/site-components/src/components/td-doc-phone/style.less index 61cd9f774..8ca134b86 100755 --- a/packages/site-components/src/components/td-doc-phone/style.less +++ b/packages/site-components/src/components/td-doc-phone/style.less @@ -3,7 +3,7 @@ --phone-collapse-display: none; --phone-header-height: 48px; --phone-body-height: 667px; - + @media screen and (max-width: 960px) { --phone-display: none; --phone-collapse-display: flex; @@ -12,7 +12,7 @@ .TDesign-doc-phone { width: 375px; - width: ~"min(75vw, 375px)"; + width: ~'min(75vw, 375px)'; border-radius: 6px; border: 1px solid var(--component-border); outline: 9999px solid transparent; @@ -35,7 +35,7 @@ background-color: var(--bg-color-container); visibility: hidden; opacity: 0; - transition: all .2s linear; + transition: all 0.2s linear; svg { color: var(--text-primary); @@ -59,7 +59,7 @@ width: 32px; height: 32px; border-radius: var(--border-radius); - transition: all .1s; + transition: all 0.1s; display: inline-flex; align-items: center; justify-content: center; @@ -98,7 +98,7 @@ } .TDesign-doc-phone-mask { - content: ""; + content: ''; position: fixed; left: 0; top: 0; @@ -122,7 +122,10 @@ top: 50% !important; transform: translate3d(-50%, -50%, 0); outline-color: var(--text-disabled); - transition: transform .2s var(--anim-time-fn-easing), opacity .2s linear, visibility .2s linear; + transition: + transform 0.2s var(--anim-time-fn-easing), + opacity 0.2s linear, + visibility 0.2s linear; visibility: visible; opacity: 1; z-index: 2500; @@ -142,13 +145,13 @@ top: 400px; z-index: 400; border-radius: 3px 0 0 3px; - box-shadow: 2px 0 8px rgba(0, 0, 0, .26); + box-shadow: 2px 0 8px rgba(0, 0, 0, 0.26); width: 40px; height: 40px; align-items: center; justify-content: center; background-color: var(--bg-color-container); - transition: all .2s var(--anim-time-fn-easing); + transition: all 0.2s var(--anim-time-fn-easing); display: var(--phone-collapse-display); cursor: pointer; diff --git a/packages/site-components/src/components/td-doc-popup/index.ts b/packages/site-components/src/components/td-doc-popup/index.ts index 4bbf28b1e..7fbdaebf6 100644 --- a/packages/site-components/src/components/td-doc-popup/index.ts +++ b/packages/site-components/src/components/td-doc-popup/index.ts @@ -64,11 +64,10 @@ export default define({ connect: (host) => { const { reference, placement } = host; let resizeObserver: ResizeObserver | undefined; - let portalFrameId: number | undefined; let popperFrameId: number | undefined; let isConnected = true; - portalFrameId = requestAnimationFrame(() => { + const portalFrameId = requestAnimationFrame(() => { if (!isConnected) return; host.portals = document.getElementById('__td_portals__'); diff --git a/packages/site-components/src/components/td-doc-search/algolia.ts b/packages/site-components/src/components/td-doc-search/algolia.ts index 57f5f08ce..c40c91606 100644 --- a/packages/site-components/src/components/td-doc-search/algolia.ts +++ b/packages/site-components/src/components/td-doc-search/algolia.ts @@ -110,7 +110,7 @@ export async function searchAlgolia({ }); } catch (err) { if (err instanceof Error && err.name === 'AbortError') throw err; - // eslint-disable-next-line no-console + console.warn('[td-doc-search] search failed:', err instanceof Error ? err.message : String(err)); return []; } diff --git a/packages/site-components/src/components/td-doc-search/hotkeys.ts b/packages/site-components/src/components/td-doc-search/hotkeys.ts index dfca145f2..4575b2f7d 100644 --- a/packages/site-components/src/components/td-doc-search/hotkeys.ts +++ b/packages/site-components/src/components/td-doc-search/hotkeys.ts @@ -30,18 +30,18 @@ export function registerHotkeys({ onOpen, onClose }: HotkeyHandlers): () => void // Cmd/Ctrl + K if ((e.metaKey || e.ctrlKey) && (e.key === 'k' || e.key === 'K')) { e.preventDefault(); - onOpen && onOpen(); + if (onOpen) onOpen(); return; } // "/":不在输入态下触发 if (e.key === '/' && !isEditable(document.activeElement)) { e.preventDefault(); - onOpen && onOpen(); + if (onOpen) onOpen(); return; } // ESC:无论焦点在何处,都关闭 popover if (e.key === 'Escape') { - onClose && onClose(); + if (onClose) onClose(); } }; diff --git a/packages/site-components/src/components/td-doc-search/style.less b/packages/site-components/src/components/td-doc-search/style.less index 84eeabaa2..ce691734a 100755 --- a/packages/site-components/src/components/td-doc-search/style.less +++ b/packages/site-components/src/components/td-doc-search/style.less @@ -56,7 +56,7 @@ .TDesign-docsearch-trigger__icon svg { width: 100%; height: 100%; - fill: currentColor; + fill: currentcolor; } .TDesign-docsearch-trigger__input { @@ -147,11 +147,13 @@ border: 2px solid var(--component-stroke, #dcdcdc); border-top-color: var(--brand-main, #0052d9); border-radius: 50%; - animation: td-docsearch-spin 0.8s linear infinite; + animation: TDesign-docsearch-spin 0.8s linear infinite; } -@keyframes td-docsearch-spin { - to { transform: rotate(360deg); } +@keyframes TDesign-docsearch-spin { + to { + transform: rotate(360deg); + } } /* ========================================================================= @@ -179,9 +181,15 @@ } .TDesign-docsearch-cols__left::-webkit-scrollbar, -.TDesign-docsearch-cols__right::-webkit-scrollbar { width: 6px; } +.TDesign-docsearch-cols__right::-webkit-scrollbar { + width: 6px; +} + .TDesign-docsearch-cols__left::-webkit-scrollbar-track, -.TDesign-docsearch-cols__right::-webkit-scrollbar-track { background: transparent; } +.TDesign-docsearch-cols__right::-webkit-scrollbar-track { + background: transparent; +} + .TDesign-docsearch-cols__left::-webkit-scrollbar-thumb, .TDesign-docsearch-cols__right::-webkit-scrollbar-thumb { background-color: var(--text-placeholder, rgba(0, 0, 0, 0.2)); @@ -245,7 +253,6 @@ min-width: 0; white-space: normal; overflow-wrap: anywhere; - word-break: break-word; } /* 分类右侧的计数徽标 —— 显示该分类下的命中数量 */ @@ -331,6 +338,7 @@ } /* --------- 最近搜索(单列,复用 hit 样式) --------- */ + /* 与两栏布局的右栏 (.TDesign-docsearch-cols__right) 保持一致的内边距, 以便 hit 的左边缘在两种场景下视觉对齐 */ .TDesign-docsearch-section { @@ -380,7 +388,7 @@ .TDesign-docsearch-hit__remove svg { width: 14px; height: 14px; - fill: currentColor; + fill: currentcolor; } .TDesign-docsearch-hit__remove:hover { @@ -438,6 +446,7 @@ left: 50%; transform: translate(-50%, -4px); } + .TDesign-docsearch-popover.is-open { transform: translate(-50%, 0); } @@ -447,20 +456,21 @@ min-height: 0; max-height: 60vh; } + .TDesign-docsearch-cols__left { flex: 0 0 auto; width: 100%; max-width: none; padding: 4px; border-bottom: 1px solid var(--component-stroke, #dcdcdc); - overflow-x: auto; - overflow-y: hidden; + overflow: auto hidden; } + .TDesign-docsearch-cat-list { - flex-direction: row; + flex-flow: row nowrap; gap: 4px; - flex-wrap: nowrap; } + .TDesign-docsearch-cat { flex-shrink: 0; justify-content: flex-start; @@ -468,10 +478,12 @@ padding: 6px 10px; border-radius: 999px; } + /* 胶囊内部 title 不再抢占剩余空间,宽度贴合内容 */ .TDesign-docsearch-cat__title { flex: 0 1 auto; } + .TDesign-docsearch-cols__right { padding: 4px; } diff --git a/packages/site-components/src/components/td-doc-search/views.ts b/packages/site-components/src/components/td-doc-search/views.ts index ea462e944..0a56353c0 100644 --- a/packages/site-components/src/components/td-doc-search/views.ts +++ b/packages/site-components/src/components/td-doc-search/views.ts @@ -57,13 +57,15 @@ export function renderTrigger(host: DocSearchHost, handlers: ViewHandlers): Upda oninput=${handlers.onTriggerInput} onkeydown=${handlers.onTriggerKeyDown} /> - ${host._loading - ? html` - - ` - : html``} + ${ + host._loading + ? html` + + ` + : html`` + }
`; } diff --git a/packages/site-components/src/components/td-doc-tabs/style.less b/packages/site-components/src/components/td-doc-tabs/style.less index 5359c0521..8b54c7dd0 100755 --- a/packages/site-components/src/components/td-doc-tabs/style.less +++ b/packages/site-components/src/components/td-doc-tabs/style.less @@ -1,5 +1,6 @@ :host { --block-base-width: 16px; + position: absolute; top: 228px; z-index: 500; @@ -21,9 +22,8 @@ border: 1px solid var(--component-border); &__block { - position: absolute; background-color: var(--bg-color-tab-select); - box-shadow: 0px 2px 4px rgba(0, 0, 0, .15); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); position: absolute; height: calc(100% - 8px); left: 4px; @@ -46,10 +46,10 @@ position: relative; word-break: keep-all; white-space: nowrap; - + &:hover, &.active { color: var(--text-primary); } } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-doc-usage/index.ts b/packages/site-components/src/components/td-doc-usage/index.ts index 1b92412cf..c37fc65f3 100644 --- a/packages/site-components/src/components/td-doc-usage/index.ts +++ b/packages/site-components/src/components/td-doc-usage/index.ts @@ -63,46 +63,50 @@ function renderConfig(configList: ConfigItem[] = []) { }); return html` - ${booleanList.length - ? html` -
    - ${booleanList.map( - (item) => html` -
  • - ${item.name} - -
  • - `, - )} -
- ` - : ''} - ${enumList.length - ? html` - ${booleanList.length ? html`
` : ''} -
    - ${enumList.map( - (item) => html` -
  • - ${item.name} - -
  • - `, - )} -
- ` - : ''} + ${ + booleanList.length + ? html` +
    + ${booleanList.map( + (item) => html` +
  • + ${item.name} + +
  • + `, + )} +
+ ` + : '' + } + ${ + enumList.length + ? html` + ${booleanList.length ? html`
` : ''} +
    + ${enumList.map( + (item) => html` +
  • + ${item.name} + +
  • + `, + )} +
+ ` + : '' + } `; } diff --git a/packages/site-components/src/components/td-doc-usage/style.less b/packages/site-components/src/components/td-doc-usage/style.less index 843bd8172..3630e5e18 100755 --- a/packages/site-components/src/components/td-doc-usage/style.less +++ b/packages/site-components/src/components/td-doc-usage/style.less @@ -1,5 +1,5 @@ -@import "../../styles/prism-theme.less"; -@import "../../styles/prism-theme-dark.less"; +@import '../../styles/prism-theme.less'; +@import '../../styles/prism-theme-dark.less'; :host { --context-max-height: 400px; @@ -20,7 +20,7 @@ display: flex; justify-content: space-between; } - + &__render { display: flex; flex: 1; @@ -41,13 +41,13 @@ &::-webkit-scrollbar-corner { width: 0; } - + &::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; } - + &::-webkit-scrollbar-thumb { border-radius: 6px; border: 4px solid transparent; @@ -71,16 +71,15 @@ justify-content: center; cursor: pointer; - &:hover { .panel-inner { background: var(--bg-color-container-hover); } } - + .panel-inner { padding: 8px; - transition: all .2s linear; + transition: all 0.2s linear; border-radius: 3px; &.active { @@ -93,10 +92,10 @@ height: 1px; position: absolute; left: 0; - bottom: 0px; + bottom: 0; z-index: 10; background: var(--brand-main); - transition: all .2s var(--anim-time-fn-easing); + transition: all 0.2s var(--anim-time-fn-easing); } } @@ -109,7 +108,7 @@ gap: 8px; align-items: center; box-sizing: border-box; - + .action { height: 32px; width: 32px; @@ -118,15 +117,15 @@ border-radius: var(--border-radius); cursor: pointer; user-select: none; - transition: all .1s; + transition: all 0.1s; display: inline-flex; color: var(--text-secondary); - + &:hover { color: var(--text-primary); background-color: var(--bg-color-demo-hover); } - + &.active { color: var(--text-primary); background-color: var(--bg-color-demo-select); @@ -149,7 +148,7 @@ padding: 12px 16px; box-sizing: border-box; border-bottom: 1px solid var(--component-stroke); - + span { font-size: 14px; line-height: 24px; @@ -173,13 +172,13 @@ &::-webkit-scrollbar-corner { width: 0; } - + &::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; } - + &::-webkit-scrollbar-thumb { border-radius: 6px; border: 4px solid transparent; @@ -232,12 +231,11 @@ color: var(--text-primary); &:hover { - &::-webkit-scrollbar-thumb { background-color: var(--bg-color-scroll); } } - + &::-webkit-scrollbar { width: 12px; height: 12px; @@ -247,7 +245,7 @@ &::-webkit-scrollbar-corner { width: 0; } - + &::-webkit-scrollbar-thumb { border-radius: 6px; border: 4px solid transparent; diff --git a/packages/site-components/src/components/td-header/index.ts b/packages/site-components/src/components/td-header/index.ts index 60b3d91ea..b73412083 100644 --- a/packages/site-components/src/components/td-header/index.ts +++ b/packages/site-components/src/components/td-header/index.ts @@ -125,8 +125,10 @@ function renderNotice(host: HeaderHost) { return html`
${noticeOption.title}
- ${noticeOption.closeable && - html``} + ${ + noticeOption.closeable && + html`` + }
`; } @@ -313,24 +315,26 @@ export default define({
- ${collapseMenu - ? html` - - - ` - : html` - - ${renderLinks(host, headerList, platform, framework)} - ${disabledTheme ? html`` : html``} - `} + ${ + collapseMenu + ? html` + + + ` + : html` + + ${renderLinks(host, headerList, platform, framework)} + ${disabledTheme ? html`` : html``} + ` + }
diff --git a/packages/site-components/src/components/td-header/portal.less b/packages/site-components/src/components/td-header/portal.less index a78a058fa..e86f29d61 100755 --- a/packages/site-components/src/components/td-header/portal.less +++ b/packages/site-components/src/components/td-header/portal.less @@ -28,7 +28,7 @@ .link { border-radius: 6px; - transition: all .2s linear; + transition: all 0.2s linear; color: var(--text-secondary); text-decoration: none; padding: 8px; @@ -36,17 +36,17 @@ align-items: center; width: 264px; box-sizing: border-box; - + &:not(.disabled):hover { color: var(--text-primary); background: var(--bg-color-container-hover); } - + .details { display: flex; flex-direction: column; } - + .name { font-size: 14px; line-height: 24px; @@ -95,20 +95,20 @@ .alpha-tag { color: var(--brand-main); background: var(--brand-main-light); - font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } .beta-tag, .rc-tag { color: var(--success-main); background: var(--success-main-light); - font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } .stable-tag { - color: #029CD4; - background: rgba(2, 156, 212, .1); - font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; + color: #029cd4; + background: rgba(2, 156, 212, 0.1); + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } } } @@ -117,4 +117,4 @@ .TDesign-base-components-links { display: none; } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-header/style.less b/packages/site-components/src/components/td-header/style.less index 737c94916..fd2dd20a5 100755 --- a/packages/site-components/src/components/td-header/style.less +++ b/packages/site-components/src/components/td-header/style.less @@ -1,6 +1,7 @@ /* stylelint-disable */ :host { position: relative; + --header-inner-max-width: 100%; --header-inner-padding: 0 24px; --search-display: block; @@ -129,7 +130,7 @@ svg path { transition: d 0.2s; - stroke: currentColor; + stroke: currentcolor; } } } diff --git a/packages/site-components/src/components/td-header/td-collapse-menu/index.ts b/packages/site-components/src/components/td-header/td-collapse-menu/index.ts index a5ef78df2..3521469e6 100644 --- a/packages/site-components/src/components/td-header/td-collapse-menu/index.ts +++ b/packages/site-components/src/components/td-header/td-collapse-menu/index.ts @@ -24,7 +24,7 @@ function renderLinks({ headerList, baseComponentsLinks, platform, framework }: C `; const isActive = (path: string): boolean => location.pathname.includes(path); - let baseLinks = [html`
`]; + const baseLinks = [html`
`]; const renderNavs = headerList .map((item) => { diff --git a/packages/site-components/src/components/td-header/td-collapse-menu/portal.less b/packages/site-components/src/components/td-header/td-collapse-menu/portal.less index 7fe442d8c..a041f9039 100755 --- a/packages/site-components/src/components/td-header/td-collapse-menu/portal.less +++ b/packages/site-components/src/components/td-header/td-collapse-menu/portal.less @@ -1,7 +1,7 @@ .TDesign-collapse-menu__list { min-height: 32px; - -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); + -webkit-backdrop-filter: blur(6px); display: flex; padding: 8px; width: 254px; @@ -68,18 +68,19 @@ .alpha-tag { color: var(--brand-main); background: var(--brand-main-light); - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } + .beta-tag { color: var(--success-main); background: var(--success-main-light); - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } .stable-tag { - color: #029CD4; - background: rgba(2, 156, 212, .1); - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + color: #029cd4; + background: rgba(2, 156, 212, 0.1); + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } } diff --git a/packages/site-components/src/components/td-logo/index.ts b/packages/site-components/src/components/td-logo/index.ts index 82965e0f5..d138ba929 100644 --- a/packages/site-components/src/components/td-logo/index.ts +++ b/packages/site-components/src/components/td-logo/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable prettier/prettier */ import { html, define } from 'hybrids'; import logoIcon from '@images/logo.svg?raw'; import menuApplicationIcon from '@images/menu-application.svg?raw'; @@ -37,13 +36,15 @@ function renderMenu(list: EcosystemCategory[]) { const len = list.length; return list.map( (category, index) => html` - ${category.categoryUrl && category.categoryUrl !== 'null' - ? html` - - ${category.categoryTitle} - - ` - : html` ${category.categoryTitle} `} + ${ + category.categoryUrl && category.categoryUrl !== 'null' + ? html` + + ${category.categoryTitle} + + ` + : html` ${category.categoryTitle} ` + } ${renderList(category.items)} ${index < len - 1 ? html`
` : html``} `, ); diff --git a/packages/site-components/src/components/td-logo/portal.less b/packages/site-components/src/components/td-logo/portal.less index 5b8e58550..68f019abd 100755 --- a/packages/site-components/src/components/td-logo/portal.less +++ b/packages/site-components/src/components/td-logo/portal.less @@ -16,6 +16,7 @@ span.title:hover { cursor: auto; color: var(--text-primary); + font-family: 'TencentSansW7', sans-serif; } .title { @@ -26,6 +27,7 @@ line-height: 22px; transition: color 0.2s linear; text-decoration: none; + font-family: 'TencentSansW7', sans-serif; &:hover { color: var(--brand-main); @@ -41,10 +43,8 @@ .list { display: flex; - flex-wrap: wrap; - flex-direction: var(--list-direction); - row-gap: 8px; - column-gap: 8px; + flex-flow: var(--list-direction) wrap; + gap: 8px; .item { text-decoration: none; @@ -54,8 +54,7 @@ box-sizing: border-box; display: flex; align-items: center; - row-gap: 8px; - column-gap: 8px; + gap: 8px; transition: all 0.2s linear; &:hover { @@ -82,7 +81,7 @@ .name { color: var(--text-primary); - font-family: TencentSansW7; + font-family: 'TencentSansW7', sans-serif; } .desc { diff --git a/packages/site-components/src/components/td-message/README.md b/packages/site-components/src/components/td-message/README.md index a72f41459..47a83c88e 100644 --- a/packages/site-components/src/components/td-message/README.md +++ b/packages/site-components/src/components/td-message/README.md @@ -2,5 +2,5 @@ ```js // 挂载节点 -window.showTdMessage({ content: "复制成功", theme: "success" }); +window.showTdMessage({ content: '复制成功', theme: 'success' }); ``` diff --git a/packages/site-components/src/components/td-message/style.less b/packages/site-components/src/components/td-message/style.less index eedfefdd6..0cfdaee4f 100644 --- a/packages/site-components/src/components/td-message/style.less +++ b/packages/site-components/src/components/td-message/style.less @@ -5,8 +5,8 @@ outline: 0; border-radius: 3px; background-color: var(--bg-color-container); - box-shadow: var(--shadow-3), var(--shadow-inset-top), - var(--shadow-inset-right), var(--shadow-inset-bottom), + box-shadow: + var(--shadow-3), var(--shadow-inset-top), var(--shadow-inset-right), var(--shadow-inset-bottom), var(--shadow-inset-left); box-sizing: border-box; align-items: center; @@ -23,21 +23,26 @@ &.t-message-enter { top: 32px; } + &.t-message-leave { top: -100px; } } + .t-message > .t-icon { color: var(--brand-main); margin-right: 8px; font-size: 16px; } + .t-message.t-is-success > .t-icon { color: var(--success-main); } + .t-message.t-is-warning > .t-icon { color: var(--warning-main); } + .t-message.t-is-error > .t-icon { color: var(--error-main); } diff --git a/packages/site-components/src/components/td-portal/index.ts b/packages/site-components/src/components/td-portal/index.ts index 0d65bb0a5..6f3b76d54 100644 --- a/packages/site-components/src/components/td-portal/index.ts +++ b/packages/site-components/src/components/td-portal/index.ts @@ -12,11 +12,13 @@ export default define({ portalStyle: '', render: (host) => { return html` - ${host.portalStyle - ? html`` - : ''} + ${ + host.portalStyle + ? html`` + : '' + } `.css`${style}`; }, diff --git a/packages/site-components/src/components/td-portal/style.less b/packages/site-components/src/components/td-portal/style.less index 7f46580f5..482497861 100755 --- a/packages/site-components/src/components/td-portal/style.less +++ b/packages/site-components/src/components/td-portal/style.less @@ -7,7 +7,10 @@ z-index: 3000; opacity: 0; visibility: hidden; - transition: clip-path 0.25s var(--anim-time-fn-easing), opacity 0.25s linear, visibility 0.25s linear; + transition: + clip-path 0.25s var(--anim-time-fn-easing), + opacity 0.25s linear, + visibility 0.25s linear; clip-path: polygon(-10% -10%, 110% -10%, 110% -10%, -10% -10%); } diff --git a/packages/site-components/src/components/td-select/index.ts b/packages/site-components/src/components/td-select/index.ts index decfac69c..3e9296132 100644 --- a/packages/site-components/src/components/td-select/index.ts +++ b/packages/site-components/src/components/td-select/index.ts @@ -19,7 +19,7 @@ interface SelectProps { type SelectHost = SelectProps & HTMLElement; -interface VisibleChangeEvent extends CustomEvent<{ visible: boolean }> {} +type VisibleChangeEvent = CustomEvent<{ visible: boolean }>; function renderOptions(host: SelectHost) { const { options = [] } = host; @@ -35,7 +35,7 @@ function renderOptions(host: SelectHost) { return html`
    ${options.map((item) => { - const isActive = item.value == host.value; + const isActive = String(item.value) === String(host.value); return html`
  • ({ render: (host) => { const { options, value, visible, borderless } = host; - const activeItem = options.find((item) => item.value == value); + const activeItem = options.find((item) => String(item.value) === String(value)); const inputValue = activeItem?.label || ''; const selectInputClass = { diff --git a/packages/site-components/src/components/td-select/style.less b/packages/site-components/src/components/td-select/style.less index 438e8625e..a2d8eccd4 100755 --- a/packages/site-components/src/components/td-select/style.less +++ b/packages/site-components/src/components/td-select/style.less @@ -37,7 +37,6 @@ } } - &__inner { flex: 1; border: none; @@ -56,14 +55,15 @@ .suffix-icon { display: inline-flex; + svg path { transition: d 0.2s; - stroke: currentColor; + stroke: currentcolor; } &.up { svg path { - d: path("M3.75 10.2002L7.99274 5.7998L12.2361 10.0425"); + d: path('M3.75 10.2002L7.99274 5.7998L12.2361 10.0425'); } } } diff --git a/packages/site-components/src/components/td-stats/index.ts b/packages/site-components/src/components/td-stats/index.ts index fa69134e6..ee04f8b3c 100644 --- a/packages/site-components/src/components/td-stats/index.ts +++ b/packages/site-components/src/components/td-stats/index.ts @@ -23,7 +23,7 @@ function initStats(statsId: string, scriptAttrs: ScriptAttributes, statsCallback if (value !== undefined) script.setAttribute(key, value); }); script.onload = () => { - statsCallback && statsCallback(); + if (statsCallback) statsCallback(); }; document.head.appendChild(script); } @@ -34,7 +34,7 @@ export default define({ track: { value() { return () => { - window._horizon && window._horizon.track(); + if (window._horizon) window._horizon.track(); }; }, }, @@ -55,14 +55,14 @@ export default define({ src: 'https://pingjs.qq.com/tcss.ping.https.js', }, () => { - window.pgvMain && window.pgvMain(); + if (window.pgvMain) window.pgvMain(); }, ); } function handleRouterTrack() { requestAnimationFrame(() => { - window._horizon && window._horizon.track(); + if (window._horizon) window._horizon.track(); }); } diff --git a/packages/site-components/src/components/td-switch/style.less b/packages/site-components/src/components/td-switch/style.less index f5dfe47de..aab6dee3d 100755 --- a/packages/site-components/src/components/td-switch/style.less +++ b/packages/site-components/src/components/td-switch/style.less @@ -60,12 +60,9 @@ transition: all 0.2s var(--anim-time-fn-easing); &::before { - content: ""; + content: ''; position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; + inset: 0; border-radius: 12px; background-color: var(--text-anti); transition: all 0.2s var(--anim-time-fn-easing); diff --git a/packages/site-components/src/components/td-theme-tabs/style.less b/packages/site-components/src/components/td-theme-tabs/style.less index d03eec0a0..2a80a8fa5 100755 --- a/packages/site-components/src/components/td-theme-tabs/style.less +++ b/packages/site-components/src/components/td-theme-tabs/style.less @@ -16,7 +16,7 @@ &__block { background-color: var(--bg-color-tab-select); - box-shadow: 0 2px 4px rgba(0, 0, 0, .15); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); position: absolute; height: calc(100% - 4px); transition: all var(--anim-time-fn-easing) var(--anim-duration-moderate); @@ -39,7 +39,7 @@ width: 16px; height: 16px; pointer-events: none; - transition: all .2s linear; + transition: all 0.2s linear; } &:hover:not(.active) { @@ -54,4 +54,4 @@ color: #fff; } } -} \ No newline at end of file +} diff --git a/packages/site-components/src/components/td-tooltip/style.less b/packages/site-components/src/components/td-tooltip/style.less index 475e2f44d..de2d32795 100755 --- a/packages/site-components/src/components/td-tooltip/style.less +++ b/packages/site-components/src/components/td-tooltip/style.less @@ -1,8 +1,7 @@ .TDesign-tooltip { position: relative; - &[data-placement="top"] { - + &[data-placement='top'] { .TDesign-tooltip__popup { top: -36px; @@ -13,8 +12,7 @@ } } - &[data-placement="bottom"] { - + &[data-placement='bottom'] { .TDesign-tooltip__popup { bottom: -36px; @@ -37,12 +35,15 @@ visibility: hidden; opacity: 0; z-index: 900; - transition: all .2s linear; + transition: all 0.2s linear; background-color: var(--bg-color-container); - box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, .05), 0px 8px 10px 1px rgba(0, 0, 0, .06), 0px 5px 5px -3px rgba(0, 0, 0, .1); + box-shadow: + 0 3px 14px 2px rgba(0, 0, 0, 0.05), + 0 8px 10px 1px rgba(0, 0, 0, 0.06), + 0 5px 5px -3px rgba(0, 0, 0, 0.1); &::after { - content: ""; + content: ''; z-index: 2; width: 0; height: 0; diff --git a/packages/site-components/src/env.d.ts b/packages/site-components/src/env.d.ts index 58ece7602..1a2d1f73c 100644 --- a/packages/site-components/src/env.d.ts +++ b/packages/site-components/src/env.d.ts @@ -5,15 +5,13 @@ interface WebChatSdkInstance { onChatEnd(callback: (payload: { content: string }) => void): void; } -interface WebChatSdkConstructor { - new (options: { - logo: string; - logoLarge: string; - style: { background: string }; - knowledgeBase: string; - keywords: string; - }): WebChatSdkInstance; -} +type WebChatSdkConstructor = new (options: { + logo: string; + logoLarge: string; + style: { background: string }; + knowledgeBase: string; + keywords: string; +}) => WebChatSdkInstance; interface Window { WebChatSdk?: WebChatSdkConstructor; @@ -23,15 +21,15 @@ interface Window { aegis?: unknown; pgvMain?: () => void; showTdMessage?: (options: { content: string; duration?: number; theme?: string }) => void; - platforms?: Array<{ name: string; url: string }>; + platforms?: { name: string; url: string }[]; routerList?: unknown[]; docInfo?: { title: string; desc: string[] }; - contributors?: Array<{ username: string }>; + contributors?: { username: string }[]; code?: string; tsCode?: string; compositionCode?: string; usageConfig?: unknown[]; - usagePanelList?: Array<{ label: string; value: string }>; + usagePanelList?: { label: string; value: string }[]; } interface WindowEventMap { @@ -40,15 +38,13 @@ interface WindowEventMap { storageChange: Event; } -interface AegisConstructor { - new (options: { - id: string; - uin?: string; - reportApiSpeed: boolean; - reportAssetSpeed: boolean; - spa: boolean; - hostUrl?: string; - }): unknown; -} +type AegisConstructor = new (options: { + id: string; + uin?: string; + reportApiSpeed: boolean; + reportAssetSpeed: boolean; + spa: boolean; + hostUrl?: string; +}) => unknown; declare const Aegis: AegisConstructor; diff --git a/packages/site-components/src/styles/animation.less b/packages/site-components/src/styles/animation.less index a97e02e76..27d95a7c5 100644 --- a/packages/site-components/src/styles/animation.less +++ b/packages/site-components/src/styles/animation.less @@ -1,54 +1,42 @@ // light-dark-8deg-animation @keyframes light-to-dark { - from { - clip-path: polygon(0 0, - 0 0, - calc(tan(8deg) * -100vh) 100%, - calc(tan(8deg) * -100vh) 100%); - } - - to { - clip-path: polygon(0 0, - calc((tan(8deg) * 100vh) + 100%) 0, - 100% 100%, - calc(tan(8deg) * -100vh) 100%); - } + from { + clip-path: polygon(0 0, 0 0, calc(tan(8deg) * -100vh) 100%, calc(tan(8deg) * -100vh) 100%); + } + + to { + clip-path: polygon(0 0, calc((tan(8deg) * 100vh) + 100%) 0, 100% 100%, calc(tan(8deg) * -100vh) 100%); + } } @keyframes dark-to-light { - from { - clip-path: polygon(calc((tan(8deg) * 100vh) + 100%) 0, - calc((tan(8deg) * 100vh) + 100%) 0, - 100% 100%, - 100% 100%); - } - - to { - clip-path: polygon(0 0, - calc((tan(8deg) * 100vh) + 100%) 0, - 100% 100%, - calc(tan(8deg) * -100vh) 100%); - } + from { + clip-path: polygon(calc((tan(8deg) * 100vh) + 100%) 0, calc((tan(8deg) * 100vh) + 100%) 0, 100% 100%, 100% 100%); + } + + to { + clip-path: polygon(0 0, calc((tan(8deg) * 100vh) + 100%) 0, 100% 100%, calc(tan(8deg) * -100vh) 100%); + } } :root::view-transition-group(root) { - animation-duration: 1s; + animation-duration: 1s; } :root::view-transition-new(root), :root::view-transition-old(root) { - mix-blend-mode: normal; + mix-blend-mode: normal; } :root::view-transition-old(root), :root[theme-mode='dark']::view-transition-old(root) { - animation: none; + animation: none; } :root::view-transition-new(root) { - animation-name: dark-to-light; + animation-name: dark-to-light; } :root[theme-mode='dark']::view-transition-new(root) { - animation-name: light-to-dark; -} \ No newline at end of file + animation-name: light-to-dark; +} diff --git a/packages/site-components/src/styles/dark.less b/packages/site-components/src/styles/dark.less index 1eab0f60d..308d8ca8d 100755 --- a/packages/site-components/src/styles/dark.less +++ b/packages/site-components/src/styles/dark.less @@ -1,8 +1,8 @@ -:root[theme-mode="dark"] { +:root[theme-mode='dark'] { background: var(--bg-color-page); img { - filter: brightness(.85); + filter: brightness(0.85); } --theme-block-light-display: none; @@ -10,8 +10,10 @@ --header-box-shadow: inset 0 -1px 0 #4b4b4b; --footer-box-shadow: inset 0 1px 0 #4b4b4b; --aside-box-shadow: inset -1px 0 0 #4b4b4b; - --portal-box-shadow: inset 1px 0px 0px #5e5e5e, inset -1px 0px 0px #5e5e5e, inset 0px -1px 0px #5e5e5e, inset 0px 1px 0px #5e5e5e; - --table-box-shadow: inset 0px 1px 0px #4b4b4b, inset 0px -1px 0px #4b4b4b, inset -1px 0px 0px #4b4b4b, inset 1px 0px 0px #4b4b4b; + --portal-box-shadow: + inset 1px 0px 0px #5e5e5e, inset -1px 0px 0px #5e5e5e, inset 0px -1px 0px #5e5e5e, inset 0px 1px 0px #5e5e5e; + --table-box-shadow: + inset 0px 1px 0px #4b4b4b, inset 0px -1px 0px #4b4b4b, inset -1px 0px 0px #4b4b4b, inset 1px 0px 0px #4b4b4b; // 基础/下层 投影 hover 使用的组件包括:表格 / --shadow-1: 0 4px 6px rgba(0, 0, 0, .06), 0 1px 10px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .12); @@ -21,10 +23,10 @@ --shadow-3: 0 16px 24px rgba(0, 0, 0, .14), 0 6px 30px rgba(0, 0, 0, .12), 0 8px 10px rgba(0, 0, 0, .2); // 内投影 用于弹窗类组件(气泡确认框 / 全局提示 / 消息通知)的内描边 - --shadow-inset-top: inset 0 .5px 0 #5e5e5e; - --shadow-inset-right: inset .5px 0 0 #5e5e5e; - --shadow-inset-bottom: inset 0 -.5px 0 #5e5e5e; - --shadow-inset-left: inset -.5px 0 0 #5e5e5e; + --shadow-inset-top: inset 0 0.5px 0 #5e5e5e; + --shadow-inset-right: inset 0.5px 0 0 #5e5e5e; + --shadow-inset-bottom: inset 0 -0.5px 0 #5e5e5e; + --shadow-inset-left: inset -0.5px 0 0 #5e5e5e; // 中性色彩 // dark模式默认全局中性色彩配置 @@ -38,10 +40,10 @@ --bg-color-secondaryfooter: #101010; --bg-color-docpage: #242424; // 默认页面文档底层背景 --bg-color-container: #242424; // 主要容器背景 默认页面顶层背景 - --bg-color-container-transparent: rgba(44, 44, 44, .9); // 默认页面次要底层背景透明度 + --bg-color-container-transparent: rgba(44, 44, 44, 0.9); // 默认页面次要底层背景透明度 --bg-color-secondarycontainer: #383838; // 次要容器背景 --bg-color-component: #383838; // 组件背景 主要容器之上组件背景 - --bg-color-component-transparent: rgba(75, 75, 75, .9); // 组件背景透明度 + --bg-color-component-transparent: rgba(75, 75, 75, 0.9); // 组件背景透明度 --bg-color-tag: #4b4b4b; // 标签背景色 --bg-color-tab: #383838; --bg-color-table: #242424; @@ -63,8 +65,8 @@ // 中性色彩交互 token // 交互状态token - --bg-color-demo-hover: rgba(255, 255, 255, .05); // 默认 demo底层背景hover - --bg-color-demo-select: rgba(255, 255, 255, .1); // 默认 demo底层背景hover + --bg-color-demo-hover: rgba(255, 255, 255, 0.05); // 默认 demo底层背景hover + --bg-color-demo-select: rgba(255, 255, 255, 0.1); // 默认 demo底层背景hover --bg-color-code-hover: #383838; --bg-color-code-select: #4b4b4b; --bg-color-container-hover: #383838; // 主要容器背景 默认页面顶层背景hover @@ -76,15 +78,15 @@ --bg-color-navigation-hover: #383838; --bg-color-navigation-select: #4b4b4b; --bg-color-card-hover: #4b4b4b; - --bg-color-scroll: rgba(255, 255, 255, .14); // 滚动条颜色 + --bg-color-scroll: rgba(255, 255, 255, 0.14); // 滚动条颜色 --bg-color-component-disabled: #242424; // 组件背景 disabled 主要容器之上组件背景disabled // 文字&图标色彩 // 默认light模式文字和图标色彩配置 - --text-primary: rgba(255, 255, 255, .9); // 主要文字色彩 - --text-secondary: rgba(255, 255, 255, .55); // 次要文字色彩 - --text-placeholder: rgba(255, 255, 255, .35); // 占位符文字色彩 - --text-disabled: rgba(255, 255, 255, .22); // 文字disabled态 + --text-primary: rgba(255, 255, 255, 0.9); // 主要文字色彩 + --text-secondary: rgba(255, 255, 255, 0.55); // 次要文字色彩 + --text-placeholder: rgba(255, 255, 255, 0.35); // 占位符文字色彩 + --text-disabled: rgba(255, 255, 255, 0.22); // 文字disabled态 --text-anti: #fff; // 文字反色色彩 --text-interactive: #0052d9; @@ -123,11 +125,11 @@ // 主题中心相关 // dark模式中性色配置 - --bg-color-theme-transparent: rgba(44, 44, 44, .6); + --bg-color-theme-transparent: rgba(44, 44, 44, 0.6); --bg-color-theme-secondary: #424242; --bg-color-theme-surface: #4d4d4d; --bg-color-theme-tertiary: #5e5e5e; - --theme-component-border: rgba(255, 255, 255, .06); + --theme-component-border: rgba(255, 255, 255, 0.06); --bg-color-theme-radio: #424242; --bg-color-theme-radio-active: #5e5e5e; } diff --git a/packages/site-components/src/styles/docs.less b/packages/site-components/src/styles/docs.less index a2786faec..36cd71759 100755 --- a/packages/site-components/src/styles/docs.less +++ b/packages/site-components/src/styles/docs.less @@ -3,7 +3,7 @@ .header-anchor { width: @width; height: @height; - background-image: url(../images/link.svg); + background-image: url('../images/link.svg'); background-repeat: no-repeat; background-size: 100% auto; margin-left: 8px; @@ -17,7 +17,7 @@ } :root, -:root[theme-mode="light"] { +:root[theme-mode='light'] { .__light__ { display: block; } @@ -27,7 +27,7 @@ } } -:root[theme-mode="dark"] { +:root[theme-mode='dark'] { .__light__ { display: none; } @@ -37,10 +37,9 @@ } } -div[name="DOC"], -div[name="API"], -div[name="DESIGN"] { - +div[name='DOC'], +div[name='API'], +div[name='DESIGN'] { img { max-width: 100%; margin: 16px 0 8px; @@ -53,10 +52,10 @@ div[name="DESIGN"] { } } -div[name="DOC"], -div[name="DEMO"], -div[name="API"], -div[name="DESIGN"] { +div[name='DOC'], +div[name='DEMO'], +div[name='API'], +div[name='DESIGN'] { // 引用文本 blockquote { display: block; @@ -97,7 +96,6 @@ div[name="DESIGN"] { position: relative; &:hover { - &::-webkit-scrollbar-thumb { background-color: var(--bg-color-scroll); } @@ -130,12 +128,12 @@ div[name="DESIGN"] { border-radius: 3px; padding: 2px 6px; font-size: 12px; - word-break: break-word; + overflow-wrap: break-word; } code, code * { - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; } a:not([class]) { @@ -167,7 +165,7 @@ div[name="DESIGN"] { } tr { - transition: all .2s; + transition: all 0.2s; } tr:hover { @@ -269,7 +267,7 @@ div[name="DESIGN"] { .tdesign-header-anchor, .header-anchor { text-decoration: none; - transition: opacity .3s; + transition: opacity 0.3s; opacity: 0; } } @@ -325,7 +323,6 @@ div[name="DESIGN"] { } .tdesign-toc_list_item_a { - text-decoration: none; margin-left: -1px; padding-left: 16px; margin-bottom: 4px; @@ -349,8 +346,7 @@ div[name="DESIGN"] { } } -div[name="DESIGN"] { - +div[name='DESIGN'] { h5 + .legend { margin-top: -16px; } @@ -381,8 +377,7 @@ div[name="DESIGN"] { } } -div[name="DOC"] { - +div[name='DOC'] { image { margin: 0; border-radius: 6px; @@ -391,7 +386,6 @@ div[name="DOC"] { // 组件概览 h3 { - .tag { color: var(--text-secondary); padding: 0 12px; @@ -410,8 +404,7 @@ div[name="DOC"] { margin-top: 16px; display: flex; flex-wrap: wrap; - column-gap: 16px; - row-gap: 16px; + gap: 16px; } .image-wrapper { @@ -421,15 +414,15 @@ div[name="DOC"] { box-sizing: border-box; @media screen and (min-width: 1440px) { - width: ~"calc((100% - 48px) / 4)"; + width: ~'calc((100% - 48px) / 4)'; } @media screen and (min-width: 750px) and (max-width: 1439px) { - width: ~"calc((100% - 32px) / 3)"; + width: ~'calc((100% - 32px) / 3)'; } @media screen and (max-width: 749px) { - width: ~"calc((100% - 16px) / 2)"; + width: ~'calc((100% - 16px) / 2)'; } .item { @@ -441,12 +434,18 @@ div[name="DOC"] { box-sizing: border-box; cursor: pointer; text-decoration: none; - transition: transform .24s cubic-bezier(.38, 0, .24, 1), box-shadow .24s linear, opacity .24s linear; + transition: + transform 0.24s cubic-bezier(0.38, 0, 0.24, 1), + box-shadow 0.24s linear, + opacity 0.24s linear; &:hover { color: var(--text-primary); transform: translateY(-2px); - box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, .05), 0px 16px 24px 2px rgba(0, 0, 0, .04), 0px 8px 10px -5px rgba(0, 0, 0, .08); + box-shadow: + 0 6px 30px 5px rgba(0, 0, 0, 0.05), + 0 16px 24px 2px rgba(0, 0, 0, 0.04), + 0 8px 10px -5px rgba(0, 0, 0, 0.08); .name { color: var(--text-primary); @@ -467,7 +466,7 @@ div[name="DOC"] { text-overflow: ellipsis; overflow: hidden; white-space: pre; - transition: all .2s linear; + transition: all 0.2s linear; } } } @@ -481,4 +480,4 @@ div[name='API'] { width: 225%; } } -} \ No newline at end of file +} diff --git a/packages/site-components/src/styles/main.less b/packages/site-components/src/styles/main.less index e1e93f8af..0f908d1e9 100755 --- a/packages/site-components/src/styles/main.less +++ b/packages/site-components/src/styles/main.less @@ -1,7 +1,7 @@ -@import "./vars.less"; -@import "./dark.less"; -@import "./reset"; -@import "./nprogress.less"; -@import "./docs.less"; -@import "./timeline.less"; -@import "./animation.less"; \ No newline at end of file +@import './vars.less'; +@import './dark.less'; +@import './reset'; +@import './nprogress.less'; +@import './docs.less'; +@import './timeline.less'; +@import './animation.less'; diff --git a/packages/site-components/src/styles/nprogress.less b/packages/site-components/src/styles/nprogress.less index 730ceadb3..fb7e00fe3 100755 --- a/packages/site-components/src/styles/nprogress.less +++ b/packages/site-components/src/styles/nprogress.less @@ -1,14 +1,22 @@ /* stylelint-disable */ -@keyframes gradient { - 0% { background-position: 0 0; } - - 100% { background-position: -200% 0; } +@keyframes gradient { + 0% { + background-position: 0 0; + } + + 100% { + background-position: -200% 0; + } } @keyframes nprogress-spinner { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } } /* Make clicks pass-through */ @@ -40,8 +48,10 @@ right: 0px; width: 100px; height: 100%; - box-shadow: 0 0 10px #29d, 0 0 5px #29d; - opacity: 1.0; + box-shadow: + 0 0 10px #29d, + 0 0 5px #29d; + opacity: 1; transform: rotate(3deg) translate(0px, -4px); } @@ -77,4 +87,3 @@ .nprogress-custom-parent #nprogress .bar { position: absolute; } - diff --git a/packages/site-components/src/styles/prism-theme-dark.less b/packages/site-components/src/styles/prism-theme-dark.less index 75753686f..0c732eb8a 100755 --- a/packages/site-components/src/styles/prism-theme-dark.less +++ b/packages/site-components/src/styles/prism-theme-dark.less @@ -1,190 +1,189 @@ -:root[theme-mode="dark"] { - - code[class*="language-"], - pre[class*="language-"] { +:root[theme-mode='dark'] { + code[class*='language-'], + pre[class*='language-'] { text-align: left; white-space: pre; word-spacing: normal; word-break: normal; - word-wrap: normal; - font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + overflow-wrap: normal; + font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 1em; line-height: 1.5em; tab-size: 4; hyphens: none; } - - code[class*="language-"]::selection, - pre[class*="language-"]::selection, - code[class*="language-"] ::selection, - pre[class*="language-"] ::selection { + + code[class*='language-']::selection, + pre[class*='language-']::selection, + code[class*='language-'] ::selection, + pre[class*='language-'] ::selection { background: #d6dbe3; color: #263238; } - - :not(pre)>code[class*="language-"] { + + :not(pre) > code[class*='language-'] { white-space: normal; - border-radius: .2em; - padding: .1em; + border-radius: 0.2em; + padding: 0.1em; } - - pre[class*="language-"] { + + pre[class*='language-'] { overflow: auto; position: relative; } - - .language-css>code, - .language-sass>code, - .language-scss>code { + + .language-css > code, + .language-sass > code, + .language-scss > code { color: #f2995f; } - - [class*="language-"] .namespace { - opacity: .7; + + [class*='language-'] .namespace { + opacity: 0.7; } - + .token.atrule { color: #ae78f0; } - + .token.attr-name { color: #3280ff; } - + .token.attr-value { color: #fbca25; } - + .token.attribute { color: #fbca25; } - + .token.boolean { color: #ae78f0; } - + .token.builtin { color: #3280ff; } - + .token.cdata { color: #3280ff; } - + .token.char { color: #3280ff; } - + .token.class { color: #3280ff; } - + .token.class-name { color: #5cc5fc; } - + .token.comment { color: #97a3b7; } - + .token.constant { color: #ae78f0; } - + .token.deleted { color: #48c79c; } - + .token.doctype { color: #97a3b7; } - + .token.entity { color: #48c79c; } - + .token.function { color: #ae78f0; } - + .token.hexcode { color: #f2995f; } - + .token.id { color: #ae78f0; font-weight: bold; } - + .token.important { color: #f6c; font-weight: bold; } - + .token.inserted { color: #3280ff; } - + .token.keyword { color: #f6c; } - + .token.number { color: #f2995f; } - + .token.operator { color: #3280ff; } - + .token.prolog { color: #97a3b7; } - + .token.property { color: #3280ff; } - + .token.pseudo-class { color: #fbca25; } - + .token.pseudo-element { color: #fbca25; } - + .token.punctuation { color: #3280ff; } - + .token.regex { color: #5cc5fc; } - + .token.selector { color: #f36d78; } - + .token.string { color: #fbca25; } - + .token.symbol { color: #f6c; } - + .token.tag { color: #48c79c; } - + .token.unit { color: #f2995f; } - + .token.url { color: #48c79c; } - + .token.variable { color: #48c79c; } diff --git a/packages/site-components/src/styles/prism-theme.less b/packages/site-components/src/styles/prism-theme.less index 0ec7dece6..d12b74c9f 100755 --- a/packages/site-components/src/styles/prism-theme.less +++ b/packages/site-components/src/styles/prism-theme.less @@ -1,44 +1,44 @@ -code[class*="language-"], -pre[class*="language-"] { +code[class*='language-'], +pre[class*='language-'] { text-align: left; white-space: pre; word-spacing: normal; word-break: normal; - word-wrap: normal; - font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + overflow-wrap: normal; + font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 1em; line-height: 1.5em; tab-size: 4; hyphens: none; } -code[class*="language-"]::selection, -pre[class*="language-"]::selection, -code[class*="language-"] ::selection, -pre[class*="language-"] ::selection { +code[class*='language-']::selection, +pre[class*='language-']::selection, +code[class*='language-'] ::selection, +pre[class*='language-'] ::selection { background: #d6dbe3; color: #263238; } -:not(pre)>code[class*="language-"] { +:not(pre) > code[class*='language-'] { white-space: normal; - border-radius: .2em; - padding: .1em; + border-radius: 0.2em; + padding: 0.1em; } -pre[class*="language-"] { +pre[class*='language-'] { overflow: auto; position: relative; } -.language-css>code, -.language-sass>code, -.language-scss>code { +.language-css > code, +.language-sass > code, +.language-scss > code { color: #c24c08; } -[class*="language-"] .namespace { - opacity: .7; +[class*='language-'] .namespace { + opacity: 0.7; } .token.atrule { @@ -185,4 +185,4 @@ pre[class*="language-"] { .token.variable { color: #b01531; -} \ No newline at end of file +} diff --git a/packages/site-components/src/styles/reset.less b/packages/site-components/src/styles/reset.less index 6fb3879eb..420cb9ec1 100755 --- a/packages/site-components/src/styles/reset.less +++ b/packages/site-components/src/styles/reset.less @@ -59,7 +59,7 @@ p { @font-face { font-family: TCloudNumber; - src: url("../font/TCloudNumber.ttf"); + src: url('../font/TCloudNumber.ttf'); font-weight: normal; font-style: normal; font-display: swap; @@ -71,4 +71,4 @@ p { font-weight: normal; font-style: normal; font-display: swap; -} \ No newline at end of file +} diff --git a/packages/site-components/src/styles/timeline.less b/packages/site-components/src/styles/timeline.less index b58ec1405..607da97f2 100644 --- a/packages/site-components/src/styles/timeline.less +++ b/packages/site-components/src/styles/timeline.less @@ -1,4 +1,4 @@ -div[name="DOC"].timeline { +div[name='DOC'].timeline { padding-left: 32px; position: relative; overflow: hidden; diff --git a/packages/site-components/src/styles/vars.less b/packages/site-components/src/styles/vars.less index 3b56a0c05..bde2eb675 100755 --- a/packages/site-components/src/styles/vars.less +++ b/packages/site-components/src/styles/vars.less @@ -1,5 +1,5 @@ :root, -:root[theme-mode="light"] { +:root[theme-mode='light'] { --header-height: 64px; --doc-header-height: 252px; --aside-width: 260px; @@ -26,8 +26,10 @@ --header-box-shadow: inset 0 -1px 0 #e7e7e7; --footer-box-shadow: inset 0 1px 0 #e7e7e7; --aside-box-shadow: inset -1px 0 0 #e7e7e7; - --portal-box-shadow: inset 1px 0px 0px #dcdcdc, inset -1px 0px 0px #dcdcdc, inset 0px -1px 0px #dcdcdc, inset 0px 1px 0px #dcdcdc; - --table-box-shadow: inset 0px 1px 0px #e7e7e7, inset 0px -1px 0px #e7e7e7, inset -1px 0px 0px #e7e7e7, inset 1px 0px 0px #e7e7e7; + --portal-box-shadow: + inset 1px 0px 0px #dcdcdc, inset -1px 0px 0px #dcdcdc, inset 0px -1px 0px #dcdcdc, inset 0px 1px 0px #dcdcdc; + --table-box-shadow: + inset 0px 1px 0px #e7e7e7, inset 0px -1px 0px #e7e7e7, inset -1px 0px 0px #e7e7e7, inset 1px 0px 0px #e7e7e7; // 基础/下层 投影 hover 使用的组件包括:表格 / --shadow-1: 0 1px 10px rgba(0, 0, 0, .05), 0 4px 5px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .12); @@ -60,10 +62,10 @@ --bg-color-secondaryfooter: #e7e7e7; --bg-color-docpage: #fff; // 默认页面文档底层背景 --bg-color-container: #fff; // 主要容器背景 默认页面顶层背景 - --bg-color-container-transparent: rgba(255, 255, 255, .9); // 默认页面次要底层背景透明度 + --bg-color-container-transparent: rgba(255, 255, 255, 0.9); // 默认页面次要底层背景透明度 --bg-color-secondarycontainer: #f5f5f5; // 次要容器背景 --bg-color-component: #eee; // 组件背景 主要容器之上组件背景 - --bg-color-component-transparent: rgba(238, 238, 238, .8);; // 组件背景透明度 + --bg-color-component-transparent: rgba(238, 238, 238, 0.8); // 组件背景透明度 --bg-color-tag: #eee; // 标签背景色 --bg-color-tab: #eee; --bg-color-table: #fff; @@ -85,8 +87,8 @@ // 中性色彩交互 token // 交互状态token - --bg-color-demo-hover: rgba(0, 0, 0, .05); // 默认 demo底层背景hover - --bg-color-demo-select: rgba(0, 0, 0, .1); // 默认 demo底层背景hover + --bg-color-demo-hover: rgba(0, 0, 0, 0.05); // 默认 demo底层背景hover + --bg-color-demo-select: rgba(0, 0, 0, 0.1); // 默认 demo底层背景hover --bg-color-code-hover: #e7e7e7; --bg-color-code-select: #dcdcdc; --bg-color-container-hover: #f3f3f3; // 主要容器背景 默认页面顶层背景hover @@ -98,15 +100,15 @@ --bg-color-navigation-hover: #f3f3f3; --bg-color-navigation-select: #e7e7e7; --bg-color-card-hover: #f3f3f3; - --bg-color-scroll: rgba(0, 0, 0, .14); // 滚动条颜色 + --bg-color-scroll: rgba(0, 0, 0, 0.14); // 滚动条颜色 --bg-color-component-disabled: #eee; // 组件背景 disabled 主要容器之上组件背景disabled // 文字&图标色彩 // 默认light模式文字和图标色彩配置 - --text-primary: rgba(0, 0, 0, .9); // 主要文字色彩 - --text-secondary: rgba(0, 0, 0, .6); // 次要文字色彩 - --text-placeholder: rgba(0, 0, 0, .4); // 占位符文字色彩 - --text-disabled: rgba(0, 0, 0, .26); // 文字disabled态 + --text-primary: rgba(0, 0, 0, 0.9); // 主要文字色彩 + --text-secondary: rgba(0, 0, 0, 0.6); // 次要文字色彩 + --text-placeholder: rgba(0, 0, 0, 0.4); // 占位符文字色彩 + --text-disabled: rgba(0, 0, 0, 0.26); // 文字disabled态 --text-anti: #fff; // 文字反色色彩 --text-interactive: var(--td-brand-color); // 主题色文字色彩 @@ -114,7 +116,7 @@ // 主题相关配置 --brand-main: var(--td-brand-color); // 移动端缺失 hover Token 时,使用 active 兜底 - --brand-main-hover: var(--td-brand-color-hover, var(--td-brand-color-active)); + --brand-main-hover: var(--td-brand-color-hover, var(--td-brand-color-active)); --brand-main-focus: var(--td-brand-color-focus); --brand-main-disabled: var(--td-brand-color-disabled); --brand-main-light: rgba(0, 82, 217, .1); @@ -146,11 +148,11 @@ // 主题中心相关 // light模式中性色配置 - --bg-color-theme-transparent: rgba(238, 238, 238, .6); + --bg-color-theme-transparent: rgba(238, 238, 238, 0.6); --bg-color-theme-secondary: #f3f3f3; --bg-color-theme-surface: #fff; --bg-color-theme-tertiary: #e7e7e7; - --theme-component-border: rgba(0, 0, 0, .06); + --theme-component-border: rgba(0, 0, 0, 0.06); --bg-color-theme-radio: #e7e7e7; --bg-color-theme-radio-active: #fff; } diff --git a/packages/theme-generator/.eslintrc.js b/packages/theme-generator/.eslintrc.js deleted file mode 100644 index 4d117932c..000000000 --- a/packages/theme-generator/.eslintrc.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = { - root: true, - parser: 'vue-eslint-parser', - parserOptions: { - ecmaVersion: 2021, - sourceType: 'module', - parser: '@typescript-eslint/parser', - }, - plugins: ['vue'], - // 根配置在前,vue 配置在后(确保 vue 的 script-setup-uses-vars 等规则优先生效) - extends: ['./../../.eslintrc.js', 'plugin:vue/vue3-essential'], - overrides: [ - { - files: ['*.ts'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - rules: { - // 基础规则会误报 TS 类型/重载签名,改用 TS 感知版本 - 'no-unused-vars': 'off', - 'no-redeclare': 'off', - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - }, - }, - { - files: ['*.vue'], - parserOptions: { - parser: '@typescript-eslint/parser', - }, - plugins: ['@typescript-eslint'], - rules: { - 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], - }, - }, - ], - rules: { - // 让 no-unused-vars 识别 diff --git a/packages/theme-generator/src/size-panel/index.vue b/packages/theme-generator/src/size-panel/index.vue index 7907e438f..506cc7310 100644 --- a/packages/theme-generator/src/size-panel/index.vue +++ b/packages/theme-generator/src/size-panel/index.vue @@ -34,7 +34,7 @@ @@ -59,7 +59,11 @@ @@ -84,7 +88,11 @@ @@ -109,7 +117,7 @@ @@ -134,7 +142,7 @@ @@ -250,7 +258,7 @@ onMounted(() => { color: var(--text-primary); font-weight: 600; margin-bottom: 8px; - margin-top: 0px; + margin-top: 0; line-height: 22px; display: flex; align-items: center; @@ -258,7 +266,7 @@ onMounted(() => { &__subtitle { font-size: 12px; - margin: 4px 0 10px 0; + margin: 4px 0 10px; button { margin-right: 8px; @@ -271,6 +279,7 @@ onMounted(() => { display: flex; flex-wrap: wrap; margin: 0 -4px; + > div { margin: 4px; } @@ -326,7 +335,7 @@ onMounted(() => { } &__custom { - margin: 16px 0 8px 0; + margin: 16px 0 8px; padding: 2px; height: 131px; background: conic-gradient( @@ -341,15 +350,18 @@ onMounted(() => { border-radius: 9px; cursor: pointer; transition: padding 0.2s; + &:hover { padding: 4px; } + &-inner { background-color: var(--bg-color-card); padding: 4px; border-radius: 7px; max-height: 100%; } + &-top { padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; @@ -377,6 +389,7 @@ onMounted(() => { color: var(--text-primary); font-weight: 600; } + &:last-child { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60f00bc1d..ed653e3a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,47 +13,62 @@ importers: version: 1.29.0 devDependencies: '@commitlint/cli': - specifier: ^8.2.0 - version: 8.3.6 + specifier: ^21.2.4 + version: 21.2.4(conventional-commits-parser@7.1.3)(typescript@5.9.3) '@commitlint/config-conventional': - specifier: ^8.2.0 - version: 8.3.6 + specifier: ^21.2.4 + version: 21.2.4 + '@eslint/js': + specifier: ^10.0.1 + version: 10.0.1(eslint@10.13.0(jiti@2.7.0)) cz-conventional-changelog: - specifier: ^3.0.2 + specifier: ^3.3.0 version: 3.3.0(@types/node@22.20.4)(typescript@5.9.3) eslint: - specifier: ^7.32.0 - version: 7.32.0 + specifier: ^10.13.0 + version: 10.13.0(jiti@2.7.0) eslint-config-prettier: - specifier: ^9.0.0 - version: 9.1.0(eslint@7.32.0) - eslint-plugin-html: - specifier: ^7.1.0 - version: 7.1.0 - eslint-plugin-prettier: - specifier: ^4.2.1 - version: 4.2.1(eslint-config-prettier@9.1.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8) + specifier: ^10.1.8 + version: 10.1.8(eslint@10.13.0(jiti@2.7.0)) + eslint-plugin-vue: + specifier: ^10.11.1 + version: 10.11.1(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3))(eslint@10.13.0(jiti@2.7.0))(vue-eslint-parser@10.4.1(eslint@10.13.0(jiti@2.7.0))) + globals: + specifier: ^17.13.0 + version: 17.13.0 husky: - specifier: ^8.0.0 - version: 8.0.3 + specifier: ^9.1.7 + version: 9.1.7 lint-staged: - specifier: ^16.3.4 - version: 16.4.0 + specifier: ^17.6.0 + version: 17.6.0 + npm-run-all2: + specifier: ^9.0.3 + version: 9.0.3 + postcss-html: + specifier: ^2.0.0 + version: 2.0.0(postcss@8.5.26) prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: ^3.9.10 + version: 3.9.10 rimraf: - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^6.1.3 + version: 6.1.3 stylelint: - specifier: ^15.10.3 - version: 15.11.0(typescript@5.9.3) + specifier: ^17.16.0 + version: 17.16.0(typescript@5.9.3) stylelint-config-standard: - specifier: ^34.0.0 - version: 34.0.0(stylelint@15.11.0(typescript@5.9.3)) + specifier: ^40.0.0 + version: 40.0.0(stylelint@17.16.0(typescript@5.9.3)) stylelint-config-standard-less: - specifier: ^2.0.0 - version: 2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)) + specifier: ^4.1.0 + version: 4.1.0(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)) + typescript-eslint: + specifier: ^8.72.0 + version: 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + vue-eslint-parser: + specifier: ^10.4.1 + version: 10.4.1(eslint@10.13.0(jiti@2.7.0)) packages/auto-release-collection: dependencies: @@ -61,12 +76,6 @@ importers: specifier: ^6.0.0 version: 6.0.0 devDependencies: - '@typescript-eslint/eslint-plugin': - specifier: ^5.6.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^5.6.0 - version: 5.62.0(eslint@7.32.0)(typescript@5.9.3) nodemon: specifier: ^3.1.7 version: 3.1.7 @@ -113,12 +122,6 @@ importers: '@types/qrcode': specifier: ^1.5.5 version: 1.5.6 - '@typescript-eslint/eslint-plugin': - specifier: ^5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^5.62.0 - version: 5.62.0(eslint@7.32.0)(typescript@5.9.3) '@vitest/coverage-v8': specifier: ^5.0.3 version: 5.0.3(vitest@5.0.3) @@ -136,10 +139,10 @@ importers: version: 5.9.3 vite: specifier: ^6.4.3 - version: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + version: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) vitest: specifier: ^5.0.3 - version: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) + version: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) packages/theme-generator: dependencies: @@ -168,21 +171,12 @@ importers: '@types/node': specifier: ^22.10.0 version: 22.20.4 - '@typescript-eslint/eslint-plugin': - specifier: ^5.6.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^5.6.0 - version: 5.62.0(eslint@7.32.0)(typescript@5.9.3) '@vitejs/plugin-vue': specifier: ^5.2.1 - version: 5.2.4(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3)) + version: 5.2.4(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3)) '@vue/test-utils': specifier: ^2.4.6 version: 2.5.1(@vue/compiler-dom@3.5.42)(@vue/server-renderer@3.5.42)(vue@3.5.42(typescript@5.9.3)) - eslint-plugin-vue: - specifier: ^9.32.0 - version: 9.33.0(eslint@7.32.0) happy-dom: specifier: ^15.11.7 version: 15.11.7 @@ -194,13 +188,10 @@ importers: version: 5.9.3 vite: specifier: ^6.4.3 - version: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + version: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) vitest: specifier: ^5.0.3 - version: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) - vue-eslint-parser: - specifier: ^9.4.2 - version: 9.4.3(eslint@7.32.0) + version: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) vue-tsc: specifier: ^3.3.11 version: 3.3.11(typescript@5.9.3) @@ -247,51 +238,21 @@ importers: specifier: ^4.5.1 version: 4.6.4(vue@3.5.42(typescript@5.9.3)) devDependencies: - '@commitlint/cli': - specifier: ^8.2.0 - version: 8.3.6 - '@commitlint/config-conventional': - specifier: ^8.2.0 - version: 8.3.6 '@types/markdown-it': specifier: ^12.2.3 version: 12.2.3 - '@typescript-eslint/eslint-plugin': - specifier: ^5.6.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^5.6.0 - version: 5.62.0(eslint@7.32.0)(typescript@5.9.3) + '@types/node': + specifier: ^22.15.3 + version: 22.20.4 '@vitejs/plugin-vue': specifier: ^5.2.4 - version: 5.2.4(vite@6.3.1(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3)) + version: 5.2.4(vite@6.3.1(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3)) autoprefixer: specifier: ^10.4.0 version: 10.4.20(postcss@8.4.47) cssnano: specifier: ^5.0.12 version: 5.1.15(postcss@8.4.47) - cz-conventional-changelog: - specifier: ^3.0.2 - version: 3.3.0(@types/node@22.20.4)(typescript@5.9.3) - eslint: - specifier: ^7.32.0 - version: 7.32.0 - eslint-config-standard: - specifier: ^16.0.3 - version: 16.0.3(eslint-plugin-import@2.30.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0) - eslint-plugin-import: - specifier: ^2.25.3 - version: 2.30.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0) - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@7.32.0) - eslint-plugin-promise: - specifier: ^5.2.0 - version: 5.2.0(eslint@7.32.0) - eslint-plugin-vue: - specifier: ^8.2.0 - version: 8.7.1(eslint@7.32.0) gray-matter: specifier: ^4.0.3 version: 4.0.3 @@ -305,8 +266,8 @@ importers: specifier: ^8.4.5 version: 8.4.47 rimraf: - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^6.1.3 + version: 6.1.3 standard-version: specifier: ^7.0.1 version: 7.1.0 @@ -315,7 +276,7 @@ importers: version: 5.9.3 vite: specifier: ^6.3.1 - version: 6.3.1(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + version: 6.3.1(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) vite-plugin-tdoc: specifier: ^2.0.0 version: 2.0.4(@types/markdown-it@12.2.3) @@ -331,9 +292,6 @@ packages: '@actions/http-client@2.2.3': resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==} - '@babel/code-frame@7.12.11': - resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} - '@babel/code-frame@7.24.7': resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} @@ -342,10 +300,6 @@ packages: resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.29.7': resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} @@ -375,108 +329,160 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@commitlint/cli@8.3.6': - resolution: {integrity: sha512-fg8p9/ZrzhUPIXBGrpzwKu50WT13jYS5OffYlkStPuemuv0GjXu37B8J/zNgu6UhrdBVHbmBR0LriKAzRLG/4g==} - engines: {node: '>=4'} + '@cacheable/memory@2.2.0': + resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==} + + '@cacheable/utils@2.5.0': + resolution: {integrity: sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==} + + '@commitlint/cli@21.2.4': + resolution: {integrity: sha512-g3M/wrQdElqGH5vROIeL2QiYIxrzqUkhCgsDyDlWfKEyQdCt10OyMB28W2cJtpZ+VNGMvmaN923infr1hOfyrg==} + engines: {node: '>=22.12.0'} hasBin: true - '@commitlint/config-conventional@8.3.6': - resolution: {integrity: sha512-sbjDwFoa0on+IUbnBswd1ZTa8bkcDlzgWS/s2HapwNw8CBHBuoJbBDOQBqaYLI4b4O7SHYyArMx3V1FvUXTVsg==} + '@commitlint/config-conventional@21.2.4': + resolution: {integrity: sha512-IRldtwgNmR0SySR7wizFbhRmq45lPt6H3XCNTMyVN7jrPLgi8JlTRR6Eg1HLWUQt9P1Lh3k6eY25ilDa47EE6w==} + engines: {node: '>=22.12.0'} '@commitlint/config-validator@19.5.0': resolution: {integrity: sha512-CHtj92H5rdhKt17RmgALhfQt95VayrUo2tSqY9g2w+laAXyk7K/Ef6uPm9tn5qSIwSmrLjKaXK9eiNuxmQrDBw==} engines: {node: '>=v18'} - '@commitlint/ensure@8.3.6': - resolution: {integrity: sha512-UUipnA7sX3OSUW39pi4Etf7pKrG76uM33ybs5YTEOZbT6zb3aKUS+A1ygo52eX+tqpxCiV+6qSy5qEKG8c1aeA==} - engines: {node: '>=4'} + '@commitlint/config-validator@21.2.3': + resolution: {integrity: sha512-JQ13v0GafSM4fBYX8UowSy++07Was20auq0NcTdnzSEq6/05Cq5GBUMIfKkqjzyBwC9sJFmPpKWgLLhH7cygkw==} + engines: {node: '>=22.12.0'} + + '@commitlint/ensure@21.2.4': + resolution: {integrity: sha512-woLOLV4pBMUBLyr5+MDM3WSG1r+eb2DObkysFSDxqyDUE4c6hZUOrpebJb2f8XcP3zKGJLb8H5w2suERVGI+Ag==} + engines: {node: '>=22.12.0'} '@commitlint/execute-rule@19.5.0': resolution: {integrity: sha512-aqyGgytXhl2ejlk+/rfgtwpPexYyri4t8/n4ku6rRJoRhGZpLFMqrZ+YaubeGysCP6oz4mMA34YSTaSOKEeNrg==} engines: {node: '>=v18'} - '@commitlint/execute-rule@8.3.6': - resolution: {integrity: sha512-kCcf+33LgFBZcVKzTRX7QZBiznFjzjgpyEXFjGsWgCeOXi1q3KPdwH9HvH22xpFZ4+n4lAuv/kQf5XUQMO2OGQ==} - engines: {node: '>=4'} + '@commitlint/execute-rule@21.0.1': + resolution: {integrity: sha512-RifH+FmImozKBE6mozhF4K3r2RRKP7SMi/Q/zLCmExtp5e05lhHOUYqGBlFBAGNHaZxU/WYw1XuugYK9jQzqnA==} + engines: {node: '>=22.12.0'} - '@commitlint/format@8.3.6': - resolution: {integrity: sha512-VN9Yq3cJoonLjeoYiTOidsxGM6lwyzcw6ekQCCIzjNbJa+7teTPE2wDSXqhbsF/0XDJUeHcygzgZwv4/lzStTA==} - engines: {node: '>=4'} + '@commitlint/format@21.2.3': + resolution: {integrity: sha512-KKwCjXYqA8r295uhLnulDXL9yekdXmj2yp2Q0XsBPhxQ2iPuvRE8F43j7g7yexo69wTdmUQmFz15jpderluzUQ==} + engines: {node: '>=22.12.0'} - '@commitlint/is-ignored@8.3.6': - resolution: {integrity: sha512-wxQImxePfAfIz9C2nWzebs0KUU9MiO8bWsRKNsAk9jknc+bjsre9Lje0sr6jvE840XZSTX/aaXY2g+Mt+9oq+w==} - engines: {node: '>=4'} + '@commitlint/is-ignored@21.2.3': + resolution: {integrity: sha512-Ng4nRj/LBAOvc+GQu7bsFW4/fL89LvZ14OOC/ERLbUpnG6QBwWRzY/1oXGwPs3C8YHWjJObin4kLYo2YeEn70w==} + engines: {node: '>=22.12.0'} - '@commitlint/lint@8.3.6': - resolution: {integrity: sha512-M/tysLho4KdsXJp7J7q/c1WEb3Dh75cm86eb0buci8C/DOIegLq/B3DE/8dhxOzGElUW/iq55MyWttJ/MRwKsg==} - engines: {node: '>=4'} + '@commitlint/lint@21.2.4': + resolution: {integrity: sha512-HR8SGl1oEGfi/cqyBipanVY0a9CfEzIcJjPC37t7oQedaUUngw3d5E17g5Cfr2S3p6KsZM7UOHFq5fXHLRh7DQ==} + engines: {node: '>=22.12.0'} '@commitlint/load@19.5.0': resolution: {integrity: sha512-INOUhkL/qaKqwcTUvCE8iIUf5XHsEPCLY9looJ/ipzi7jtGhgmtH7OOFiNvwYgH7mA8osUWOUDV8t4E2HAi4xA==} engines: {node: '>=v18'} - '@commitlint/load@8.3.6': - resolution: {integrity: sha512-bqqGg89KnfauJ01GrVBgKyWBXYy2UXmLvRGuepyI1HsNVaEIGBz6R+sTvk3K55Str6soF7HRpl6bDCmnEOVJtA==} - engines: {node: '>=4'} + '@commitlint/load@21.2.4': + resolution: {integrity: sha512-Gi+aAW9nL8XPgvg8kIO0gZOw1/ePvpDLkv1bm8tj0RqenhNtCzk0frtctJhl41uIAP7OSx9bgQ6HCOa9En4g2Q==} + engines: {node: '>=22.12.0'} - '@commitlint/message@8.3.6': - resolution: {integrity: sha512-x30GmsyZTk+QV4o5TRrDkZQm7uRumlKu+7yWeRdSAXyUgi9amsdMFJ8VbAoRsBndOAtEUkaXgK8dvvmgvW3kwg==} - engines: {node: '>=4'} + '@commitlint/message@21.2.0': + resolution: {integrity: sha512-YxGoiXD/HXNXLJPrQwE5poXa+XH0CBEm+mdvbHQP0g6MV/dmJyUFCzPNzZbxL93GvZ70TmtTK0Z0/IBpAqHv8g==} + engines: {node: '>=22.12.0'} - '@commitlint/parse@8.3.6': - resolution: {integrity: sha512-wL6Z5hZpT8i/3LMwP/CxTMPMU3v4blAbSA8QGPCruFHFtAV8hIiXvD1CNOhyeeuG29GAapopLgNJjtigzlN3kg==} - engines: {node: '>=4'} + '@commitlint/parse@21.2.3': + resolution: {integrity: sha512-Jt61QpF1xA88damCELe8I0FlDZPSpXNc8IhN7z5kZ0EcDYPjdZ+ZHPvsSXl69r2MIlLnNKeHhOn2cmVpziFE9w==} + engines: {node: '>=22.12.0'} - '@commitlint/read@8.3.6': - resolution: {integrity: sha512-ixlvPQO8AGFjE5U4DBwJIZtzIqmGeZKhpNjjuAyTwWfMURpXjv+/pVvq/AY3LvxHJM64DuQp2WqrbwJU6mXvUQ==} - engines: {node: '>=4'} + '@commitlint/read@21.2.3': + resolution: {integrity: sha512-szAepuLA1vTTr7fuudEg7jYyVHudf+FH+vptU91bhxE1WnE8TKrfTAi44HVllz8XpI8Pvp4GjR/iP5Nshgh+og==} + engines: {node: '>=22.12.0'} '@commitlint/resolve-extends@19.5.0': resolution: {integrity: sha512-CU/GscZhCUsJwcKTJS9Ndh3AKGZTNFIOoQB2n8CmFnizE0VnEuJoum+COW+C1lNABEeqk6ssfc1Kkalm4bDklA==} engines: {node: '>=v18'} - '@commitlint/resolve-extends@8.3.6': - resolution: {integrity: sha512-L0/UOBxc3wiA3gzyE8pN9Yunb6FS/2ZDCjieNH0XAgdF2ac5SHh056QE6aQwP7CSCYNEo2+SXxVZr/WOshsQHg==} - engines: {node: '>=4'} + '@commitlint/resolve-extends@21.2.3': + resolution: {integrity: sha512-bqJdmAtXgAQel+l02uIsF7rHgKgx1AGZdGBjam7uK4XW54ZAQtB6XAIUXezYprQiCcRMpBh4fHs5JodXK4mVZA==} + engines: {node: '>=22.12.0'} - '@commitlint/rules@8.3.6': - resolution: {integrity: sha512-NmEAWAW0f5Nda7ZJ11vd73PqOt57GvLc1SOfoUKolCC3lSJACj9SCTbfkQh8cEMlLmDpNqaGaVHH1jMYXMqU3g==} - engines: {node: '>=4'} + '@commitlint/rules@21.2.4': + resolution: {integrity: sha512-wranK/aevXs/WiW4N3orQlXY4sU2pQWjRSjN7I3TsZmP146Rr4CpsG38lpyqVcbNfMgvUVGy7ffYm7nCziTUwg==} + engines: {node: '>=22.12.0'} - '@commitlint/to-lines@8.3.6': - resolution: {integrity: sha512-4g26G37oh5dABVaRGALdlinjQ/wl8b4HTczLwXLKLM0iHHYFu2A1ZwiVJ8avQk/zThw86/HD6zOgGMNPoamjIQ==} - engines: {node: '>=4'} + '@commitlint/to-lines@21.0.1': + resolution: {integrity: sha512-bd1BFII7p1EQZre9Kaj+kKaMFP3cFCdt21K7DItVux9XP5WjLgJ0/Uy1pJJh9aPwVJ6SKg62PxqlZaHI8hQAXw==} + engines: {node: '>=22.12.0'} - '@commitlint/top-level@8.3.6': - resolution: {integrity: sha512-2XG5NhGgEZaFJChCkSTa6wXWYbJqb9DubC6aRuD/cOeHdYh2OYrXT8z0IorN+gR5+MWqdUtIHhRYtz2Xb75gNg==} - engines: {node: '>=4'} + '@commitlint/top-level@21.2.0': + resolution: {integrity: sha512-Y5gmQ+KxzqCrBFJfLvFEPvvwD3LDiNZoTT2yeFBm96M8qhmqSzQc5DvX3rheAaAMjyIvMXOCLS/mWfdpONsjyQ==} + engines: {node: '>=22.12.0'} '@commitlint/types@19.5.0': resolution: {integrity: sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg==} engines: {node: '>=v18'} - '@csstools/css-parser-algorithms@2.7.1': - resolution: {integrity: sha512-2SJS42gxmACHgikc1WGesXLIT8d/q2l0UFM7TaEeIzdFCE/FPMtTiizcPGGJtlPo2xuQzY09OhrLTzRxqJqwGw==} - engines: {node: ^14 || ^16 || >=18} + '@commitlint/types@21.2.3': + resolution: {integrity: sha512-sGEA473TlCvhCGNoTBY9OXZVWdscIXdGt0dm8EpB+2MRfmt8LNh/X56P/T3nCtEB+eH5qGEa3odphSAoUxSfSQ==} + engines: {node: '>=22.12.0'} + + '@conventional-changelog/git-client@3.2.0': + resolution: {integrity: sha512-sD/E0vzpkoDz/dqM1Hhv0ihC4KBw6RXjefeO8SG1XrX+wGkMxe1pKeedkKDPCtr2JjuhbuS9aJNgOvnT8hbeBw==} + engines: {node: '>=22'} + peerDependencies: + conventional-commits-filter: ^6.0.1 + conventional-commits-parser: ^7.1.3 + peerDependenciesMeta: + conventional-commits-filter: + optional: true + conventional-commits-parser: + optional: true + + '@conventional-changelog/template@1.4.0': + resolution: {integrity: sha512-aalGyl7dbB5PArRebDIX43ZvBlXrYm9uWzGJ26t+4SzJVPsOuvfILGGbw5X4yX7i50YEmJ8zvbiWnqH/AAnZqg==} + engines: {node: '>=22'} + + '@csstools/css-calc@3.4.3': + resolution: {integrity: sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 + + '@csstools/css-parser-algorithms@4.0.2': + resolution: {integrity: sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-tokenizer': ^4.0.2 + + '@csstools/css-syntax-patches-for-csstree@1.1.15': + resolution: {integrity: sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==} peerDependencies: - '@csstools/css-tokenizer': ^2.4.1 + css-tree: ^3.2.1 + peerDependenciesMeta: + css-tree: + optional: true + + '@csstools/css-tokenizer@4.0.2': + resolution: {integrity: sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==} + engines: {node: '>=20.19.0'} - '@csstools/css-tokenizer@2.4.1': - resolution: {integrity: sha512-eQ9DIktFJBhGjioABJRtUucoWR2mwllurfnM8LuNGAqX3ViZXaUchqk+1s7jjtkFiT9ySdACsFEA3etErkALUg==} - engines: {node: ^14 || ^16 || >=18} + '@csstools/media-query-list-parser@5.0.2': + resolution: {integrity: sha512-qx19O8AbbLLbDSAcI6YOby/Vq8rV51psgIvlF5OZT/L8fQJDCyQifL6k+kYU4a8ySpzJ4RBzZkIs530bAn8y4Q==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 - '@csstools/media-query-list-parser@2.1.13': - resolution: {integrity: sha512-XaHr+16KRU9Gf8XLi3q8kDlI18d5vzKSKCY510Vrtc9iNR0NJzbY9hhTmwhzYZj/ZwGL4VmB3TA9hJW0Um2qFA==} - engines: {node: ^14 || ^16 || >=18} + '@csstools/selector-resolve-nested@4.0.2': + resolution: {integrity: sha512-JpjNBJFA+4OnAHKRK4AMp8xrYyLhI9XapOeBlP2PhRU/IylSw+1ep3BFNTksBJnrTS3KT6kqKNVfpzLLwZUW5Q==} + engines: {node: '>=20.19.0'} peerDependencies: - '@csstools/css-parser-algorithms': ^2.7.1 - '@csstools/css-tokenizer': ^2.4.1 + postcss-selector-parser: ^7.1.1 - '@csstools/selector-specificity@3.1.1': - resolution: {integrity: sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==} - engines: {node: ^14 || ^16 || >=18} + '@csstools/selector-specificity@6.0.1': + resolution: {integrity: sha512-MBuqFIIvqk4S593MGAskTkPpEUUzZNvGzh8mMxEwl3oHwjQlXmqHEDxNbN3Y0Tsh+xjmem4GZjeg7I0qkwBivg==} + engines: {node: '>=20.19.0'} peerDependencies: - postcss-selector-parser: ^6.0.13 + postcss-selector-parser: ^7.1.1 '@esbuild/aix-ppc64@0.25.2': resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==} @@ -628,32 +634,68 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.10.1': + resolution: {integrity: sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@0.4.3': - resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} - engines: {node: ^10.12.0 || >=12.0.0} + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/config-helpers@0.7.0': + resolution: {integrity: sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/js@10.0.1': + resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: ^10.0.0 + peerDependenciesMeta: + eslint: + optional: true + + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + '@eslint/plugin-kit@0.7.3': + resolution: {integrity: sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@humanwhocodes/config-array@0.5.0': - resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead + '@humanfs/core@0.19.2': + resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.8': + resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} + engines: {node: '>=18.18.0'} + + '@humanfs/types@0.15.0': + resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} + engines: {node: '>=18.18.0'} - '@humanwhocodes/object-schema@1.2.1': - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} - deprecated: Use @eslint/object-schema instead + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} '@hutson/parse-repository-url@3.0.2': resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} @@ -691,8 +733,14 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@marionebl/sander@0.6.1': - resolution: {integrity: sha512-7f3zZddAk92G1opoX/glbDO6YbrzmMAJAw0RJAcvunnV7sR4L9llyBUAABptKoF1Jf37UQ1QTJy5p2H4J4rBNA==} + '@keyv/bigmap@1.3.1': + resolution: {integrity: sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==} + engines: {node: '>= 18'} + peerDependencies: + keyv: ^5.6.0 + + '@keyv/serialize@1.1.1': + resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==} '@material/material-color-utilities@0.1.2': resolution: {integrity: sha512-uKkkx7Xo1AZJR0eMjH902rAb0vEjDbb3tgXt0cC3SHbpDGkPNhkuDKtxnw147axOM6uKuI7vywHRQlDrjDGhCA==} @@ -863,8 +911,17 @@ packages: cpu: [x64] os: [win32] - '@rtsao/scc@1.1.0': - resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@simple-libs/child-process-utils@2.0.0': + resolution: {integrity: sha512-dvNoRKLijXnD0XoJAz94pbNuB5GQgDr55UhpSPhffDkTT0Cmcqh9jSCOtwfT2d4H6MI9E7c4SgtMuJXZ6F3c6A==} + engines: {node: '>=22'} + + '@simple-libs/stream-utils@2.0.0': + resolution: {integrity: sha512-fCTuZK4QBa+39Oz9l4OGfJfz+GpwCp3AqO7Zch3to99xHPgstVsRFpeQ8LNd2o1Gv8raL2mCFwiaHh7bFSp5DQ==} + engines: {node: '>=22'} + + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} '@tootallnate/once@1.1.2': resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} @@ -880,21 +937,27 @@ packages: '@types/conventional-commits-parser@5.0.0': resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} + '@types/css-tree@3.2.0': + resolution: {integrity: sha512-J5KXmk6BFIepOT7280FdFyNs4c5fh0Uee0otjKEvzchrRs38Ii9qminqc4ds0L19X8Zd/rT+brR9jkBthygjWw==} + '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + '@types/estree@1.0.7': resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/fs-extra@9.0.13': resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/json5@0.0.29': - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/linkify-it@5.0.0': resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} @@ -928,9 +991,6 @@ packages: '@types/qrcode@1.5.6': resolution: {integrity: sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/sortablejs@1.15.9': resolution: {integrity: sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==} @@ -940,63 +1000,64 @@ packages: '@types/validator@13.15.10': resolution: {integrity: sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==} - '@typescript-eslint/eslint-plugin@5.62.0': - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/eslint-plugin@8.72.0': + resolution: {integrity: sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/parser': ^8.72.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@5.62.0': - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/parser@8.72.0': + resolution: {integrity: sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/scope-manager@5.62.0': - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/project-service@8.72.0': + resolution: {integrity: sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@5.62.0': - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/scope-manager@8.72.0': + resolution: {integrity: sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.72.0': + resolution: {integrity: sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/types@5.62.0': - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/type-utils@8.72.0': + resolution: {integrity: sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/typescript-estree@5.62.0': - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/types@8.72.0': + resolution: {integrity: sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.72.0': + resolution: {integrity: sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/utils@8.72.0': + resolution: {integrity: sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/visitor-keys@5.62.0': - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/visitor-keys@8.72.0': + resolution: {integrity: sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitejs/plugin-vue@5.2.4': resolution: {integrity: sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==} @@ -1137,11 +1198,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - acorn@8.18.0: - resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.19.0: resolution: {integrity: sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==} engines: {node: '>=0.4.0'} @@ -1154,8 +1210,8 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + ajv@6.15.0: + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} @@ -1166,18 +1222,10 @@ packages: alien-signals@3.2.1: resolution: {integrity: sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==} - ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} - ansi-escapes@7.3.0: - resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} - engines: {node: '>=18'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1198,6 +1246,10 @@ packages: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} + ansi-styles@7.0.0: + resolution: {integrity: sha512-kKvt3m4uwzqL0wlkPd09CmljPJGOZZ4D0fP65sqFSvPkMRKhNi+74MgIJ5QxE6SxqB4t4KyUFGg8+n5zjo6hew==} + engines: {node: '>=22'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -1208,6 +1260,10 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + argue-cli@3.2.0: + resolution: {integrity: sha512-VipTB0gXgGIFO2Rg9yEVN5wLt2AurJcZqDbgmYSwPwsykhLrQhs240/bfceev4w68lI8JshoOJIk9uW7tFzROw==} + engines: {node: '>=22'} + array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} engines: {node: '>= 0.4'} @@ -1219,26 +1275,6 @@ packages: array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} - array-includes@3.1.8: - resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} - engines: {node: '>= 0.4'} - - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - - array.prototype.findlastindex@1.2.5: - resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} - engines: {node: '>= 0.4'} - - array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} - engines: {node: '>= 0.4'} - - array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - arraybuffer.prototype.slice@1.0.3: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} engines: {node: '>= 0.4'} @@ -1276,18 +1312,9 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - babel-polyfill@6.26.0: - resolution: {integrity: sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==} - - babel-runtime@6.26.0: - resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - balanced-match@2.0.0: - resolution: {integrity: sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==} - balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} @@ -1339,6 +1366,9 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + cacheable@2.5.0: + resolution: {integrity: sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==} + cachedir@2.3.0: resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} engines: {node: '>=6'} @@ -1351,18 +1381,6 @@ packages: resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} engines: {node: '>= 0.4'} - caller-callsite@2.0.0: - resolution: {integrity: sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==} - engines: {node: '>=4'} - - caller-path@2.0.0: - resolution: {integrity: sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==} - engines: {node: '>=4'} - - callsites@2.0.0: - resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} - engines: {node: '>=4'} - callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1375,10 +1393,6 @@ packages: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} - camelcase-keys@7.0.2: - resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==} - engines: {node: '>=12'} - camelcase@4.1.0: resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==} engines: {node: '>=4'} @@ -1387,10 +1401,6 @@ packages: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} - camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} @@ -1430,18 +1440,10 @@ packages: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} - cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} - cli-truncate@5.2.0: - resolution: {integrity: sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==} - engines: {node: '>=20'} - cli-width@3.0.0: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} @@ -1452,6 +1454,10 @@ packages: cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@9.0.1: + resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} + engines: {node: '>=20'} + clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} @@ -1469,12 +1475,12 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + colord@2.10.0: + resolution: {integrity: sha512-AidJptpBJmjTclAp9BkLwJi0T93fo5epJnbaZslpg6QVzpHjAiveF55mE9AcUJiGMqRHgMDY8soMsQtuNYMHfw==} + colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -1511,13 +1517,14 @@ packages: config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - conventional-changelog-angular@1.6.6: - resolution: {integrity: sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==} - conventional-changelog-angular@5.0.13: resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==} engines: {node: '>=10'} + conventional-changelog-angular@9.4.0: + resolution: {integrity: sha512-HdxRxuS8bBXVIuo4V82gvSwAXT0vYQUizrjs/izmPg5JdDstr8v8I5hduGL3iQbG+o310dUDxC4+LetuS5hu9w==} + engines: {node: '>=22'} + conventional-changelog-atom@2.0.8: resolution: {integrity: sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==} engines: {node: '>=10'} @@ -1531,9 +1538,9 @@ packages: conventional-changelog-config-spec@2.1.0: resolution: {integrity: sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ==} - conventional-changelog-conventionalcommits@4.2.1: - resolution: {integrity: sha512-vC02KucnkNNap+foDKFm7BVUSDAXktXrUJqGszUuYnt6T0J2azsbYz/w9TDc3VsrW2v6JOtiQWVcgZnporHr4Q==} - engines: {node: '>=6.9.0'} + conventional-changelog-conventionalcommits@10.4.1: + resolution: {integrity: sha512-jS1LRFSbRoAr6JbhhRy1JYfNNUj5LM3+v49hRE03CgccsiYqgdVj/RTmrw4J1rylrqijHwdOlJWiJa61JHOgHg==} + engines: {node: '>=22'} conventional-changelog-conventionalcommits@4.2.3: resolution: {integrity: sha512-atGa+R4vvEhb8N/8v3IoW59gCBJeeFiX6uIbPu876ENAmkMwsenyn0R21kdDHJFLQdy6zW4J6b4xN8KI3b9oww==} @@ -1594,6 +1601,11 @@ packages: engines: {node: '>=10'} hasBin: true + conventional-commits-parser@7.1.3: + resolution: {integrity: sha512-Q9oWm1o9uy/oEsZQIraoFMZ4RuPD+79KgwWj6mJVP356tazolCB0piRLZ5Kz9te9p027uSEcUW+Gu44Eh+X79g==} + engines: {node: '>=22'} + hasBin: true + conventional-recommended-bump@6.0.5: resolution: {integrity: sha512-srkferrB4kACPEbKYltZwX1CQZAEqbQkabKN444mavLRVMetzwJFJf23/+pwvtMsWbd+cc4HaleV1nHke0f8Rw==} engines: {node: '>=6.9.0'} @@ -1609,10 +1621,6 @@ packages: core-js-pure@3.38.1: resolution: {integrity: sha512-BY8Etc1FZqdw1glX0XNOq2FDwfrg/VGqoZOZCdaL+UmdaqDwQwYXkMJT4t6In+zfEfOJDcM9T0KdbBeJg8KKCQ==} - core-js@2.6.12: - resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. - core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -1624,12 +1632,8 @@ packages: cosmiconfig: '>=8.2' typescript: '>=4' - cosmiconfig@5.2.1: - resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} - engines: {node: '>=4'} - - cosmiconfig@8.3.6: - resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} + cosmiconfig@9.0.0: + resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: typescript: '>=4.9.5' @@ -1637,8 +1641,8 @@ packages: typescript: optional: true - cosmiconfig@9.0.0: - resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} + cosmiconfig@9.0.2: + resolution: {integrity: sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==} engines: {node: '>=14'} peerDependencies: typescript: '>=4.9.5' @@ -1659,15 +1663,19 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + css-declaration-sorter@6.4.1: resolution: {integrity: sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==} engines: {node: ^10 || ^12 || >=14} peerDependencies: postcss: ^8.0.9 - css-functions-list@3.2.2: - resolution: {integrity: sha512-c+N0v6wbKVxTu5gOBBFkr9BEdBWaqqjQeiJ8QvSRIJOf+UxlJh930m8e6/WNeODIK0mYLFkoONrnj16i2EcvfQ==} - engines: {node: '>=12 || >=16'} + css-functions-list@3.3.3: + resolution: {integrity: sha512-8HFEBPKhOpJPEPu70wJJetjKta86Gw9+CCyCnB3sui2qQfOvRyqBy4IKLKKAwdMpWb2lHXWk9Wb4Z6AmaUT1Pg==} + engines: {node: '>=12'} css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} @@ -1676,8 +1684,8 @@ packages: resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} engines: {node: '>=8.0.0'} - css-tree@2.3.1: - resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} + css-tree@3.2.1: + resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} css-what@6.1.0: @@ -1811,10 +1819,6 @@ packages: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - decamelize@5.0.1: - resolution: {integrity: sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==} - engines: {node: '>=10'} - decimal.js@10.6.0: resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} @@ -1864,18 +1868,6 @@ packages: dijkstrajs@1.0.3: resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - - doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} - - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dom-serializer@1.4.1: resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} @@ -1934,10 +1926,6 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enquirer@2.4.1: - resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} - engines: {node: '>=8.6'} - entities@2.1.0: resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==} @@ -1956,10 +1944,6 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} - environment@1.1.0: - resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} - engines: {node: '>=18'} - errno@0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true @@ -2002,13 +1986,13 @@ packages: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} - es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - es-to-primitive@1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} + es-toolkit@1.52.0: + resolution: {integrity: sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==} + esbuild@0.25.2: resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==} engines: {node: '>=18'} @@ -2034,141 +2018,51 @@ packages: engines: {node: '>=6.0'} hasBin: true - eslint-config-prettier@9.1.0: - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + eslint-config-prettier@10.1.8: + resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} hasBin: true peerDependencies: eslint: '>=7.0.0' - eslint-config-standard@16.0.3: - resolution: {integrity: sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==} - peerDependencies: - eslint: ^7.12.1 - eslint-plugin-import: ^2.22.1 - eslint-plugin-node: ^11.1.0 - eslint-plugin-promise: ^4.2.1 || ^5.0.0 - - eslint-import-resolver-node@0.3.9: - resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - - eslint-module-utils@2.11.0: - resolution: {integrity: sha512-gbBE5Hitek/oG6MUVj6sFuzEjA/ClzNflVrLovHi/JgLdC7fiN5gLAY1WIPW1a0V5I999MnsrvVrCOGmmVqDBQ==} - engines: {node: '>=4'} + eslint-plugin-vue@10.11.1: + resolution: {integrity: sha512-pasVXhl7wUmIvhujoqs/m0mJ9r59QW1IR9XXYKGR0FETzSM+Hhlf4qKIYgWiDDP+9YKv4YfbwskD7LqIdVcgQw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' + '@stylistic/eslint-plugin': ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + '@typescript-eslint/parser': ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + vue-eslint-parser: ^10.3.0 peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: + '@stylistic/eslint-plugin': optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true - - eslint-plugin-es@3.0.1: - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} - peerDependencies: - eslint: '>=4.19.1' - - eslint-plugin-html@7.1.0: - resolution: {integrity: sha512-fNLRraV/e6j8e3XYOC9xgND4j+U7b1Rq+OygMlLcMg+wI/IpVbF+ubQa3R78EjKB9njT6TQOlcK5rFKBVVtdfg==} - - eslint-plugin-import@2.30.0: - resolution: {integrity: sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: '@typescript-eslint/parser': optional: true - eslint-plugin-node@11.1.0: - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} - peerDependencies: - eslint: '>=5.16.0' - - eslint-plugin-prettier@4.2.1: - resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} - engines: {node: '>=12.0.0'} - peerDependencies: - eslint: '>=7.28.0' - eslint-config-prettier: '*' - prettier: '>=2.0.0' - peerDependenciesMeta: - eslint-config-prettier: - optional: true - - eslint-plugin-promise@5.2.0: - resolution: {integrity: sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw==} - engines: {node: ^10.12.0 || >=12.0.0} - peerDependencies: - eslint: ^7.0.0 - - eslint-plugin-vue@8.7.1: - resolution: {integrity: sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 - - eslint-plugin-vue@9.33.0: - resolution: {integrity: sha512-174lJKuNsuDIlLpjeXc5E2Tss8P44uIimAfGD0b90k0NoirJqpG7stLuU9Vp/9ioTOrQdWVREc4mRd1BD+CvGw==} - engines: {node: ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 - - eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - - eslint-utils@3.0.0: - resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} - engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} - peerDependencies: - eslint: '>=5' - - eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - - eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@7.32.0: - resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} - engines: {node: ^10.12.0 || >=12.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. - hasBin: true + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - espree@7.3.1: - resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} - engines: {node: ^10.12.0 || >=12.0.0} + eslint@10.13.0: + resolution: {integrity: sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -2179,14 +2073,14 @@ packages: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -2201,9 +2095,6 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - eventemitter3@5.0.4: - resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} - expand-tilde@2.0.2: resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} engines: {node: '>=0.10.0'} @@ -2223,11 +2114,8 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - - fast-glob@3.3.2: - resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} fast-json-stable-stringify@2.1.0: @@ -2271,13 +2159,8 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - - file-entry-cache@7.0.2: - resolution: {integrity: sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==} - engines: {node: '>=12.0.0'} + file-entry-cache@11.1.5: + resolution: {integrity: sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==} fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} @@ -2309,12 +2192,11 @@ packages: resolution: {integrity: sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==} engines: {node: '>= 8'} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@6.1.23: + resolution: {integrity: sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==} - flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flatted@3.4.4: + resolution: {integrity: sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==} for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -2353,9 +2235,6 @@ packages: resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} engines: {node: '>= 0.4'} - functional-red-black-tree@1.0.1: - resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} - functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} @@ -2384,10 +2263,6 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - get-stdin@7.0.0: - resolution: {integrity: sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==} - engines: {node: '>=8'} - get-symbol-description@1.0.2: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} @@ -2430,6 +2305,10 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + glob@13.0.6: resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} engines: {node: 18 || 20 || >=22} @@ -2442,9 +2321,9 @@ packages: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} engines: {node: '>=18'} - global-dirs@0.1.1: - resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} - engines: {node: '>=4'} + global-directory@5.0.0: + resolution: {integrity: sha512-1pgFdhK3J2LeM+dVf2Pd424yHx2ou338lC0ErNP2hPx4j8eW1Sp0XqSjNxtk6Tc4Kr5wlWtSvz8cn2yb7/SG/w==} + engines: {node: '>=20'} global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} @@ -2462,17 +2341,17 @@ packages: resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} engines: {node: '>=6'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + globals@17.13.0: + resolution: {integrity: sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==} + engines: {node: '>=18'} globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} + globby@16.2.4: + resolution: {integrity: sha512-c8B/VNLmxRcmqqenRA9t+9IyOjf9+V6lTxPaUJLqOCONdQkWZ0ETYgX0qbtJqPsgCNusT9MZ5Jeidw8Eb9tn2g==} + engines: {node: '>=20'} globjoin@0.1.4: resolution: {integrity: sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==} @@ -2487,9 +2366,6 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - gray-matter@4.0.3: resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} engines: {node: '>=6.0'} @@ -2521,6 +2397,10 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-flag@5.0.1: + resolution: {integrity: sha512-CsNUt5x9LUdx6hnk/E2SZLsDyvfqANZSUq4+D3D8RzDJ2M+HDTIkF60ibS1vHaK55vzgiZw1bEPFG9yH7l33wA==} + engines: {node: '>=12'} + has-property-descriptors@1.0.2: resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} @@ -2540,6 +2420,10 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + hashery@1.5.1: + resolution: {integrity: sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==} + engines: {node: '>=20'} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -2556,6 +2440,12 @@ packages: resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} engines: {node: '>=0.10.0'} + hookified@1.15.1: + resolution: {integrity: sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==} + + hookified@2.2.0: + resolution: {integrity: sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==} + hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -2567,12 +2457,12 @@ packages: resolution: {integrity: sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==} engines: {node: '>=10'} - html-tags@3.3.1: - resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} - engines: {node: '>=8'} + html-tags@5.1.0: + resolution: {integrity: sha512-n6l5uca7/y5joxZ3LUePhzmBFUJ+U2YWzhMa8XUTecSeSlQiZdF5XAd/Q3/WUl0VsXgUwWi8I7CNIwdI5WN1SQ==} + engines: {node: '>=20.10'} - htmlparser2@8.0.2: - resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} + htmlparser2@9.1.0: + resolution: {integrity: sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==} http-proxy-agent@4.0.1: resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} @@ -2582,9 +2472,9 @@ packages: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} - husky@8.0.3: - resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} - engines: {node: '>=14'} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} hasBin: true hybrids@9.1.23: @@ -2606,34 +2496,29 @@ packages: ignore-by-default@1.0.1: resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==} - ignore@4.0.6: - resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} - engines: {node: '>= 4'} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} + ignore@7.0.13: + resolution: {integrity: sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==} + engines: {node: '>= 4'} + image-size@0.5.5: resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==} engines: {node: '>=0.10.0'} hasBin: true - import-fresh@2.0.0: - resolution: {integrity: sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==} - engines: {node: '>=4'} - import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - import-lazy@4.0.0: - resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} - engines: {node: '>=8'} - import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} + import-meta-resolve@4.2.0: + resolution: {integrity: sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==} + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2646,10 +2531,6 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -2664,6 +2545,10 @@ packages: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ini@6.0.0: + resolution: {integrity: sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==} + engines: {node: ^20.17.0 || >=22.9.0} + inquirer@8.2.5: resolution: {integrity: sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==} engines: {node: '>=12.0.0'} @@ -2706,10 +2591,6 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} - is-directory@0.3.1: - resolution: {integrity: sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==} - engines: {node: '>=0.10.0'} - is-extendable@0.1.1: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -2722,10 +2603,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@5.1.0: - resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} - engines: {node: '>=18'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2754,13 +2631,17 @@ packages: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} + is-path-inside@4.0.0: + resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} + engines: {node: '>=12'} + is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} @@ -2819,10 +2700,18 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + isexe@4.0.0: + resolution: {integrity: sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==} + engines: {node: '>=20'} + jiti@1.21.6: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jiti@2.7.0: + resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} + hasBin: true + js-beautify@2.0.3: resolution: {integrity: sha512-cyFbh3tkPhknnTD/0bLf0T0yy2ZIbqL05mttzbt4y1Zfr7NxqXQZ62dkBLKs3oHH/lpjmDRAnciJiSUyOy8XwQ==} engines: {node: '>=14'} @@ -2837,6 +2726,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -2854,15 +2746,16 @@ packages: canvas: optional: true - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + json-parse-even-better-errors@6.0.0: + resolution: {integrity: sha512-2/8adwnK1/+Fdjyts4r6wSpfANWw8zdNhU9U/Llk59c6O+DjSisPWPykwoL8gZmocP9Dy64S7oie2g+Mia123A==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -2875,10 +2768,6 @@ packages: json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -2886,16 +2775,13 @@ packages: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + keyv@5.6.0: + resolution: {integrity: sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==} kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} - known-css-properties@0.29.0: - resolution: {integrity: sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==} - less@4.2.0: resolution: {integrity: sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==} engines: {node: '>=6'} @@ -2920,15 +2806,11 @@ packages: linkify-it@3.0.3: resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} - lint-staged@16.4.0: - resolution: {integrity: sha512-lBWt8hujh/Cjysw5GYVmZpFHXDCgZzhrOm8vbcUdobADZNOK/bRshr2kM3DfgrrtR1DQhfupW9gnIXOfiFi+bw==} - engines: {node: '>=20.17'} + lint-staged@17.6.0: + resolution: {integrity: sha512-nOhBfYkZEwkFtNzD5pK9s9LkcWoxJ+whLzEnhqi9nl7zTB5n7tg8+9iYgMGx2Wm3VlLu8cbNj0RACzY+nWi5iQ==} + engines: {node: '>=22.22.1'} hasBin: true - listr2@9.0.5: - resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} - engines: {node: '>=20.0.0'} - load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -2996,10 +2878,6 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} - log-update@6.1.0: - resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} - engines: {node: '>=18'} - longest@2.0.1: resolution: {integrity: sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==} engines: {node: '>=0.10.0'} @@ -3080,14 +2958,14 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - mathml-tag-names@2.1.3: - resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==} + mathml-tag-names@4.0.0: + resolution: {integrity: sha512-aa6AU2Pcx0VP/XWnh8IGL0SYSgQHDT6Ucror2j2mXeFAlN3ahaNs8EZtG1YiticMkSLj3Gt6VPFfZogt7G5iFQ==} mdn-data@2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} - mdn-data@2.0.30: - resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + mdn-data@2.27.1: + resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} @@ -3096,9 +2974,9 @@ packages: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} - meow@10.1.5: - resolution: {integrity: sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + meow@14.1.0: + resolution: {integrity: sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw==} + engines: {node: '>=20'} meow@4.0.1: resolution: {integrity: sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==} @@ -3140,10 +3018,6 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -3180,10 +3054,6 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - mkdirp@0.5.6: - resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true - modify-values@1.0.1: resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} engines: {node: '>=0.10.0'} @@ -3215,9 +3085,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -3269,6 +3136,15 @@ packages: resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} engines: {node: '>=10'} + npm-normalize-package-bin@6.0.0: + resolution: {integrity: sha512-tdt4aFn9QamlhdN3HV2D2ccpBwO5/fyjjbXUxYA6uBjyekMZcZvDq0aSj9t5Jo+tih6AYFnt/cuIRn9013e0Uw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + npm-run-all2@9.0.3: + resolution: {integrity: sha512-BQAEdU1PtYc48qYRdghW2BVTQT3VqWCoFQmO87NlM1h1PYwMCKQpUWaNyB20V26caNzFsXQDfyOdznLlHCih6g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0, npm: '>= 10'} + hasBin: true + npm-run-all@4.1.5: resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==} engines: {node: '>= 4'} @@ -3303,18 +3179,6 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} - object.fromentries@2.0.8: - resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} - engines: {node: '>= 0.4'} - - object.groupby@1.0.3: - resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} - engines: {node: '>= 0.4'} - - object.values@1.2.0: - resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} - engines: {node: '>= 0.4'} - obug@2.2.1: resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} engines: {node: '>=12.20.0'} @@ -3326,10 +3190,6 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -3378,6 +3238,9 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -3435,10 +3298,6 @@ packages: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} @@ -3462,6 +3321,11 @@ packages: engines: {node: '>=0.10'} hasBin: true + pidtree@1.0.0: + resolution: {integrity: sha512-avfAvjB9Dd0wdj3rjJX//yS+G79OO0KrS5pJHFJENjYGX6N4SMgEDBBI/yFy0lloOYSaC6XQxzpOAMPfSYFV/Q==} + engines: {node: '>=18'} + hasBin: true + pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -3523,6 +3387,12 @@ packages: peerDependencies: postcss: ^8.2.15 + postcss-html@2.0.0: + resolution: {integrity: sha512-f2Rvw5FCollEfVj3wfN7JdQb7n2rNIthW+epw2EByio7M6P7RH0BTj8a/ODHrUXd0cmO7ychb6YniymV93182Q==} + engines: {node: ^22.12 || >=24} + peerDependencies: + postcss: ^8.5.0 + postcss-less@6.0.0: resolution: {integrity: sha512-FPX16mQLyEjLzEuuJtxA8X3ejDLNGGEG503d2YGZR5Ask1SpDN8KmZUMpzCvyalWRywAn1n1VOA5dcqfCLo5rg==} engines: {node: '>=12'} @@ -3637,19 +3507,20 @@ packages: peerDependencies: postcss: ^8.2.15 - postcss-resolve-nested-selector@0.1.6: - resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==} - - postcss-safe-parser@6.0.0: - resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} - engines: {node: '>=12.0'} + postcss-safe-parser@7.1.0: + resolution: {integrity: sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg==} + engines: {node: '>=18.0'} peerDependencies: - postcss: ^8.3.3 + postcss: ^8.4.31 postcss-selector-parser@6.1.2: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} + postcss-selector-parser@7.1.6: + resolution: {integrity: sha512-7qASPzhKF2l2KLboRZux8CCTRMdGiV08vWmyKzPz22qZ7ZjQBOeY7rNzNoCLSUiftJ7HUq0GERHmxw/t0dCdMw==} + engines: {node: '>=4'} + postcss-svgo@5.1.0: resolution: {integrity: sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==} engines: {node: ^10 || ^12 || >=14.0} @@ -3681,13 +3552,9 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier-linter-helpers@1.0.0: - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} - engines: {node: '>=6.0.0'} - - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + prettier@3.9.10: + resolution: {integrity: sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==} + engines: {node: '>=14'} hasBin: true prismjs@1.29.0: @@ -3700,10 +3567,6 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - progress@2.0.3: - resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} - engines: {node: '>=0.4.0'} - proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} @@ -3728,6 +3591,10 @@ packages: (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) + qified@0.10.1: + resolution: {integrity: sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==} + engines: {node: '>=20'} + qrcode@1.5.4: resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} engines: {node: '>=10.13.0'} @@ -3747,9 +3614,9 @@ packages: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} - quick-lru@5.1.1: - resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} - engines: {node: '>=10'} + read-package-json-fast@6.0.0: + resolution: {integrity: sha512-PNaGjoCnw9DBA2Kl8D+8po957z778q/HOPuY2u3Bkw/JO3eC8MDx7jn/PgMtSgpcBbs+6UOjDbwReGpXmRvs0g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} read-pkg-up@3.0.0: resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==} @@ -3759,10 +3626,6 @@ packages: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} - read-pkg-up@8.0.0: - resolution: {integrity: sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==} - engines: {node: '>=12'} - read-pkg@3.0.0: resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} engines: {node: '>=4'} @@ -3771,10 +3634,6 @@ packages: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} - read-pkg@6.0.0: - resolution: {integrity: sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==} - engines: {node: '>=12'} - readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -3794,16 +3653,6 @@ packages: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} - redent@4.0.0: - resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==} - engines: {node: '>=12'} - - regenerator-runtime@0.10.5: - resolution: {integrity: sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==} - - regenerator-runtime@0.11.1: - resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} - regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} @@ -3811,10 +3660,6 @@ packages: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} - regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -3833,10 +3678,6 @@ packages: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} - resolve-from@3.0.0: - resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} - engines: {node: '>=4'} - resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -3845,10 +3686,6 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - resolve-global@1.0.0: - resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} - engines: {node: '>=8'} - resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} @@ -3860,25 +3697,13 @@ packages: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} - restore-cursor@5.1.0: - resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} - engines: {node: '>=18'} - reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rfdc@1.4.1: - resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - - rimraf@2.7.1: - resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true - - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported + rimraf@6.1.3: + resolution: {integrity: sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==} + engines: {node: 20 || >=22} hasBin: true rollup@4.40.0: @@ -3973,6 +3798,10 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + shell-quote@1.12.0: + resolution: {integrity: sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==} + engines: {node: '>= 0.4'} + shell-quote@1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} @@ -3991,22 +3820,14 @@ packages: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} + slash@5.1.0: + resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} + engines: {node: '>=14.16'} slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} - slice-ansi@7.1.2: - resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} - engines: {node: '>=18'} - - slice-ansi@8.0.0: - resolution: {integrity: sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==} - engines: {node: '>=20'} - sortablejs@1.15.7: resolution: {integrity: sha512-Kk8wLQPlS+yi1ZEf48a4+fzHa4yxjC30M/Sr2AnQu+f/MPwvvX9XjZ6OWejiz8crBsLwSq8GHqaxaET7u6ux0A==} @@ -4130,64 +3951,61 @@ packages: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} - strip-indent@4.0.0: - resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} - engines: {node: '>=12'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - style-search@0.1.0: - resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==} - stylehacks@5.1.1: resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} engines: {node: ^10 || ^12 || >=14.0} peerDependencies: postcss: ^8.2.15 - stylelint-config-recommended-less@2.0.0: - resolution: {integrity: sha512-6X5A9kdusuLzS/9yfkQfzYg5ry43KHXMnUmiPCIidwQEW/cegn44CtRPfN+9SLcVkUVcRNpuLYfHtbLtoUHgkA==} + stylelint-config-recommended-less@4.2.1: + resolution: {integrity: sha512-OYq8xWTMoXFyZ91vzYDGpkgWafSkSXxXV0b1tVZRGwOpbfb+6SeN+KnFa/LivoRBzfAGMmr3OVQX2h/ArG8WNg==} peerDependencies: - postcss: ^8.3.3 - stylelint: ^15.10.2 + postcss: '*' + stylelint: ^17 peerDependenciesMeta: postcss: optional: true - stylelint-config-recommended@13.0.0: - resolution: {integrity: sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==} - engines: {node: ^14.13.1 || >=16.0.0} + stylelint-config-recommended@18.0.0: + resolution: {integrity: sha512-mxgT2XY6YZ3HWWe3Di8umG6aBmWmHTblTgu/f10rqFXnyWxjKWwNdjSWkgkwCtxIKnqjSJzvFmPT5yabVIRxZg==} + engines: {node: '>=20.19.0'} peerDependencies: - stylelint: ^15.10.0 + stylelint: ^17.0.0 - stylelint-config-standard-less@2.0.0: - resolution: {integrity: sha512-hLrK5oNV2Ombs0IC11gzGsYtADX8dquevs+Ls2jY4IY2wywPLnUSW5a5ofxXVan1j1z6OMcs8fWikbpj9Y5VgQ==} + stylelint-config-standard-less@4.1.0: + resolution: {integrity: sha512-20Ol4m1rTescEkkoNO9+AyAF/P0LsFfZ+B2pkHlL/efEBfr1FAOGuOlZO8no32KE/63S915O1W5kQoA9S9kZCg==} peerDependencies: - postcss: ^8.3.3 - stylelint: ^15.0.0 + postcss: ^8 + stylelint: ^17 peerDependenciesMeta: postcss: optional: true - stylelint-config-standard@34.0.0: - resolution: {integrity: sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==} - engines: {node: ^14.13.1 || >=16.0.0} + stylelint-config-standard@40.0.0: + resolution: {integrity: sha512-EznGJxOUhtWck2r6dJpbgAdPATIzvpLdK9+i5qPd4Lx70es66TkBPljSg4wN3Qnc6c4h2n+WbUrUynQ3fanjHw==} + engines: {node: '>=20.19.0'} peerDependencies: - stylelint: ^15.10.0 + stylelint: ^17.0.0 - stylelint-less@2.0.0: - resolution: {integrity: sha512-HwRdAdrNDBg64BzIOP3SSHFPJHvRJEpqFn8Kp5m5Enw6pf7kI9XoNT3jn1S2zvfzaK/7hdwy6La3cyJT78fK3A==} + stylelint-less@4.2.2: + resolution: {integrity: sha512-UmuA5cLcMAi3BZ0kd8VrbOUov6QFyHe8Y9i+sA7uiqvOEioD5KVfQT1AafJ2TjA0r2wocScbtTBbDDYUAxaQxg==} peerDependencies: - postcss: ^8.4.14 - stylelint: ^15.10.3 + postcss: ^8 + stylelint: ^17 - stylelint@15.11.0: - resolution: {integrity: sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw==} - engines: {node: ^14.13.1 || >=16.0.0} + stylelint@17.16.0: + resolution: {integrity: sha512-ejlWnbJ13x1GU32+zZXa6sYQJsKKkwSdv2B4rAdO3OWdEmvhSJKcXi5pOphQYSzyaj1kXpuGJr7pcMBNfDIuPw==} + engines: {node: '>=20.19.0'} hasBin: true + supports-color@10.2.2: + resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} + engines: {node: '>=18'} + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -4196,9 +4014,9 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} - supports-hyperlinks@3.1.0: - resolution: {integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==} - engines: {node: '>=14.18'} + supports-hyperlinks@4.6.0: + resolution: {integrity: sha512-FL/q/YePS4tFFTNiBOR+zPk2ZrKheqNtmTJ/9OUZ4e1wKHJofDbGQSmSsxS0XNnabSkqexryCaXGvEKz1vf9UQ==} + engines: {node: '>=20'} supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -4215,8 +4033,8 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - table@6.8.2: - resolution: {integrity: sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==} + table@6.9.0: + resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==} engines: {node: '>=10.0.0'} tdesign-icons-svg@0.0.1: @@ -4251,9 +4069,6 @@ packages: resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} engines: {node: '>=0.10'} - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - three@0.127.0: resolution: {integrity: sha512-wtgrn+mhYUbobxT7QN3GPdu3SRpSBQvwY6uOzLChWS7QE//f7paDU/+wlzbg+ngeIvBBqjBHSRuywTh8A99Jng==} @@ -4317,25 +4132,15 @@ packages: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} - trim-newlines@4.1.1: - resolution: {integrity: sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==} - engines: {node: '>=12'} - - tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - - tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - tsx@4.19.3: resolution: {integrity: sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==} engines: {node: '>=18.0.0'} @@ -4356,10 +4161,6 @@ packages: resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} engines: {node: '>=10'} - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -4372,10 +4173,6 @@ packages: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} - type-fest@1.4.0: - resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} - engines: {node: '>=10'} - typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -4395,6 +4192,13 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript-eslint@8.72.0: + resolution: {integrity: sha512-r26Fkc8As+mZvqp7SLsMmNFyYUup/6CjK7/eHBHmhOw6GH6n6YFxHVFrG0jN1c5CMpDzelLPxvgeCOzx7BjN+A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.1.0' + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -4421,6 +4225,10 @@ packages: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} + unicorn-magic@0.4.1: + resolution: {integrity: sha512-lzlXPoVB0Uy/FvTaUgX39RbixYiSKoc3JSoSf01+0c2B6FR3qdYIPN7Qjo/AV7n6sqLCk0509cT3LRj1oSZ1+A==} + engines: {node: '>=20'} + universal-user-agent@6.0.1: resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} @@ -4455,9 +4263,6 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - v8-compile-cache@2.4.0: - resolution: {integrity: sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==} - validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -4465,6 +4270,10 @@ packages: resolution: {integrity: sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==} engines: {node: '>= 0.10'} + verkit@0.5.0: + resolution: {integrity: sha512-u4J1hr6Y+C/hit34GwL3eIcUf3wngT8TlYUjK7tk0jxydKLAq3sYvifjdTDA6U3KCKRcQCQDGf/srjxfZF3l7g==} + engines: {node: '>=18.12.0'} + vite-plugin-tdoc@2.0.4: resolution: {integrity: sha512-KKoEvlhf78opGCb+WjbOc6TRkzqOEm6rLMmJL9POh8OEa6jOCETs1k81TAaPLaIxuoJxqE4k6IAMchV60XoKpw==} @@ -4595,17 +4404,11 @@ packages: vue-component-type-helpers@3.3.11: resolution: {integrity: sha512-LwcxzeliO9fkQcpJG0PoX8X5kmAhKmH9wkpDLxNabwzkQ9Zeib2YVHwFV4pcWmMLfXVfjr/dSV+DaJ3cIPgSNA==} - vue-eslint-parser@8.3.0: - resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '>=6.0.0' - - vue-eslint-parser@9.4.3: - resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} - engines: {node: ^14.17.0 || >=16.0.0} + vue-eslint-parser@10.4.1: + resolution: {integrity: sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '>=6.0.0' + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 vue-i18n@11.4.12: resolution: {integrity: sha512-yvArvvo3ErLKFNlQrZUGmRkxL/ctM5xFYtE9FxTKiE/PalWP1bnTopBgbSRGLluYEyYSNl1Pt8l2J7zVavbXww==} @@ -4695,6 +4498,11 @@ packages: engines: {node: '>= 8'} hasBin: true + which@7.0.0: + resolution: {integrity: sha512-RancgH2dmbLdHl6LRhEqvklWMgl/Hdnun0Y90KhBOLkMefg8Qa7/Zel8Sm+8HEcP6DEjzsWzpkuBQEZok58isA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + hasBin: true + why-is-node-running@3.2.1: resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==} engines: {node: '>=20.11'} @@ -4722,9 +4530,9 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + write-file-atomic@7.0.1: + resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} + engines: {node: ^20.17.0 || >=22.9.0} ws@7.5.13: resolution: {integrity: sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==} @@ -4741,9 +4549,9 @@ packages: xml-name-validator@3.0.0: resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==} - xml-name-validator@4.0.0: - resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} - engines: {node: '>=12'} + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} @@ -4785,6 +4593,10 @@ packages: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} + yargs-parser@22.0.0: + resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yargs@15.0.2: resolution: {integrity: sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q==} @@ -4796,6 +4608,10 @@ packages: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} + yargs@18.2.0: + resolution: {integrity: sha512-9OpKOLeaoNFecEp7P6iYbzze/5CqWoH7N3SMs/6y1XF4nMvFMspEGZzJ6uFi9MmQwXhyzqYoSEKO3tvA3Z/o2w==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -4814,10 +4630,6 @@ snapshots: tunnel: 0.0.6 undici: 5.28.4 - '@babel/code-frame@7.12.11': - dependencies: - '@babel/highlight': 7.24.7 - '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 @@ -4825,13 +4637,11 @@ snapshots: '@babel/helper-string-parser@7.29.7': {} - '@babel/helper-validator-identifier@7.24.7': {} - '@babel/helper-validator-identifier@7.29.7': {} '@babel/highlight@7.24.7': dependencies: - '@babel/helper-validator-identifier': 7.24.7 + '@babel/helper-validator-identifier': 7.29.7 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.1.1 @@ -4854,23 +4664,37 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@commitlint/cli@8.3.6': + '@cacheable/memory@2.2.0': dependencies: - '@commitlint/format': 8.3.6 - '@commitlint/lint': 8.3.6 - '@commitlint/load': 8.3.6 - '@commitlint/read': 8.3.6 - babel-polyfill: 6.26.0 - chalk: 2.4.2 - get-stdin: 7.0.0 - lodash: 4.17.21 - meow: 5.0.0 - resolve-from: 5.0.0 - resolve-global: 1.0.0 + '@cacheable/utils': 2.5.0 + '@keyv/bigmap': 1.3.1(keyv@5.6.0) + hookified: 1.15.1 + keyv: 5.6.0 + + '@cacheable/utils@2.5.0': + dependencies: + hashery: 1.5.1 + keyv: 5.6.0 - '@commitlint/config-conventional@8.3.6': + '@commitlint/cli@21.2.4(conventional-commits-parser@7.1.3)(typescript@5.9.3)': dependencies: - conventional-changelog-conventionalcommits: 4.2.1 + '@commitlint/config-conventional': 21.2.4 + '@commitlint/format': 21.2.3 + '@commitlint/lint': 21.2.4 + '@commitlint/load': 21.2.4(typescript@5.9.3) + '@commitlint/read': 21.2.3(conventional-commits-parser@7.1.3) + '@commitlint/types': 21.2.3 + tinyexec: 1.3.1 + yargs: 18.2.0 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser + - typescript + + '@commitlint/config-conventional@21.2.4': + dependencies: + '@commitlint/types': 21.2.3 + conventional-changelog-conventionalcommits: 10.4.1 '@commitlint/config-validator@19.5.0': dependencies: @@ -4878,30 +4702,37 @@ snapshots: ajv: 8.17.1 optional: true - '@commitlint/ensure@8.3.6': + '@commitlint/config-validator@21.2.3': dependencies: - lodash: 4.17.21 + '@commitlint/types': 21.2.3 + ajv: 8.17.1 + + '@commitlint/ensure@21.2.4': + dependencies: + '@commitlint/types': 21.2.3 + es-toolkit: 1.52.0 '@commitlint/execute-rule@19.5.0': optional: true - '@commitlint/execute-rule@8.3.6': {} + '@commitlint/execute-rule@21.0.1': {} - '@commitlint/format@8.3.6': + '@commitlint/format@21.2.3': dependencies: - chalk: 2.4.2 + '@commitlint/types': 21.2.3 + picocolors: 1.1.1 - '@commitlint/is-ignored@8.3.6': + '@commitlint/is-ignored@21.2.3': dependencies: - semver: 6.3.0 + '@commitlint/types': 21.2.3 + semver: 7.8.5 - '@commitlint/lint@8.3.6': + '@commitlint/lint@21.2.4': dependencies: - '@commitlint/is-ignored': 8.3.6 - '@commitlint/parse': 8.3.6 - '@commitlint/rules': 8.3.6 - babel-runtime: 6.26.0 - lodash: 4.17.21 + '@commitlint/is-ignored': 21.2.3 + '@commitlint/parse': 21.2.3 + '@commitlint/rules': 21.2.4 + '@commitlint/types': 21.2.3 '@commitlint/load@19.5.0(@types/node@22.20.4)(typescript@5.9.3)': dependencies: @@ -4920,30 +4751,37 @@ snapshots: - typescript optional: true - '@commitlint/load@8.3.6': + '@commitlint/load@21.2.4(typescript@5.9.3)': dependencies: - '@commitlint/execute-rule': 8.3.6 - '@commitlint/resolve-extends': 8.3.6 - babel-runtime: 6.26.0 - chalk: 2.4.2 - cosmiconfig: 5.2.1 - lodash: 4.17.21 - resolve-from: 5.0.0 + '@commitlint/config-validator': 21.2.3 + '@commitlint/execute-rule': 21.0.1 + '@commitlint/resolve-extends': 21.2.3 + '@commitlint/types': 21.2.3 + cosmiconfig: 9.0.2(typescript@5.9.3) + es-toolkit: 1.52.0 + is-plain-obj: 4.1.0 + jiti: 2.7.0 + picocolors: 1.1.1 + transitivePeerDependencies: + - typescript - '@commitlint/message@8.3.6': {} + '@commitlint/message@21.2.0': {} - '@commitlint/parse@8.3.6': + '@commitlint/parse@21.2.3': dependencies: - conventional-changelog-angular: 1.6.6 - conventional-commits-parser: 3.2.4 - lodash: 4.18.1 + '@commitlint/types': 21.2.3 + conventional-changelog-angular: 9.4.0 + conventional-commits-parser: 7.1.3 - '@commitlint/read@8.3.6': + '@commitlint/read@21.2.3(conventional-commits-parser@7.1.3)': dependencies: - '@commitlint/top-level': 8.3.6 - '@marionebl/sander': 0.6.1 - babel-runtime: 6.26.0 - git-raw-commits: 2.0.11 + '@commitlint/top-level': 21.2.0 + '@commitlint/types': 21.2.3 + '@conventional-changelog/git-client': 3.2.0(conventional-commits-parser@7.1.3) + tinyexec: 1.3.1 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser '@commitlint/resolve-extends@19.5.0': dependencies: @@ -4955,25 +4793,26 @@ snapshots: resolve-from: 5.0.0 optional: true - '@commitlint/resolve-extends@8.3.6': + '@commitlint/resolve-extends@21.2.3': dependencies: - import-fresh: 3.3.0 - lodash: 4.17.21 + '@commitlint/config-validator': 21.2.3 + '@commitlint/types': 21.2.3 + es-toolkit: 1.52.0 + global-directory: 5.0.0 resolve-from: 5.0.0 - resolve-global: 1.0.0 - '@commitlint/rules@8.3.6': + '@commitlint/rules@21.2.4': dependencies: - '@commitlint/ensure': 8.3.6 - '@commitlint/message': 8.3.6 - '@commitlint/to-lines': 8.3.6 - babel-runtime: 6.26.0 + '@commitlint/ensure': 21.2.4 + '@commitlint/message': 21.2.0 + '@commitlint/to-lines': 21.0.1 + '@commitlint/types': 21.2.3 - '@commitlint/to-lines@8.3.6': {} + '@commitlint/to-lines@21.0.1': {} - '@commitlint/top-level@8.3.6': + '@commitlint/top-level@21.2.0': dependencies: - find-up: 4.1.0 + escalade: 3.2.0 '@commitlint/types@19.5.0': dependencies: @@ -4981,20 +4820,48 @@ snapshots: chalk: 5.3.0 optional: true - '@csstools/css-parser-algorithms@2.7.1(@csstools/css-tokenizer@2.4.1)': + '@commitlint/types@21.2.3': dependencies: - '@csstools/css-tokenizer': 2.4.1 + conventional-commits-parser: 7.1.3 + picocolors: 1.1.1 - '@csstools/css-tokenizer@2.4.1': {} + '@conventional-changelog/git-client@3.2.0(conventional-commits-parser@7.1.3)': + dependencies: + '@simple-libs/child-process-utils': 2.0.0 + '@simple-libs/stream-utils': 2.0.0 + verkit: 0.5.0 + optionalDependencies: + conventional-commits-parser: 7.1.3 + + '@conventional-changelog/template@1.4.0': {} - '@csstools/media-query-list-parser@2.1.13(@csstools/css-parser-algorithms@2.7.1(@csstools/css-tokenizer@2.4.1))(@csstools/css-tokenizer@2.4.1)': + '@csstools/css-calc@3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': dependencies: - '@csstools/css-parser-algorithms': 2.7.1(@csstools/css-tokenizer@2.4.1) - '@csstools/css-tokenizer': 2.4.1 + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 - '@csstools/selector-specificity@3.1.1(postcss-selector-parser@6.1.2)': + '@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2)': dependencies: - postcss-selector-parser: 6.1.2 + '@csstools/css-tokenizer': 4.0.2 + + '@csstools/css-syntax-patches-for-csstree@1.1.15(css-tree@3.2.1)': + optionalDependencies: + css-tree: 3.2.1 + + '@csstools/css-tokenizer@4.0.2': {} + + '@csstools/media-query-list-parser@5.0.2(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': + dependencies: + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 + + '@csstools/selector-resolve-nested@4.0.2(postcss-selector-parser@7.1.6)': + dependencies: + postcss-selector-parser: 7.1.6 + + '@csstools/selector-specificity@6.0.1(postcss-selector-parser@7.1.6)': + dependencies: + postcss-selector-parser: 7.1.6 '@esbuild/aix-ppc64@0.25.2': optional: true @@ -5071,38 +4938,57 @@ snapshots: '@esbuild/win32-x64@0.25.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@7.32.0)': + '@eslint-community/eslint-utils@4.10.1(eslint@10.13.0(jiti@2.7.0))': dependencies: - eslint: 7.32.0 + eslint: 10.13.0(jiti@2.7.0) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.2': {} - '@eslint/eslintrc@0.4.3': + '@eslint/config-array@0.23.5': dependencies: - ajv: 6.12.6 - debug: 4.3.7(supports-color@5.5.0) - espree: 7.3.1 - globals: 13.24.0 - ignore: 4.0.6 - import-fresh: 3.3.0 - js-yaml: 3.14.1 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 + '@eslint/object-schema': 3.0.5 + debug: 4.4.3 + minimatch: 10.2.6 transitivePeerDependencies: - supports-color + '@eslint/config-helpers@0.7.0': + dependencies: + '@eslint/core': 1.2.1 + + '@eslint/core@1.2.1': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/js@10.0.1(eslint@10.13.0(jiti@2.7.0))': + optionalDependencies: + eslint: 10.13.0(jiti@2.7.0) + + '@eslint/object-schema@3.0.5': {} + + '@eslint/plugin-kit@0.7.3': + dependencies: + '@eslint/core': 1.2.1 + levn: 0.4.1 + '@fastify/busboy@2.1.1': {} - '@humanwhocodes/config-array@0.5.0': + '@humanfs/core@0.19.2': dependencies: - '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.7(supports-color@5.5.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color + '@humanfs/types': 0.15.0 + + '@humanfs/node@0.16.8': + dependencies: + '@humanfs/core': 0.19.2 + '@humanfs/types': 0.15.0 + '@humanwhocodes/retry': 0.4.3 + + '@humanfs/types@0.15.0': {} + + '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@1.2.1': {} + '@humanwhocodes/retry@0.4.3': {} '@hutson/parse-repository-url@3.0.2': {} @@ -5145,11 +5031,13 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.6.0 - '@marionebl/sander@0.6.1': + '@keyv/bigmap@1.3.1(keyv@5.6.0)': dependencies: - graceful-fs: 4.2.11 - mkdirp: 0.5.6 - rimraf: 2.7.1 + hashery: 1.5.1 + hookified: 1.15.1 + keyv: 5.6.0 + + '@keyv/serialize@1.1.1': {} '@material/material-color-utilities@0.1.2': {} @@ -5287,7 +5175,13 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.40.0': optional: true - '@rtsao/scc@1.1.0': {} + '@simple-libs/child-process-utils@2.0.0': + dependencies: + '@simple-libs/stream-utils': 2.0.0 + + '@simple-libs/stream-utils@2.0.0': {} + + '@sindresorhus/merge-streams@4.0.0': {} '@tootallnate/once@1.1.2': optional: true @@ -5304,18 +5198,22 @@ snapshots: '@types/node': 22.20.4 optional: true + '@types/css-tree@3.2.0': {} + '@types/deep-eql@4.0.2': {} + '@types/esrecurse@4.3.1': {} + '@types/estree@1.0.7': {} + '@types/estree@1.0.9': {} + '@types/fs-extra@9.0.13': dependencies: '@types/node': 22.20.4 '@types/json-schema@7.0.15': {} - '@types/json5@0.0.29': {} - '@types/linkify-it@5.0.0': {} '@types/lodash-es@4.17.12': @@ -5347,106 +5245,111 @@ snapshots: dependencies: '@types/node': 22.20.4 - '@types/semver@7.5.8': {} - '@types/sortablejs@1.15.9': {} '@types/tinycolor2@1.4.6': {} '@types/validator@13.15.10': {} - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0)(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3))(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - debug: 4.3.7(supports-color@5.5.0) - eslint: 7.32.0 - graphemer: 1.4.0 - ignore: 5.3.2 - natural-compare-lite: 1.4.0 - semver: 7.8.5 - tsutils: 3.21.0(typescript@5.9.3) - optionalDependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/type-utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.72.0 + eslint: 10.13.0(jiti@2.7.0) + ignore: 7.0.13 + natural-compare: 1.4.0 + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3)': + '@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3)': dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - debug: 4.3.7(supports-color@5.5.0) - eslint: 7.32.0 - optionalDependencies: + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.72.0 + debug: 4.4.3 + eslint: 10.13.0(jiti@2.7.0) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.72.0(typescript@5.9.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@5.9.3) + '@typescript-eslint/types': 8.72.0 + debug: 4.4.3 typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@5.62.0': + '@typescript-eslint/scope-manager@8.72.0': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/visitor-keys': 8.72.0 - '@typescript-eslint/type-utils@5.62.0(eslint@7.32.0)(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.72.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - debug: 4.3.7(supports-color@5.5.0) - eslint: 7.32.0 - tsutils: 3.21.0(typescript@5.9.3) - optionalDependencies: + typescript: 5.9.3 + + '@typescript-eslint/type-utils@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3)': + dependencies: + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + debug: 4.4.3 + eslint: 10.13.0(jiti@2.7.0) + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@5.62.0': {} + '@typescript-eslint/types@8.72.0': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.72.0(typescript@5.9.3)': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.7(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 + '@typescript-eslint/project-service': 8.72.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@5.9.3) + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/visitor-keys': 8.72.0 + debug: 4.4.3 + minimatch: 10.2.6 semver: 7.8.5 - tsutils: 3.21.0(typescript@5.9.3) - optionalDependencies: + tinyglobby: 0.2.17 + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@7.32.0)(typescript@5.9.3)': + '@typescript-eslint/utils@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@7.32.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - eslint: 7.32.0 - eslint-scope: 5.1.1 - semver: 7.8.5 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)) + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + eslint: 10.13.0(jiti@2.7.0) + typescript: 5.9.3 transitivePeerDependencies: - supports-color - - typescript - '@typescript-eslint/visitor-keys@5.62.0': + '@typescript-eslint/visitor-keys@8.72.0': dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 + '@typescript-eslint/types': 8.72.0 + eslint-visitor-keys: 5.0.1 - '@vitejs/plugin-vue@5.2.4(vite@6.3.1(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3))': + '@vitejs/plugin-vue@5.2.4(vite@6.3.1(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3))': dependencies: - vite: 6.3.1(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.3.1(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) vue: 3.5.42(typescript@5.9.3) - '@vitejs/plugin-vue@5.2.4(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3))': + '@vitejs/plugin-vue@5.2.4(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))(vue@3.5.42(typescript@5.9.3))': dependencies: - vite: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) vue: 3.5.42(typescript@5.9.3) '@vitest/coverage-v8@5.0.3(vitest@5.0.3)': @@ -5459,7 +5362,7 @@ snapshots: obug: 2.2.1 std-env: 4.3.0 tinyrainbow: 3.2.0 - vitest: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) + vitest: 5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) '@vitest/istanbul-lib-coverage@1.0.2': {} @@ -5467,23 +5370,23 @@ snapshots: dependencies: '@vitest/istanbul-lib-coverage': 1.0.2 - '@vitest/mocker@5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))': + '@vitest/mocker@5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.0.3 estree-walker: 3.0.3 magic-string: 1.4.2 optionalDependencies: - vite: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) - '@vitest/mocker@5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))': + '@vitest/mocker@5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.0.3 estree-walker: 3.0.3 magic-string: 1.4.2 optionalDependencies: - vite: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) '@vitest/spy@5.0.3': {} @@ -5620,24 +5523,18 @@ snapshots: acorn-walk: 7.2.0 optional: true - acorn-jsx@5.3.2(acorn@7.4.1): - dependencies: - acorn: 7.4.1 - - acorn-jsx@5.3.2(acorn@8.18.0): + acorn-jsx@5.3.2(acorn@8.19.0): dependencies: - acorn: 8.18.0 + acorn: 8.19.0 acorn-walk@7.2.0: optional: true - acorn@7.4.1: {} - - acorn@8.18.0: {} - - acorn@8.19.0: + acorn@7.4.1: optional: true + acorn@8.19.0: {} + add-stream@1.0.0: {} agent-base@6.0.2: @@ -5647,7 +5544,7 @@ snapshots: - supports-color optional: true - ajv@6.12.6: + ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 @@ -5665,16 +5562,10 @@ snapshots: alien-signals@3.2.1: {} - ansi-colors@4.1.3: {} - ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 - ansi-escapes@7.3.0: - dependencies: - environment: 1.1.0 - ansi-regex@5.0.1: {} ansi-regex@6.4.0: {} @@ -5689,6 +5580,8 @@ snapshots: ansi-styles@6.2.3: {} + ansi-styles@7.0.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -5700,6 +5593,8 @@ snapshots: argparse@2.0.1: {} + argue-cli@3.2.0: {} + array-buffer-byte-length@1.0.1: dependencies: call-bind: 1.0.7 @@ -5709,40 +5604,6 @@ snapshots: array-ify@1.0.0: {} - array-includes@3.1.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - get-intrinsic: 1.2.4 - is-string: 1.0.7 - - array-union@2.1.0: {} - - array.prototype.findlastindex@1.2.5: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-shim-unscopables: 1.0.2 - - array.prototype.flat@1.3.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - - array.prototype.flatmap@1.3.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - arraybuffer.prototype.slice@1.0.3: dependencies: array-buffer-byte-length: 1.0.1 @@ -5785,21 +5646,8 @@ snapshots: dependencies: possible-typed-array-names: 1.0.0 - babel-polyfill@6.26.0: - dependencies: - babel-runtime: 6.26.0 - core-js: 2.6.12 - regenerator-runtime: 0.10.5 - - babel-runtime@6.26.0: - dependencies: - core-js: 2.6.12 - regenerator-runtime: 0.11.1 - balanced-match@1.0.2: {} - balanced-match@2.0.0: {} - balanced-match@4.0.4: {} base64-js@1.5.1: {} @@ -5852,6 +5700,14 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + cacheable@2.5.0: + dependencies: + '@cacheable/memory': 2.2.0 + '@cacheable/utils': 2.5.0 + hookified: 1.15.1 + keyv: 5.6.0 + qified: 0.10.1 + cachedir@2.3.0: {} call-bind-apply-helpers@1.0.2: @@ -5868,16 +5724,6 @@ snapshots: get-intrinsic: 1.2.4 set-function-length: 1.2.2 - caller-callsite@2.0.0: - dependencies: - callsites: 2.0.0 - - caller-path@2.0.0: - dependencies: - caller-callsite: 2.0.0 - - callsites@2.0.0: {} - callsites@3.1.0: {} camelcase-keys@4.2.0: @@ -5892,19 +5738,10 @@ snapshots: map-obj: 4.3.0 quick-lru: 4.0.1 - camelcase-keys@7.0.2: - dependencies: - camelcase: 6.3.0 - map-obj: 4.3.0 - quick-lru: 5.1.1 - type-fest: 1.4.0 - camelcase@4.1.0: {} camelcase@5.3.1: {} - camelcase@6.3.0: {} - caniuse-api@3.0.0: dependencies: browserslist: 4.23.3 @@ -5957,17 +5794,8 @@ snapshots: dependencies: restore-cursor: 3.1.0 - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 - cli-spinners@2.9.2: {} - cli-truncate@5.2.0: - dependencies: - slice-ansi: 8.0.0 - string-width: 8.3.0 - cli-width@3.0.0: {} cliui@6.0.0: @@ -5982,6 +5810,12 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + cliui@9.0.1: + dependencies: + string-width: 7.2.0 + strip-ansi: 7.2.0 + wrap-ansi: 9.0.2 + clone@1.0.4: {} color-convert@1.9.3: @@ -5996,9 +5830,9 @@ snapshots: color-name@1.1.4: {} - colord@2.9.3: {} + colord@2.10.0: {} - colorette@2.0.20: {} + colord@2.9.3: {} combined-stream@1.0.8: dependencies: @@ -6056,16 +5890,15 @@ snapshots: ini: 1.3.8 proto-list: 1.2.4 - conventional-changelog-angular@1.6.6: - dependencies: - compare-func: 1.3.4 - q: 1.5.1 - conventional-changelog-angular@5.0.13: dependencies: compare-func: 2.0.0 q: 1.5.1 + conventional-changelog-angular@9.4.0: + dependencies: + '@conventional-changelog/template': 1.4.0 + conventional-changelog-atom@2.0.8: dependencies: q: 1.5.1 @@ -6076,11 +5909,9 @@ snapshots: conventional-changelog-config-spec@2.1.0: {} - conventional-changelog-conventionalcommits@4.2.1: + conventional-changelog-conventionalcommits@10.4.1: dependencies: - compare-func: 1.3.4 - lodash: 4.17.21 - q: 1.5.1 + '@conventional-changelog/template': 1.4.0 conventional-changelog-conventionalcommits@4.2.3: dependencies: @@ -6170,6 +6001,11 @@ snapshots: split2: 3.2.2 through2: 4.0.2 + conventional-commits-parser@7.1.3: + dependencies: + '@simple-libs/stream-utils': 2.0.0 + argue-cli: 3.2.0 + conventional-recommended-bump@6.0.5: dependencies: concat-stream: 2.0.0 @@ -6191,8 +6027,6 @@ snapshots: core-js-pure@3.38.1: {} - core-js@2.6.12: {} - core-util-is@1.0.3: {} cosmiconfig-typescript-loader@5.0.0(@types/node@22.20.4)(cosmiconfig@9.0.0(typescript@5.9.3))(typescript@5.9.3): @@ -6203,23 +6037,17 @@ snapshots: typescript: 5.9.3 optional: true - cosmiconfig@5.2.1: - dependencies: - import-fresh: 2.0.0 - is-directory: 0.3.1 - js-yaml: 3.14.1 - parse-json: 4.0.0 - - cosmiconfig@8.3.6(typescript@5.9.3): + cosmiconfig@9.0.0(typescript@5.9.3): dependencies: + env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 - path-type: 4.0.0 optionalDependencies: typescript: 5.9.3 + optional: true - cosmiconfig@9.0.0(typescript@5.9.3): + cosmiconfig@9.0.2(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 @@ -6227,7 +6055,6 @@ snapshots: parse-json: 5.2.0 optionalDependencies: typescript: 5.9.3 - optional: true cross-env@6.0.3: dependencies: @@ -6247,11 +6074,17 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + css-declaration-sorter@6.4.1(postcss@8.4.47): dependencies: postcss: 8.4.47 - css-functions-list@3.2.2: {} + css-functions-list@3.3.3: {} css-select@4.3.0: dependencies: @@ -6266,9 +6099,9 @@ snapshots: mdn-data: 2.0.14 source-map: 0.6.1 - css-tree@2.3.1: + css-tree@3.2.1: dependencies: - mdn-data: 2.0.30 + mdn-data: 2.27.1 source-map-js: 1.2.1 css-what@6.1.0: {} @@ -6401,6 +6234,7 @@ snapshots: debug@3.2.7: dependencies: ms: 2.1.3 + optional: true debug@4.3.7(supports-color@5.5.0): dependencies: @@ -6411,7 +6245,6 @@ snapshots: debug@4.4.3: dependencies: ms: 2.1.3 - optional: true decamelize-keys@1.1.1: dependencies: @@ -6420,8 +6253,6 @@ snapshots: decamelize@1.2.0: {} - decamelize@5.0.1: {} - decimal.js@10.6.0: optional: true @@ -6462,18 +6293,6 @@ snapshots: dijkstrajs@1.0.3: {} - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - - doctrine@2.1.0: - dependencies: - esutils: 2.0.3 - - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - dom-serializer@1.4.1: dependencies: domelementtype: 2.3.0 @@ -6546,11 +6365,6 @@ snapshots: emoji-regex@8.0.0: {} - enquirer@2.4.1: - dependencies: - ansi-colors: 4.1.3 - strip-ansi: 6.0.1 - entities@2.1.0: {} entities@2.2.0: {} @@ -6559,10 +6373,7 @@ snapshots: entities@7.0.1: {} - env-paths@2.2.1: - optional: true - - environment@1.1.0: {} + env-paths@2.2.1: {} errno@0.1.8: dependencies: @@ -6656,16 +6467,14 @@ snapshots: hasown: 2.0.4 optional: true - es-shim-unscopables@1.0.2: - dependencies: - hasown: 2.0.2 - es-to-primitive@1.2.1: dependencies: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 + es-toolkit@1.52.0: {} + esbuild@0.25.2: optionalDependencies: '@esbuild/aix-ppc64': 0.25.2 @@ -6700,213 +6509,87 @@ snapshots: escape-string-regexp@1.0.5: {} - escape-string-regexp@4.0.0: {} - - escodegen@2.1.0: - dependencies: - esprima: 4.0.1 - estraverse: 5.3.0 - esutils: 2.0.3 - optionalDependencies: - source-map: 0.6.1 - optional: true - - eslint-config-prettier@9.1.0(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - - eslint-config-standard@16.0.3(eslint-plugin-import@2.30.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0) - eslint-plugin-node: 11.1.0(eslint@7.32.0) - eslint-plugin-promise: 5.2.0(eslint@7.32.0) - - eslint-import-resolver-node@0.3.9: - dependencies: - debug: 3.2.7 - is-core-module: 2.15.1 - resolve: 1.22.8 - transitivePeerDependencies: - - supports-color - - eslint-module-utils@2.11.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@7.32.0): - dependencies: - debug: 3.2.7 - optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - eslint: 7.32.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - - eslint-plugin-es@3.0.1(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 - - eslint-plugin-html@7.1.0: - dependencies: - htmlparser2: 8.0.2 - - eslint-plugin-import@2.30.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint@7.32.0): - dependencies: - '@rtsao/scc': 1.1.0 - array-includes: 3.1.8 - array.prototype.findlastindex: 1.2.5 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 7.32.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@7.32.0) - hasown: 2.0.2 - is-core-module: 2.15.1 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.8 - object.groupby: 1.0.3 - object.values: 1.2.0 - semver: 6.3.1 - tsconfig-paths: 3.15.0 - optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@5.9.3) - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - - eslint-plugin-node@11.1.0(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - eslint-plugin-es: 3.0.1(eslint@7.32.0) - eslint-utils: 2.1.0 - ignore: 5.3.2 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 6.3.1 - - eslint-plugin-prettier@4.2.1(eslint-config-prettier@9.1.0(eslint@7.32.0))(eslint@7.32.0)(prettier@2.8.8): - dependencies: - eslint: 7.32.0 - prettier: 2.8.8 - prettier-linter-helpers: 1.0.0 - optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@7.32.0) - - eslint-plugin-promise@5.2.0(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - - eslint-plugin-vue@8.7.1(eslint@7.32.0): - dependencies: - eslint: 7.32.0 - eslint-utils: 3.0.0(eslint@7.32.0) - natural-compare: 1.4.0 - nth-check: 2.1.1 - postcss-selector-parser: 6.1.2 - semver: 7.6.3 - vue-eslint-parser: 8.3.0(eslint@7.32.0) - transitivePeerDependencies: - - supports-color - - eslint-plugin-vue@9.33.0(eslint@7.32.0): - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@7.32.0) - eslint: 7.32.0 - globals: 13.24.0 - natural-compare: 1.4.0 - nth-check: 2.1.1 - postcss-selector-parser: 6.1.2 - semver: 7.6.3 - vue-eslint-parser: 9.4.3(eslint@7.32.0) - xml-name-validator: 4.0.0 - transitivePeerDependencies: - - supports-color - - eslint-scope@5.1.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 + escape-string-regexp@4.0.0: {} - eslint-scope@7.2.2: + escodegen@2.1.0: dependencies: - esrecurse: 4.3.0 + esprima: 4.0.1 estraverse: 5.3.0 + esutils: 2.0.3 + optionalDependencies: + source-map: 0.6.1 + optional: true - eslint-utils@2.1.0: + eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)): dependencies: - eslint-visitor-keys: 1.3.0 + eslint: 10.13.0(jiti@2.7.0) - eslint-utils@3.0.0(eslint@7.32.0): + eslint-plugin-vue@10.11.1(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3))(eslint@10.13.0(jiti@2.7.0))(vue-eslint-parser@10.4.1(eslint@10.13.0(jiti@2.7.0))): dependencies: - eslint: 7.32.0 - eslint-visitor-keys: 2.1.0 - - eslint-visitor-keys@1.3.0: {} + '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)) + eslint: 10.13.0(jiti@2.7.0) + natural-compare: 1.4.0 + nth-check: 2.1.1 + postcss-selector-parser: 7.1.6 + semver: 7.8.5 + vue-eslint-parser: 10.4.1(eslint@10.13.0(jiti@2.7.0)) + xml-name-validator: 5.0.0 + optionalDependencies: + '@typescript-eslint/parser': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) - eslint-visitor-keys@2.1.0: {} + eslint-scope@9.1.2: + dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.9 + esrecurse: 4.3.0 + estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint@7.32.0: + eslint-visitor-keys@5.0.1: {} + + eslint@10.13.0(jiti@2.7.0): dependencies: - '@babel/code-frame': 7.12.11 - '@eslint/eslintrc': 0.4.3 - '@humanwhocodes/config-array': 0.5.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.7(supports-color@5.5.0) - doctrine: 3.0.0 - enquirer: 2.4.1 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.23.5 + '@eslint/config-helpers': 0.7.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.3 + '@humanfs/node': 0.16.8 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.7 + ajv: 6.15.0 + cross-spawn: 7.0.6 + debug: 4.4.3 escape-string-regexp: 4.0.0 - eslint-scope: 5.1.1 - eslint-utils: 2.1.0 - eslint-visitor-keys: 2.1.0 - espree: 7.3.1 - esquery: 1.6.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 + esquery: 1.7.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - functional-red-black-tree: 1.0.1 - glob-parent: 5.1.2 - globals: 13.24.0 - ignore: 4.0.6 - import-fresh: 3.3.0 + file-entry-cache: 11.1.5 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 - js-yaml: 3.14.1 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 + minimatch: 10.2.6 natural-compare: 1.4.0 optionator: 0.9.4 - progress: 2.0.3 - regexpp: 3.2.0 - semver: 7.6.3 - strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 - table: 6.8.2 - text-table: 0.2.0 - v8-compile-cache: 2.4.0 + optionalDependencies: + jiti: 2.7.0 transitivePeerDependencies: - supports-color - espree@7.3.1: - dependencies: - acorn: 7.4.1 - acorn-jsx: 5.3.2(acorn@7.4.1) - eslint-visitor-keys: 1.3.0 - - espree@9.6.1: + espree@11.2.0: dependencies: - acorn: 8.18.0 - acorn-jsx: 5.3.2(acorn@8.18.0) - eslint-visitor-keys: 3.4.3 + acorn: 8.19.0 + acorn-jsx: 5.3.2(acorn@8.19.0) + eslint-visitor-keys: 5.0.1 esprima@4.0.1: {} @@ -6914,11 +6597,13 @@ snapshots: dependencies: estraverse: 5.3.0 - esrecurse@4.3.0: + esquery@1.7.0: dependencies: estraverse: 5.3.0 - estraverse@4.3.0: {} + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 estraverse@5.3.0: {} @@ -6930,8 +6615,6 @@ snapshots: esutils@2.0.3: {} - eventemitter3@5.0.4: {} - expand-tilde@2.0.2: dependencies: homedir-polyfill: 1.0.3 @@ -6950,9 +6633,7 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-diff@1.3.0: {} - - fast-glob@3.3.2: + fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 @@ -6992,13 +6673,9 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - file-entry-cache@6.0.1: - dependencies: - flat-cache: 3.2.0 - - file-entry-cache@7.0.2: + file-entry-cache@11.1.5: dependencies: - flat-cache: 3.2.0 + flat-cache: 6.1.23 fill-range@7.1.1: dependencies: @@ -7036,13 +6713,13 @@ snapshots: micromatch: 4.0.8 resolve-dir: 1.0.1 - flat-cache@3.2.0: + flat-cache@6.1.23: dependencies: - flatted: 3.3.1 - keyv: 4.5.4 - rimraf: 3.0.2 + cacheable: 2.5.0 + flatted: 3.4.4 + hookified: 1.15.1 - flatted@3.3.1: {} + flatted@3.4.4: {} for-each@0.3.3: dependencies: @@ -7090,8 +6767,6 @@ snapshots: es-abstract: 1.23.3 functions-have-names: 1.2.3 - functional-red-black-tree@1.0.1: {} - functions-have-names@1.2.3: {} get-caller-file@2.0.5: {} @@ -7133,8 +6808,6 @@ snapshots: es-object-atoms: 1.1.2 optional: true - get-stdin@7.0.0: {} - get-symbol-description@1.0.2: dependencies: call-bind: 1.0.7 @@ -7184,6 +6857,10 @@ snapshots: dependencies: is-glob: 4.0.3 + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + glob@13.0.6: dependencies: minimatch: 10.2.6 @@ -7204,9 +6881,9 @@ snapshots: ini: 4.1.1 optional: true - global-dirs@0.1.1: + global-directory@5.0.0: dependencies: - ini: 1.3.8 + ini: 6.0.0 global-modules@1.0.0: dependencies: @@ -7232,23 +6909,22 @@ snapshots: kind-of: 6.0.3 which: 1.3.1 - globals@13.24.0: - dependencies: - type-fest: 0.20.2 + globals@17.13.0: {} globalthis@1.0.4: dependencies: define-properties: 1.2.1 gopd: 1.0.1 - globby@11.1.0: + globby@16.2.4: dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.2 - merge2: 1.4.1 - slash: 3.0.0 + '@sindresorhus/merge-streams': 4.0.0 + fast-glob: 3.3.3 + ignore: 7.0.13 + is-path-inside: 4.0.0 + micromatch: 4.0.8 + slash: 5.1.0 + unicorn-magic: 0.4.1 globjoin@0.1.4: {} @@ -7261,8 +6937,6 @@ snapshots: graceful-fs@4.2.11: {} - graphemer@1.4.0: {} - gray-matter@4.0.3: dependencies: js-yaml: 3.14.1 @@ -7295,6 +6969,8 @@ snapshots: has-flag@4.0.0: {} + has-flag@5.0.1: {} + has-property-descriptors@1.0.2: dependencies: es-define-property: 1.0.0 @@ -7310,6 +6986,10 @@ snapshots: dependencies: has-symbols: 1.0.3 + hashery@1.5.1: + dependencies: + hookified: 1.15.1 + hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -7325,6 +7005,10 @@ snapshots: dependencies: parse-passwd: 1.0.0 + hookified@1.15.1: {} + + hookified@2.2.0: {} + hosted-git-info@2.8.9: {} hosted-git-info@4.1.0: @@ -7336,9 +7020,9 @@ snapshots: whatwg-encoding: 1.0.5 optional: true - html-tags@3.3.1: {} + html-tags@5.1.0: {} - htmlparser2@8.0.2: + htmlparser2@9.1.0: dependencies: domelementtype: 2.3.0 domhandler: 5.0.3 @@ -7362,7 +7046,7 @@ snapshots: - supports-color optional: true - husky@8.0.3: {} + husky@9.1.7: {} hybrids@9.1.23: {} @@ -7379,36 +7063,29 @@ snapshots: ignore-by-default@1.0.1: {} - ignore@4.0.6: {} - ignore@5.3.2: {} + ignore@7.0.13: {} + image-size@0.5.5: optional: true - import-fresh@2.0.0: - dependencies: - caller-path: 2.0.0 - resolve-from: 3.0.0 - import-fresh@3.3.0: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - import-lazy@4.0.0: {} - import-meta-resolve@4.1.0: optional: true + import-meta-resolve@4.2.0: {} + imurmurhash@0.1.4: {} indent-string@3.2.0: {} indent-string@4.0.0: {} - indent-string@5.0.0: {} - inflight@1.0.6: dependencies: once: 1.4.0 @@ -7421,6 +7098,8 @@ snapshots: ini@4.1.1: optional: true + ini@6.0.0: {} + inquirer@8.2.5: dependencies: ansi-escapes: 4.3.2 @@ -7479,18 +7158,12 @@ snapshots: dependencies: has-tostringtag: 1.0.2 - is-directory@0.3.1: {} - is-extendable@0.1.1: {} is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@5.1.0: - dependencies: - get-east-asian-width: 1.7.0 - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -7509,9 +7182,11 @@ snapshots: is-obj@2.0.0: {} + is-path-inside@4.0.0: {} + is-plain-obj@1.1.0: {} - is-plain-object@5.0.0: {} + is-plain-obj@4.1.0: {} is-potential-custom-element-name@1.0.1: optional: true @@ -7561,9 +7236,13 @@ snapshots: isexe@2.0.0: {} + isexe@4.0.0: {} + jiti@1.21.6: optional: true + jiti@2.7.0: {} + js-beautify@2.0.3: dependencies: config-chain: 1.1.13 @@ -7578,6 +7257,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -7622,12 +7303,12 @@ snapshots: - utf-8-validate optional: true - json-buffer@3.0.1: {} - json-parse-better-errors@1.0.2: {} json-parse-even-better-errors@2.3.1: {} + json-parse-even-better-errors@6.0.0: {} + json-schema-traverse@0.4.1: {} json-schema-traverse@1.0.0: {} @@ -7636,10 +7317,6 @@ snapshots: json-stringify-safe@5.0.1: {} - json5@1.0.2: - dependencies: - minimist: 1.2.8 - jsonfile@6.1.0: dependencies: universalify: 2.0.1 @@ -7648,14 +7325,12 @@ snapshots: jsonparse@1.3.1: {} - keyv@4.5.4: + keyv@5.6.0: dependencies: - json-buffer: 3.0.1 + '@keyv/serialize': 1.1.1 kind-of@6.0.3: {} - known-css-properties@0.29.0: {} - less@4.2.0: dependencies: copy-anything: 2.0.6 @@ -7698,24 +7373,14 @@ snapshots: dependencies: uc.micro: 1.0.6 - lint-staged@16.4.0: + lint-staged@17.6.0: dependencies: - commander: 14.0.3 - listr2: 9.0.5 picomatch: 4.0.7 string-argv: 0.3.2 tinyexec: 1.3.1 + optionalDependencies: yaml: 2.9.1 - listr2@9.0.5: - dependencies: - cli-truncate: 5.2.0 - colorette: 2.0.20 - eventemitter3: 5.0.4 - log-update: 6.1.0 - rfdc: 1.4.1 - wrap-ansi: 9.0.2 - load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11 @@ -7754,7 +7419,8 @@ snapshots: lodash.memoize@4.1.2: {} - lodash.merge@4.6.2: {} + lodash.merge@4.6.2: + optional: true lodash.mergewith@4.6.2: optional: true @@ -7781,14 +7447,6 @@ snapshots: chalk: 4.1.2 is-unicode-supported: 0.1.0 - log-update@6.1.0: - dependencies: - ansi-escapes: 7.3.0 - cli-cursor: 5.0.0 - slice-ansi: 7.1.2 - strip-ansi: 7.2.0 - wrap-ansi: 9.0.2 - longest@2.0.1: {} lottie-web@5.12.2: {} @@ -7861,30 +7519,17 @@ snapshots: math-intrinsics@1.1.0: optional: true - mathml-tag-names@2.1.3: {} + mathml-tag-names@4.0.0: {} mdn-data@2.0.14: {} - mdn-data@2.0.30: {} + mdn-data@2.27.1: {} mdurl@1.0.1: {} memorystream@0.3.1: {} - meow@10.1.5: - dependencies: - '@types/minimist': 1.2.5 - camelcase-keys: 7.0.2 - decamelize: 5.0.1 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 3.0.3 - read-pkg-up: 8.0.0 - redent: 4.0.0 - trim-newlines: 4.1.1 - type-fest: 1.4.0 - yargs-parser: 20.2.9 + meow@14.1.0: {} meow@4.0.1: dependencies: @@ -7946,8 +7591,6 @@ snapshots: mimic-fn@2.1.0: {} - mimic-function@5.0.1: {} - min-indent@1.0.1: {} minimatch@10.2.6: @@ -7981,10 +7624,6 @@ snapshots: mitt@3.0.1: {} - mkdirp@0.5.6: - dependencies: - minimist: 1.2.8 - modify-values@1.0.1: {} ms@2.0.0: @@ -8002,8 +7641,6 @@ snapshots: nanoid@3.3.7: {} - natural-compare-lite@1.4.0: {} - natural-compare@1.4.0: {} needle@2.9.1: @@ -8064,6 +7701,19 @@ snapshots: normalize-url@6.1.0: {} + npm-normalize-package-bin@6.0.0: {} + + npm-run-all2@9.0.3: + dependencies: + ansi-styles: 7.0.0 + cross-spawn: 7.0.6 + memorystream: 0.3.1 + picomatch: 4.0.7 + pidtree: 1.0.0 + read-package-json-fast: 6.0.0 + shell-quote: 1.12.0 + which: 7.0.0 + npm-run-all@4.1.5: dependencies: ansi-styles: 3.2.1 @@ -8100,25 +7750,6 @@ snapshots: has-symbols: 1.0.3 object-keys: 1.1.1 - object.fromentries@2.0.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - - object.groupby@1.0.3: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - - object.values@1.2.0: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-object-atoms: 1.0.0 - obug@2.2.1: {} once@1.4.0: @@ -8129,10 +7760,6 @@ snapshots: dependencies: mimic-fn: 2.1.0 - onetime@7.0.0: - dependencies: - mimic-function: 5.0.1 - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -8188,6 +7815,8 @@ snapshots: p-try@2.2.0: {} + package-json-from-dist@1.0.1: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -8234,8 +7863,6 @@ snapshots: dependencies: pify: 3.0.0 - path-type@4.0.0: {} - picocolors@1.1.0: {} picocolors@1.1.1: {} @@ -8248,6 +7875,8 @@ snapshots: pidtree@0.3.1: {} + pidtree@1.0.0: {} + pify@2.3.0: {} pify@3.0.0: {} @@ -8295,6 +7924,13 @@ snapshots: dependencies: postcss: 8.4.47 + postcss-html@2.0.0(postcss@8.5.26): + dependencies: + htmlparser2: 9.1.0 + js-tokens: 9.0.1 + postcss: 8.5.26 + postcss-safe-parser: 7.1.0(postcss@8.5.26) + postcss-less@6.0.0(postcss@8.5.26): dependencies: postcss: 8.5.26 @@ -8400,17 +8036,20 @@ snapshots: postcss: 8.4.47 postcss-value-parser: 4.2.0 - postcss-resolve-nested-selector@0.1.6: {} - - postcss-safe-parser@6.0.0(postcss@8.4.47): + postcss-safe-parser@7.1.0(postcss@8.5.26): dependencies: - postcss: 8.4.47 + postcss: 8.5.26 postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 + postcss-selector-parser@7.1.6: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + postcss-svgo@5.1.0(postcss@8.4.47): dependencies: postcss: 8.4.47 @@ -8444,11 +8083,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier-linter-helpers@1.0.0: - dependencies: - fast-diff: 1.3.0 - - prettier@2.8.8: {} + prettier@3.9.10: {} prismjs@1.29.0: {} @@ -8463,8 +8098,6 @@ snapshots: process-nextick-args@2.0.1: {} - progress@2.0.3: {} - proto-list@1.2.4: {} prr@1.0.1: @@ -8481,6 +8114,10 @@ snapshots: q@1.5.1: {} + qified@0.10.1: + dependencies: + hookified: 2.2.0 + qrcode@1.5.4: dependencies: dijkstrajs: 1.0.3 @@ -8496,7 +8133,10 @@ snapshots: quick-lru@4.0.1: {} - quick-lru@5.1.1: {} + read-package-json-fast@6.0.0: + dependencies: + json-parse-even-better-errors: 6.0.0 + npm-normalize-package-bin: 6.0.0 read-pkg-up@3.0.0: dependencies: @@ -8509,12 +8149,6 @@ snapshots: read-pkg: 5.2.0 type-fest: 0.8.1 - read-pkg-up@8.0.0: - dependencies: - find-up: 5.0.0 - read-pkg: 6.0.0 - type-fest: 1.4.0 - read-pkg@3.0.0: dependencies: load-json-file: 4.0.0 @@ -8528,13 +8162,6 @@ snapshots: parse-json: 5.2.0 type-fest: 0.6.0 - read-pkg@6.0.0: - dependencies: - '@types/normalize-package-data': 2.4.4 - normalize-package-data: 3.0.3 - parse-json: 5.2.0 - type-fest: 1.4.0 - readable-stream@2.3.8: dependencies: core-util-is: 1.0.3 @@ -8565,15 +8192,6 @@ snapshots: indent-string: 4.0.0 strip-indent: 3.0.0 - redent@4.0.0: - dependencies: - indent-string: 5.0.0 - strip-indent: 4.0.0 - - regenerator-runtime@0.10.5: {} - - regenerator-runtime@0.11.1: {} - regenerator-runtime@0.13.11: {} regexp.prototype.flags@1.5.2: @@ -8583,8 +8201,6 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 - regexpp@3.2.0: {} - require-directory@2.1.1: {} require-from-string@2.0.2: {} @@ -8599,16 +8215,10 @@ snapshots: expand-tilde: 2.0.2 global-modules: 1.0.0 - resolve-from@3.0.0: {} - resolve-from@4.0.0: {} resolve-from@5.0.0: {} - resolve-global@1.0.0: - dependencies: - global-dirs: 0.1.1 - resolve-pkg-maps@1.0.0: {} resolve@1.22.8: @@ -8622,22 +8232,12 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - reusify@1.0.4: {} - rfdc@1.4.1: {} - - rimraf@2.7.1: - dependencies: - glob: 7.2.3 - - rimraf@3.0.2: + rimraf@6.1.3: dependencies: - glob: 7.2.3 + glob: 13.0.6 + package-json-from-dist: 1.0.1 rollup@4.40.0: dependencies: @@ -8747,6 +8347,8 @@ snapshots: shebang-regex@3.0.0: {} + shell-quote@1.12.0: {} + shell-quote@1.8.1: {} side-channel@1.0.6: @@ -8764,7 +8366,7 @@ snapshots: dependencies: semver: 7.8.5 - slash@3.0.0: {} + slash@5.1.0: {} slice-ansi@4.0.0: dependencies: @@ -8772,16 +8374,6 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - slice-ansi@7.1.2: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - - slice-ansi@8.0.0: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - sortablejs@1.15.7: {} source-map-js@1.2.1: {} @@ -8926,99 +8518,91 @@ snapshots: dependencies: min-indent: 1.0.1 - strip-indent@4.0.0: - dependencies: - min-indent: 1.0.1 - strip-json-comments@3.1.1: {} - style-search@0.1.0: {} - stylehacks@5.1.1(postcss@8.4.47): dependencies: browserslist: 4.23.3 postcss: 8.4.47 postcss-selector-parser: 6.1.2 - stylelint-config-recommended-less@2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)): + stylelint-config-recommended-less@4.2.1(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)): dependencies: postcss-less: 6.0.0(postcss@8.5.26) - stylelint: 15.11.0(typescript@5.9.3) - stylelint-config-recommended: 13.0.0(stylelint@15.11.0(typescript@5.9.3)) - stylelint-less: 2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)) + stylelint: 17.16.0(typescript@5.9.3) + stylelint-config-recommended: 18.0.0(stylelint@17.16.0(typescript@5.9.3)) + stylelint-less: 4.2.2(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)) optionalDependencies: postcss: 8.5.26 - stylelint-config-recommended@13.0.0(stylelint@15.11.0(typescript@5.9.3)): + stylelint-config-recommended@18.0.0(stylelint@17.16.0(typescript@5.9.3)): dependencies: - stylelint: 15.11.0(typescript@5.9.3) + stylelint: 17.16.0(typescript@5.9.3) - stylelint-config-standard-less@2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)): + stylelint-config-standard-less@4.1.0(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)): dependencies: - stylelint: 15.11.0(typescript@5.9.3) - stylelint-config-recommended-less: 2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)) - stylelint-config-standard: 34.0.0(stylelint@15.11.0(typescript@5.9.3)) + stylelint: 17.16.0(typescript@5.9.3) + stylelint-config-recommended-less: 4.2.1(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)) + stylelint-config-standard: 40.0.0(stylelint@17.16.0(typescript@5.9.3)) optionalDependencies: postcss: 8.5.26 - stylelint-config-standard@34.0.0(stylelint@15.11.0(typescript@5.9.3)): + stylelint-config-standard@40.0.0(stylelint@17.16.0(typescript@5.9.3)): dependencies: - stylelint: 15.11.0(typescript@5.9.3) - stylelint-config-recommended: 13.0.0(stylelint@15.11.0(typescript@5.9.3)) + stylelint: 17.16.0(typescript@5.9.3) + stylelint-config-recommended: 18.0.0(stylelint@17.16.0(typescript@5.9.3)) - stylelint-less@2.0.0(postcss@8.5.26)(stylelint@15.11.0(typescript@5.9.3)): + stylelint-less@4.2.2(postcss@8.5.26)(stylelint@17.16.0(typescript@5.9.3)): dependencies: + '@types/css-tree': 3.2.0 + css-tree: 3.2.1 postcss: 8.5.26 - postcss-resolve-nested-selector: 0.1.6 postcss-value-parser: 4.2.0 - stylelint: 15.11.0(typescript@5.9.3) - - stylelint@15.11.0(typescript@5.9.3): - dependencies: - '@csstools/css-parser-algorithms': 2.7.1(@csstools/css-tokenizer@2.4.1) - '@csstools/css-tokenizer': 2.4.1 - '@csstools/media-query-list-parser': 2.1.13(@csstools/css-parser-algorithms@2.7.1(@csstools/css-tokenizer@2.4.1))(@csstools/css-tokenizer@2.4.1) - '@csstools/selector-specificity': 3.1.1(postcss-selector-parser@6.1.2) - balanced-match: 2.0.0 - colord: 2.9.3 - cosmiconfig: 8.3.6(typescript@5.9.3) - css-functions-list: 3.2.2 - css-tree: 2.3.1 - debug: 4.3.7(supports-color@5.5.0) - fast-glob: 3.3.2 + stylelint: 17.16.0(typescript@5.9.3) + + stylelint@17.16.0(typescript@5.9.3): + dependencies: + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-syntax-patches-for-csstree': 1.1.15(css-tree@3.2.1) + '@csstools/css-tokenizer': 4.0.2 + '@csstools/media-query-list-parser': 5.0.2(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/selector-resolve-nested': 4.0.2(postcss-selector-parser@7.1.6) + '@csstools/selector-specificity': 6.0.1(postcss-selector-parser@7.1.6) + colord: 2.10.0 + cosmiconfig: 9.0.2(typescript@5.9.3) + css-functions-list: 3.3.3 + css-tree: 3.2.1 + debug: 4.4.3 + fast-glob: 3.3.3 fastest-levenshtein: 1.0.16 - file-entry-cache: 7.0.2 + file-entry-cache: 11.1.5 global-modules: 2.0.0 - globby: 11.1.0 + globby: 16.2.4 globjoin: 0.1.4 - html-tags: 3.3.1 - ignore: 5.3.2 - import-lazy: 4.0.0 - imurmurhash: 0.1.4 - is-plain-object: 5.0.0 - known-css-properties: 0.29.0 - mathml-tag-names: 2.1.3 - meow: 10.1.5 + html-tags: 5.1.0 + ignore: 7.0.13 + import-meta-resolve: 4.2.0 + mathml-tag-names: 4.0.0 + meow: 14.1.0 micromatch: 4.0.8 normalize-path: 3.0.0 - picocolors: 1.1.0 - postcss: 8.4.47 - postcss-resolve-nested-selector: 0.1.6 - postcss-safe-parser: 6.0.0(postcss@8.4.47) - postcss-selector-parser: 6.1.2 + picocolors: 1.1.1 + postcss: 8.5.26 + postcss-safe-parser: 7.1.0(postcss@8.5.26) + postcss-selector-parser: 7.1.6 postcss-value-parser: 4.2.0 - resolve-from: 5.0.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - style-search: 0.1.0 - supports-hyperlinks: 3.1.0 + string-width: 8.3.0 + supports-hyperlinks: 4.6.0 svg-tags: 1.0.0 - table: 6.8.2 - write-file-atomic: 5.0.1 + table: 6.9.0 + write-file-atomic: 7.0.1 transitivePeerDependencies: - supports-color - typescript + supports-color@10.2.2: {} + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -9027,10 +8611,10 @@ snapshots: dependencies: has-flag: 4.0.0 - supports-hyperlinks@3.1.0: + supports-hyperlinks@4.6.0: dependencies: - has-flag: 4.0.0 - supports-color: 7.2.0 + has-flag: 5.0.1 + supports-color: 10.2.2 supports-preserve-symlinks-flag@1.0.0: {} @@ -9049,7 +8633,7 @@ snapshots: symbol-tree@3.2.4: optional: true - table@6.8.2: + table@6.9.0: dependencies: ajv: 8.17.1 lodash.truncate: 4.4.2 @@ -9118,8 +8702,6 @@ snapshots: text-extensions@1.9.0: {} - text-table@0.2.0: {} - three@0.127.0: {} through2@2.0.5: @@ -9178,24 +8760,12 @@ snapshots: trim-newlines@3.0.1: {} - trim-newlines@4.1.1: {} - - tsconfig-paths@3.15.0: + ts-api-utils@2.5.0(typescript@5.9.3): dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - - tslib@1.14.1: {} + typescript: 5.9.3 tslib@2.7.0: {} - tsutils@3.21.0(typescript@5.9.3): - dependencies: - tslib: 1.14.1 - typescript: 5.9.3 - tsx@4.19.3: dependencies: esbuild: 0.25.2 @@ -9218,16 +8788,12 @@ snapshots: type-fest@0.18.1: {} - type-fest@0.20.2: {} - type-fest@0.21.3: {} type-fest@0.6.0: {} type-fest@0.8.1: {} - type-fest@1.4.0: {} - typed-array-buffer@1.0.2: dependencies: call-bind: 1.0.7 @@ -9262,6 +8828,17 @@ snapshots: typedarray@0.0.6: {} + typescript-eslint@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3))(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/parser': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@5.9.3) + eslint: 10.13.0(jiti@2.7.0) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + typescript@5.9.3: {} uc.micro@1.0.6: {} @@ -9284,6 +8861,8 @@ snapshots: dependencies: '@fastify/busboy': 2.1.1 + unicorn-magic@0.4.1: {} + universal-user-agent@6.0.1: {} universalify@0.2.0: @@ -9315,8 +8894,6 @@ snapshots: util-deprecate@1.0.2: {} - v8-compile-cache@2.4.0: {} - validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 @@ -9324,6 +8901,8 @@ snapshots: validator@13.15.35: {} + verkit@0.5.0: {} + vite-plugin-tdoc@2.0.4(@types/markdown-it@12.2.3): dependencies: diacritics: 1.3.0 @@ -9339,7 +8918,7 @@ snapshots: transitivePeerDependencies: - '@types/markdown-it' - vite@6.3.1(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): + vite@6.3.1(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): dependencies: esbuild: 0.25.2 fdir: 6.4.3(picomatch@4.0.2) @@ -9350,13 +8929,13 @@ snapshots: optionalDependencies: '@types/node': 22.20.4 fsevents: 2.3.3 - jiti: 1.21.6 + jiti: 2.7.0 less: 4.9.1 terser: 5.33.0 tsx: 4.19.3 yaml: 2.9.1 - vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): + vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): dependencies: esbuild: 0.25.2 fdir: 6.5.0(picomatch@4.0.7) @@ -9367,13 +8946,13 @@ snapshots: optionalDependencies: '@types/node': 22.20.4 fsevents: 2.3.3 - jiti: 1.21.6 + jiti: 2.7.0 less: 4.2.0 terser: 5.33.0 tsx: 4.19.3 yaml: 2.9.1 - vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): + vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1): dependencies: esbuild: 0.25.2 fdir: 6.5.0(picomatch@4.0.7) @@ -9384,16 +8963,16 @@ snapshots: optionalDependencies: '@types/node': 22.20.4 fsevents: 2.3.3 - jiti: 1.21.6 + jiti: 2.7.0 less: 4.9.1 terser: 5.33.0 tsx: 4.19.3 yaml: 2.9.1 - vitest@5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)): + vitest@5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)): dependencies: '@types/chai': 5.2.3 - '@vitest/mocker': 5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) + '@vitest/mocker': 5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) chai: 6.2.2 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -9404,7 +8983,7 @@ snapshots: tinybench: 6.2.0 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.2.0)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) why-is-node-running: 3.2.1 optionalDependencies: '@types/node': 22.20.4 @@ -9414,10 +8993,10 @@ snapshots: transitivePeerDependencies: - msw - vitest@5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)): + vitest@5.0.3(@types/node@22.20.4)(@vitest/coverage-v8@5.0.3)(happy-dom@15.11.7)(jsdom@16.7.0)(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)): dependencies: '@types/chai': 5.2.3 - '@vitest/mocker': 5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) + '@vitest/mocker': 5.0.3(vite@6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1)) chai: 6.2.2 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -9428,7 +9007,7 @@ snapshots: tinybench: 6.2.0 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 6.4.3(@types/node@22.20.4)(jiti@1.21.6)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) + vite: 6.4.3(@types/node@22.20.4)(jiti@2.7.0)(less@4.9.1)(terser@5.33.0)(tsx@4.19.3)(yaml@2.9.1) why-is-node-running: 3.2.1 optionalDependencies: '@types/node': 22.20.4 @@ -9442,32 +9021,18 @@ snapshots: vue-component-type-helpers@3.3.11: {} - vue-eslint-parser@8.3.0(eslint@7.32.0): + vue-eslint-parser@10.4.1(eslint@10.13.0(jiti@2.7.0)): dependencies: - debug: 4.3.7(supports-color@5.5.0) - eslint: 7.32.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + debug: 4.4.3 + eslint: 10.13.0(jiti@2.7.0) + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 esquery: 1.6.0 - lodash: 4.17.21 semver: 7.8.5 transitivePeerDependencies: - supports-color - vue-eslint-parser@9.4.3(eslint@7.32.0): - dependencies: - debug: 4.3.7(supports-color@5.5.0) - eslint: 7.32.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.6.0 - lodash: 4.18.1 - semver: 7.6.3 - transitivePeerDependencies: - - supports-color - vue-i18n@11.4.12(vue@3.5.42(typescript@5.9.3)): dependencies: '@intlify/core-base': 11.4.12 @@ -9568,6 +9133,10 @@ snapshots: dependencies: isexe: 2.0.0 + which@7.0.0: + dependencies: + isexe: 4.0.0 + why-is-node-running@3.2.1: {} word-wrap@1.2.5: {} @@ -9594,9 +9163,8 @@ snapshots: wrappy@1.0.2: {} - write-file-atomic@5.0.1: + write-file-atomic@7.0.1: dependencies: - imurmurhash: 0.1.4 signal-exit: 4.1.0 ws@7.5.13: @@ -9605,7 +9173,7 @@ snapshots: xml-name-validator@3.0.0: optional: true - xml-name-validator@4.0.0: {} + xml-name-validator@5.0.0: {} xmlchars@2.2.0: optional: true @@ -9620,7 +9188,8 @@ snapshots: yaml@1.10.2: {} - yaml@2.9.1: {} + yaml@2.9.1: + optional: true yargs-parser@10.1.0: dependencies: @@ -9638,6 +9207,8 @@ snapshots: yargs-parser@20.2.9: {} + yargs-parser@22.0.0: {} + yargs@15.0.2: dependencies: cliui: 6.0.0 @@ -9676,4 +9247,13 @@ snapshots: y18n: 5.0.8 yargs-parser: 20.2.9 + yargs@18.2.0: + dependencies: + cliui: 9.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + string-width: 8.3.0 + y18n: 5.0.8 + yargs-parser: 22.0.0 + yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 470e88009..be4387553 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,3 @@ packages: - - "packages/*" - - "site" + - 'packages/*' + - 'site' diff --git a/site/.eslintignore b/site/.eslintignore deleted file mode 100644 index 31240d464..000000000 --- a/site/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -snapshot* -dist -lib -node_modules -common -cypress -script/test/cypress -_site -temp* -tdesign -plugins/tdoc -public -spline diff --git a/site/.eslintrc b/site/.eslintrc deleted file mode 100644 index 085be1045..000000000 --- a/site/.eslintrc +++ /dev/null @@ -1,50 +0,0 @@ -{ - "root": true, - "env": { - "browser": true, - "es2021": true - }, - "extends": ["standard", "prettier"], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "globals": { - "aegis": "readonly", - "NProgress": "readonly" - }, - "rules": { - "indent": ["error", 2] - }, - "overrides": [ - { - "files": ["*.ts", "*.tsx"], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"] - }, - { - "files": ["*.vue"], - "extends": ["plugin:vue/vue3-essential"], - "parser": "vue-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser" - }, - "plugins": ["vue", "@typescript-eslint"], - "env": { - "vue/setup-compiler-macros": true - }, - "rules": { - "vue/multi-word-component-names": 0, - "vue/no-deprecated-slot-attribute": 0 - } - }, - { - "files": ["*.d.ts"], - "parser": "@typescript-eslint/parser", - "rules": { - "no-undef": 0, - "no-unused-vars": 0 - } - } - ] -} diff --git a/site/commitlint.config.js b/site/commitlint.config.js deleted file mode 100644 index 422b19445..000000000 --- a/site/commitlint.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/site/contributor.html b/site/contributor.html index bbad22986..80aa1272e 100644 --- a/site/contributor.html +++ b/site/contributor.html @@ -1,4 +1,4 @@ - + diff --git a/site/index.html b/site/index.html index a2ce4e946..65d7523ba 100644 --- a/site/index.html +++ b/site/index.html @@ -1,4 +1,4 @@ - + diff --git a/site/package.json b/site/package.json index f6c176400..e7820597a 100644 --- a/site/package.json +++ b/site/package.json @@ -7,8 +7,6 @@ "preview": "vite preview", "site": "run-s build", "site:preview": "vite build --mode preview", - "lint": "eslint --ext .vue,.js,.ts,.tsx ./src", - "lint:fix": "eslint --ext .vue,.js,.ts,.tsx ./src --fix", "typecheck": "vue-tsc --noEmit" }, "dependencies": { @@ -27,37 +25,22 @@ "vue-router": "^4.5.1" }, "devDependencies": { - "@commitlint/cli": "^8.2.0", - "@commitlint/config-conventional": "^8.2.0", "@types/markdown-it": "^12.2.3", - "@typescript-eslint/eslint-plugin": "^5.6.0", - "@typescript-eslint/parser": "^5.6.0", + "@types/node": "^22.15.3", "@vitejs/plugin-vue": "^5.2.4", "autoprefixer": "^10.4.0", "cssnano": "^5.0.12", - "cz-conventional-changelog": "^3.0.2", - "eslint": "^7.32.0", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.25.3", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.2.0", - "eslint-plugin-vue": "^8.2.0", "gray-matter": "^4.0.3", "less": "^4.9.1", "npm-run-all": "^4.1.5", "postcss": "^8.4.5", - "rimraf": "^3.0.2", + "rimraf": "^6.1.3", "standard-version": "^7.0.1", "typescript": "^5.8.3", "vite": "^6.3.1", "vite-plugin-tdoc": "^2.0.0", "vue-tsc": "^2.2.10" }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } - }, "author": "tdesign", "license": "MIT" } diff --git a/site/plugins/icons-manifest/index.ts b/site/plugins/icons-manifest/index.ts index 9a210da4b..45cc4f103 100644 --- a/site/plugins/icons-manifest/index.ts +++ b/site/plugins/icons-manifest/index.ts @@ -4,7 +4,7 @@ import fs from 'fs'; import path from 'path'; import type { Plugin, ResolvedConfig } from 'vite'; -// @ts-ignore tdesign-icons-view/manifest has no type declarations +// @ts-expect-error tdesign-icons-view/manifest has no type declarations import { manifest } from 'tdesign-icons-view/manifest'; export default function iconsManifestPlugin(): Plugin { @@ -26,7 +26,7 @@ export default function iconsManifestPlugin(): Plugin { console.log(`[plugin-icons-manifest] 已生成 ${target}`); } catch (error) { const message = error instanceof Error ? error.message : String(error); - throw new Error(`[plugin-icons-manifest] 生成 icons-manifest.json 失败:${message}`); + throw new Error(`[plugin-icons-manifest] 生成 icons-manifest.json 失败:${message}`, { cause: error }); } }, }; diff --git a/site/postcss.config.js b/site/postcss.config.js index e8d68d4cc..7dd2c9cc3 100644 --- a/site/postcss.config.js +++ b/site/postcss.config.js @@ -5,13 +5,13 @@ const plugins = [ 'default', { discardComments: { - removeAll: true - } - } - ] - }) -] + removeAll: true, + }, + }, + ], + }), +]; module.exports = { - plugins -} + plugins, +}; diff --git a/site/spline/README.md b/site/spline/README.md deleted file mode 100644 index 92e09d272..000000000 --- a/site/spline/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## 用途 - -备份 spline 文件,文件最终要存放在 cdn 上 \ No newline at end of file diff --git a/site/spline/design/assets/runtime.js b/site/spline/design/assets/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/assets/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAA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aGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/color_dark/index.html b/site/spline/design/color_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/color_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/color_dark/runtime.js b/site/spline/design/color_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/color_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzf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9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/color_dark/scene.json b/site/spline/design/color_dark/scene.json deleted file mode 100644 index 2c67bad86..000000000 --- a/site/spline/design/color_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"8F3FEE45-CB93-4F4A-B4A1-0BF5C92A07DA","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,6.253766493690371,-265.3621309320789,-136.93014103745625,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"interaction":{"uuid":"15D710A4-77AB-4AC2-8EA4-02012E3CFAD4","selectedState":0,"states":["5E4A9400-2AA2-41D1-947C-80453A355309","4692111C-F918-43C7-9B04-8295C93D49B7"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"8F3FEE45-CB93-4F4A-B4A1-0BF5C92A07DA","state":"4692111C-F918-43C7-9B04-8295C93D49B7"}]}]},"geometry":"9E59FFA2-D08B-46EE-887F-5FE835DD119D","material":"CDE3F6EA-6EC0-499B-88C6-3915B8C9BB52"},{"uuid":"599ECB7C-524E-4CB0-A62B-303F0498DF8D","objectType":"Mesh3D","name":"Cylinder","matrix":[1,0,0,0,0,0.3420201433256691,0.9396926207859083,0,0,-0.9396926207859083,0.3420201433256691,0,97.00000000000003,25.273190235103726,21.10344976262664,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9D53EC7D-BE1D-432F-A28A-FF235567B3A7"},"geometry":"53662741-B7F9-40D3-8FEB-E815E7DAD4B2","material":"42282493-DFC6-45C8-A32C-960AB38D641B"},{"uuid":"904D53E1-DBAD-4C99-A505-B4CBCDF534B5","objectType":"EmptyObject","name":"Empty Object 3","matrix":[-2.220446049250315e-16,-0.9396926207859092,0.34202014332566893,0,1,0,3.3306690738754706e-16,0,-2.7755575615628914e-16,0.34202014332566866,0.9396926207859084,0,92.36935750304066,100.88776286038362,-43.34609616109829,1],"layers":1,"children":[{"uuid":"8A704905-9920-4EB0-8A3C-7BF0DE2B61AF","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"F0002527-B921-4654-900B-57DBBE5EADD0"},"geometry":"CE4ABFBC-8BF9-4AF3-ADF1-5FB9653748F9","material":"5E8C53F5-8655-4FD3-A514-6E14E3C16436"},{"uuid":"85193378-6124-4FAF-A38C-3D868A2D27EC","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"343D96F0-4297-4ABD-979B-75C6092A9F7F","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"85193378-6124-4FAF-A38C-3D868A2D27EC"}]}]},"geometry":"82976F0D-D2F6-4220-92C8-8B24F4A2497E","material":"61F3ABCB-896B-43F1-9957-18964A5E7942"},{"uuid":"6FB79A05-AD50-42D8-A2F9-AC2CCBDAE892","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"6B545488-F69F-44E1-825C-5C482B67603F","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"6FB79A05-AD50-42D8-A2F9-AC2CCBDAE892"}]}]},"geometry":"C679BE5A-C813-49C1-ABA8-3BAD42D2F74D","material":"A2B9175D-1913-48D7-9E2E-CEE54DB41A14"},{"uuid":"F5F6D84C-7CC2-47C6-8902-56CF344D8D93","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"A8CFA188-919B-47D2-8DE7-779CAA2D019B","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"F5F6D84C-7CC2-47C6-8902-56CF344D8D93"}]}]},"geometry":"98A0123B-31A1-4F9D-A204-FFF7F2B17C93","material":"A9E3B048-62F8-40A3-B4EC-D2B106775A91"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3CCD36E0-D42F-45BF-94CE-DA5575D36750","selectedState":0,"states":["77DD83DD-76DB-486B-8735-FC15842CFD3C","516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"904D53E1-DBAD-4C99-A505-B4CBCDF534B5","state":"516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2"}]}]},"enableHelper":true},{"uuid":"1C01D82F-FBC4-4751-955F-259459EF8F69","objectType":"EmptyObject","name":"Empty Object 2","matrix":[0.707106781186547,-0.6644630243886743,0.2418447626479751,0,0.7071067811865467,0.6644630243886737,-0.2418447626479749,0,-1.3877787807814454e-17,0.34202014332566866,0.9396926207859082,0,26.216145018242443,82.33863499681486,-15.459433210864475,1],"layers":1,"children":[{"uuid":"83F51A1C-E58B-475D-A132-A751401CA72C","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"EA861408-DF34-4749-9AA9-F708E674E132"},"geometry":"800A2C89-8DF6-49A8-9D18-816FEAA84CB2","material":"13B9F322-43C2-4C4A-9B08-346631383C34"},{"uuid":"B9A4DD37-FC66-4B61-9223-E89FBB8C97A0","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"5693BA94-EAB4-4741-B6A1-532E3530F474","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"B9A4DD37-FC66-4B61-9223-E89FBB8C97A0"}]}]},"geometry":"73FA593B-63F2-4A2D-A903-13C3BEF35631","material":"2F3708A5-3901-40AE-B08C-0F53C2FE4D9C"},{"uuid":"BB273F63-F8A1-481B-B443-D0A25AF83694","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"9D2EFB79-4782-43C9-A794-67C457F20D26","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"BB273F63-F8A1-481B-B443-D0A25AF83694"}]}]},"geometry":"18674ED6-3892-43BE-B470-58125BE07B82","material":"607DE5C4-BF57-4BF5-9E6E-A17EB4AFD851"},{"uuid":"AA5A6F72-B2DE-497C-9F06-7D5E8CA388E4","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"BC588BE4-0998-4E04-A20D-1311A5689446","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"AA5A6F72-B2DE-497C-9F06-7D5E8CA388E4"}]}]},"geometry":"140B3368-07D0-4C4D-9B7A-3548A6329B56","material":"04E1C454-C18C-4B45-863D-3AF2BD2B5368"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"C890FC99-5C3E-4DDE-8449-EDC5545AE731","selectedState":0,"states":["67628BDE-F203-4663-9F76-86CD8738CDEA","4FD49F00-A18B-483A-AD36-D46CB67C520D"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"1C01D82F-FBC4-4751-955F-259459EF8F69","state":"4FD49F00-A18B-483A-AD36-D46CB67C520D"}]}]},"enableHelper":true},{"uuid":"5D8ADD83-A33C-42CD-819E-E06E6A5C4E96","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,0,26.322278031459916,26.909599194303738,1],"layers":1,"children":[{"uuid":"34576422-2066-4423-B65E-CB5A3900E665","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"742A4D05-6ED6-4D57-A459-1BE08B0BE871"},"geometry":"2F714834-8007-40FE-B1E9-7B12803C94AC","material":"C1EC4767-C425-4D54-94EF-D4993BF11253"},{"uuid":"44973C8B-479D-4F2C-BFC7-AF470C6AAE6D","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"281B66BE-DFC6-41A3-ADDC-536B97057603","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"44973C8B-479D-4F2C-BFC7-AF470C6AAE6D"}]}]},"geometry":"8401F36A-E7F1-4927-B900-AC111B8F38B8","material":"EE4A3E0D-CC4E-4CD9-B30A-8CEDADE1FBE3"},{"uuid":"FCB2FF3B-9A54-41E9-8AEF-F55772F73D07","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"417AE671-C1F0-4F16-9DD7-A8E81207E877","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"FCB2FF3B-9A54-41E9-8AEF-F55772F73D07"}]}]},"geometry":"D31F8D61-59E6-45C1-905D-FD48D1FF0260","material":"ED7B9F17-CB2F-47E9-AD2A-76C810BEE129"},{"uuid":"F16FF680-3F5D-4600-87AB-E763926E242A","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"2BF334DC-3162-42EF-8D3A-0974C14B257A","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"F16FF680-3F5D-4600-87AB-E763926E242A"}]}]},"geometry":"7F7635D2-0192-4A82-88FF-F0948C682550","material":"CB4B5BCE-7A54-402E-BCE3-9C5E230F2BE2"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"2EC3346F-2151-4E69-A502-885599CC1171","selectedState":0,"states":["64E22259-32F3-4937-A231-B4BF21846298","15300E2D-5D5E-499A-A86C-6509919441AA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"5D8ADD83-A33C-42CD-819E-E06E6A5C4E96","state":"15300E2D-5D5E-499A-A86C-6509919441AA"}]}]},"enableHelper":true},{"uuid":"D2E262C1-77C2-44B6-921B-7A9E9E8D79E7","objectType":"CombinedCamera","name":"Camera","matrix":[0.9324227598223329,1.3877787807814455e-17,-0.36136933595049797,0,-0.11131732681956195,0.9513724059493865,-0.287226387972661,0,0.3437968145795576,0.3080430898398385,0.8870812843741405,0,-292.29755256328116,405.8508827843736,1100.3577001131177,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"82267438-18A9-4C53-B288-AA52690E4C35"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":999.9999999999959,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.5987369392383788,"nearOrtho":50,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"04890C0A-A143-4224-ACD2-0A58D1B14695","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-15.286007910624079,28.193893397430557,-161.37508197525244,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"interaction":{"uuid":"3CED1753-E540-47B4-80A8-DBA7D52364F8","selectedState":0,"states":["FB45152A-086E-4017-A1B9-90AD10E278B2","246E6078-E9F7-4306-B51A-114474566778"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"04890C0A-A143-4224-ACD2-0A58D1B14695","state":"246E6078-E9F7-4306-B51A-114474566778"}]}]},"geometry":"F05B6BA5-ADD4-4B53-8616-94D5C31C92E4","material":"D85EC0DE-2E4D-42EE-957A-B37B1360049C"},{"uuid":"D3888AA4-44FD-4125-9011-F50929E95FB8","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,34.16950113948363,15.799680549464426,-205.0808009164132,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"interaction":{"uuid":"159A56BB-B56D-40D8-9A2D-9B8E9BF6191B","selectedState":0,"states":["EB00B0DA-0673-40D7-980F-F8E1B0576DEE","2FA1C378-8809-42B2-B41B-0A704465EA60"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D3888AA4-44FD-4125-9011-F50929E95FB8","state":"2FA1C378-8809-42B2-B41B-0A704465EA60"}]}]},"geometry":"8DB9FE98-E9EE-4E14-8E17-9C4B1BFD8FD1","material":"0C3A14C0-5E5D-4D67-8727-082462F557F2"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.9739890765132867,-7.632783294297949e-17,-0.22659496647718003,0,-0.08063521393220369,0.9345407404879134,-0.3466000095822422,0,0.21176222776241782,0.3558561568503523,0.910232472791866,0,211.7622277624177,355.8561568503528,910.2324727918673,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000013,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"D2E262C1-77C2-44B6-921B-7A9E9E8D79E7","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"9E59FFA2-D08B-46EE-887F-5FE835DD119D","userData":{"parameters":{"width":135,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53662741-B7F9-40D3-8FEB-E815E7DAD4B2","userData":{"parameters":{"width":46,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":8,"cornerSegments":8,"hollow":0,"height":46,"depth":46,"radiusTop":23,"radiusBottom":23},"type":"CylinderGeometry"}},{"uuid":"CE4ABFBC-8BF9-4AF3-ADF1-5FB9653748F9","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"82976F0D-D2F6-4220-92C8-8B24F4A2497E","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"C679BE5A-C813-49C1-ABA8-3BAD42D2F74D","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"98A0123B-31A1-4F9D-A204-FFF7F2B17C93","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"800A2C89-8DF6-49A8-9D18-816FEAA84CB2","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"73FA593B-63F2-4A2D-A903-13C3BEF35631","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"18674ED6-3892-43BE-B470-58125BE07B82","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"140B3368-07D0-4C4D-9B7A-3548A6329B56","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"2F714834-8007-40FE-B1E9-7B12803C94AC","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"8401F36A-E7F1-4927-B900-AC111B8F38B8","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"D31F8D61-59E6-45C1-905D-FD48D1FF0260","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"7F7635D2-0192-4A82-88FF-F0948C682550","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"F05B6BA5-ADD4-4B53-8616-94D5C31C92E4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8DB9FE98-E9EE-4E14-8E17-9C4B1BFD8FD1","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}}],"materials":[{"uuid":"CDE3F6EA-6EC0-499B-88C6-3915B8C9BB52","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9E7478FA-BD99-4BA6-B58B-80A7AFBCAE56","f1_mode":"498878D4-98A3-434E-BAEA-7AA726F1617A","f1_shininess":"64D8B96C-FF7C-4CAB-AC8B-C011CF4818D2","f1_specular":"FBECE1BD-42FD-4DCE-B5AB-26A92C4D96F1"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"C99745BC-14B3-4DC7-8721-62DF3DB4E806","f2_ior":"3011E041-2620-4054-BBCB-DD8B55589BF4","f2_roughness":"90D63B37-DEF5-492C-A31D-B5C9FFEE7865","f2_transmissionSamplerSize":"17897827-A1C9-4092-9DB1-7E7BD7024D82","f2_transmissionSamplerMap":"9776D8B2-361C-412B-9489-3E13221D2DA9","f2_transmissionDepthMap":"863C4B32-5A61-4B3D-B1E9-B8B6A06A89DB","f2_aspectRatio":"6747F167-7ACD-4090-9795-193C2A043FB9","f2_alpha":"36DD701E-C63A-41C4-98FD-B616F3A6D6AB","f2_mode":"6E9EFEE7-7338-4EE6-86BB-C682C9B47C00"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E6270D3A-B200-42F0-83FC-4EA87698A763","f4_far":"3893B357-7D2D-458A-89EC-32D8F33BB3A8","f4_isVector":"C4C2F112-B267-4F63-ACBB-6687444EADC6","f4_isWorldSpace":"F86516BD-C499-4A99-975B-0FAF8A2A9473","f4_origin":"F42FF326-04F8-4857-AB15-F987402267F0","f4_colorA":"01443ADE-A1D6-47DC-B32C-A23BFB43401A","f4_colorB":"D8DD55CD-B100-458E-96B7-97E84FADBECE","f4_alpha":"C4761A44-EFF3-4772-8A2D-279306C04FE2","f4_mode":"B100FD29-3CA7-4955-B4D8-610656EB69F8"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F5582F37-4C60-4C98-9859-3F232EB3282C","f3_bias":"92376BC6-BA71-4837-9017-3139EAFCB57B","f3_scale":"A1C86F12-374E-4472-A010-3430D079F1AA","f3_intensity":"09A5CA1F-EA45-4340-9360-19561F16A419","f3_factor":"E97156BB-0508-49A1-8EE7-549DB2D6AD65","f3_alpha":"55F50552-1310-483E-8012-336C46A5F8F1","f3_mode":"17023741-A20E-4DDE-A983-396B8FF49FFD"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"050A23BD-C19F-4E9E-AAAB-8596D8D4A964","fragment":"050A23BD-C19F-4E9E-AAAB-8596D8D4A964"},{"uuid":"42282493-DFC6-45C8-A32C-960AB38D641B","type":"ShaderMaterial","reflectivity":{"uuid":"5424BF01-EAC4-4889-97A2-FC83BBC48557","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"37C2A27C-ED51-469B-BF55-A718D62D6868","f0_alpha":"250DF8E3-8A81-434E-8293-F20CF4609C38","f0_mode":"8B231016-3918-48CD-8BA3-F35E610B0A23"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"22398205-756D-432F-9F26-997A2FE82742","f1_mode":"79F1B885-ED20-49B0-AA9C-42403C442DEE","f1_roughness":"B02949DE-5FA6-48C1-A502-D22D950090A7","f1_metalness":"E4292578-DC32-4CB1-B299-6B30B03407D9","f1_reflectivity":"5424BF01-EAC4-4889-97A2-FC83BBC48557"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"61525417-BD98-42D5-A3D6-ECF046593686","fragment":"61525417-BD98-42D5-A3D6-ECF046593686"},{"uuid":"5E8C53F5-8655-4FD3-A514-6E14E3C16436","type":"ShaderMaterial","reflectivity":{"uuid":"22A5B848-50B5-442A-92D0-6A2B07213382","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D227FDE6-BE8F-4647-8C41-CA47E3254BF2","f0_alpha":"9C7D187B-0888-498D-AF85-002EA69C97F0","f0_mode":"BADBE7D4-C9CB-463E-98CB-58068EAF2AFF"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"35C2F447-C3C5-4DC6-9A3A-1C8CAE6D3B9D","f1_mode":"97F8E25A-FB49-4F3A-9B79-79AD4C635F31","f1_roughness":"E57BA1C9-B5B1-435D-B115-466D7E50920F","f1_metalness":"5F7ECA52-2480-414F-9CE6-E5132D711ACA","f1_reflectivity":"22A5B848-50B5-442A-92D0-6A2B07213382"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"0ADFF76E-CA89-41C5-9CD2-F685879D8D83","fragment":"0ADFF76E-CA89-41C5-9CD2-F685879D8D83"},{"uuid":"61F3ABCB-896B-43F1-9957-18964A5E7942","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"FCC4E168-43FB-4E3A-A4CA-B940838A7C3B","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"531E46D1-69CC-4C21-9A24-71BD2E39E90B","f1_mode":"79CE6F8A-F674-49FA-930B-04FA95CE684B","f1_shininess":"7C6176F9-6D27-48E1-9EFC-2A77284C5382","f1_specular":"3D935F6A-36DE-48F3-B9C1-2D65E578A4E5"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"A282F0D1-11B1-46BD-8E4A-C14BF736808A","f6_alpha":"A6EE8592-B8F3-4BC4-A7C9-EDC2A8A20F52","f6_mode":"E296B295-0274-4BA2-8179-A9B7ACC583C3"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"92A12B33-AD71-4C99-96C2-E8A1C454055A","fragment":"92A12B33-AD71-4C99-96C2-E8A1C454055A"},{"uuid":"A2B9175D-1913-48D7-9E2E-CEE54DB41A14","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"AD850D2B-1D5E-4A53-99F1-D3D51103C40E","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9F4FD659-5309-4D0E-A258-BD2641952C88","f1_mode":"4C9FDD08-7631-473B-804B-E6936C6A0E9E","f1_shininess":"39D7E48D-F231-4B97-A644-76491EB4C1D1","f1_specular":"F5BED1E3-13FE-493B-AF8B-9E4F5B1B2BDA"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"80EDC655-2440-4D9D-8190-50C843609774","f6_alpha":"3D8E10A2-772B-426D-B1B3-683643BF4BF9","f6_mode":"0E0A6331-A7D7-4C24-9BFC-E018A35ED26E"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"7E9B1BE8-EE6F-4B28-9ECC-9D8F697C6992","fragment":"7E9B1BE8-EE6F-4B28-9ECC-9D8F697C6992"},{"uuid":"A9E3B048-62F8-40A3-B4EC-D2B106775A91","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"E4ECF01A-DB90-4BB1-8CD9-372DAA92B7C9","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E30967B6-4FA9-40D3-A08E-63750CC3FC20","f1_mode":"66EEC166-5016-426E-91AE-D800C0C9C48E","f1_shininess":"D11044CC-52B2-45B7-B221-05C206D2CC76","f1_specular":"B835AF68-238C-4D0F-A107-E197037CB999"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"CA352DF4-3FE2-44C6-9B4F-939CF9A714A7","f6_alpha":"D8D4D757-2562-42E3-8295-7515F9AEF78B","f6_mode":"FAAE434F-19EF-426F-B590-3D5B97C26678"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"E47F2C81-8397-4D07-9ABF-980B32C21815","fragment":"E47F2C81-8397-4D07-9ABF-980B32C21815"},{"uuid":"13B9F322-43C2-4C4A-9B08-346631383C34","type":"ShaderMaterial","reflectivity":{"uuid":"A718CDEA-2BE3-40C2-9E33-B2E7D415ACCF","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"70EB799C-AC3F-4F96-82AB-798B7C625A23","f0_alpha":"75CAF392-7F58-43F1-BA2B-CEDEFC1B39D1","f0_mode":"1753D490-C02D-4569-B6FE-29C270C41593"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2CC0FE91-54AE-4EC4-BD04-B76A0418A7AC","f1_mode":"97AFA80D-B6C2-42FA-8457-0655BAAB5172","f1_roughness":"14F6CFE3-B61E-4970-82BD-A332E96586B6","f1_metalness":"0D88F982-8E0D-41F3-A3F0-C6009A9A01BE","f1_reflectivity":"A718CDEA-2BE3-40C2-9E33-B2E7D415ACCF"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"911D6ACB-3203-41FE-9308-8F1C735A8CD8","fragment":"911D6ACB-3203-41FE-9308-8F1C735A8CD8"},{"uuid":"2F3708A5-3901-40AE-B08C-0F53C2FE4D9C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"2C3830A5-CD8F-4100-A801-4C711AECE47C","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0E5C8158-EE14-4FC1-A22E-96A8F4999B93","f1_mode":"2C66283A-16EE-48D8-BE08-9A9DE35745B7","f1_shininess":"4136AE41-B5CD-4CB1-8E37-3A176B0E8D90","f1_specular":"9BF2404C-DEBC-4256-8E7B-2F9DC22FDB2A"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"7750B68B-017C-41A0-9470-9C216F24EBB9","f6_alpha":"91019350-70D2-43D1-872A-57E587C98BF0","f6_mode":"536237BC-73FB-4DB3-B898-1A73AF353817"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"60D4435D-1084-4FA6-AF4A-36A37F40BF3A","fragment":"60D4435D-1084-4FA6-AF4A-36A37F40BF3A"},{"uuid":"607DE5C4-BF57-4BF5-9E6E-A17EB4AFD851","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"50B7FD24-DF77-4EB1-813F-4514DBECE5CB","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"32DE2B5C-7424-4E2A-AC5D-E7E0233F325B","f1_mode":"C9FBD05E-A1FD-4DD4-8215-214B271B5F0C","f1_shininess":"2972A745-E6E2-4355-971F-959CC2FA0DA8","f1_specular":"EE4BFEC3-2A63-48FE-9627-76F68693A6CB"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"9588D976-29A9-4C29-BDD8-F1411980F464","f6_alpha":"4DE6F303-24F5-43F5-A507-44255BE90F7D","f6_mode":"D131D230-7594-483A-B942-8D762586EE5E"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"BDF0EFA9-C69B-4D7A-B449-8F8F666F7346","fragment":"BDF0EFA9-C69B-4D7A-B449-8F8F666F7346"},{"uuid":"04E1C454-C18C-4B45-863D-3AF2BD2B5368","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"1AEEAA41-B402-467C-83F3-3BDF10F7C02B","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2BA13361-FB94-45D2-854F-C111395F145F","f1_mode":"F9FA2E32-F570-4617-9287-6CCC99C66597","f1_shininess":"178BF9AE-0356-47CD-876B-E6C0BA6DBFD0","f1_specular":"F98B7DED-77FC-4B06-9DF1-DB259217ACEA"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"FD589FB1-906D-4A93-B1B5-159AD86C3065","f6_alpha":"EB42E38A-CD9B-4D09-9CF3-DB4D401D00E4","f6_mode":"78D67173-EA5A-4BB3-9022-42C8B2DF8EA2"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"066795CA-302A-4B46-8D7A-30CB6529243F","fragment":"066795CA-302A-4B46-8D7A-30CB6529243F"},{"uuid":"C1EC4767-C425-4D54-94EF-D4993BF11253","type":"ShaderMaterial","reflectivity":{"uuid":"CE56EDF5-0045-4996-B777-B1BFCB63E1CF","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"13B80439-87CF-48FC-9F82-D0D5C0DDAAC9","f0_alpha":"62A2EA2D-D54C-418F-8352-6483C1112EED","f0_mode":"7489BC88-CDC8-4009-B056-58B933A17D29"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"069F0EE7-516B-4010-9606-70DC031F6C4E","f1_mode":"FC9D9D6C-2D9F-4DB5-B88D-1C45D6CBAC1B","f1_roughness":"5B560F70-91AA-487E-86B9-3ECDF34D684A","f1_metalness":"2B885091-6098-40EB-9536-D571F23EDDE3","f1_reflectivity":"CE56EDF5-0045-4996-B777-B1BFCB63E1CF"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"E3862300-47C5-4C28-924A-562169390EBC","fragment":"E3862300-47C5-4C28-924A-562169390EBC"},{"uuid":"EE4A3E0D-CC4E-4CD9-B30A-8CEDADE1FBE3","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"AA5A4A9F-8DF3-4989-A5EC-0A24C31EF3CF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4F741864-DE92-4DE3-8B3D-3E626B2C42B4","f1_mode":"CEC8D0B1-F4DE-407F-BA31-5C5333F85436","f1_shininess":"1DE44886-7338-4609-9AE7-0522D61E6E40","f1_specular":"FA09C49F-119B-4557-A84C-0A9C7028B4F3"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"A238253E-AC25-441B-964F-9BAE12471E3C","f6_alpha":"1BAC809C-21AD-4D30-A240-CCBDD995CD60","f6_mode":"312694D2-7991-4C3C-A4A0-A2FC203413D0"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"7EE67ECE-A2B1-4F4D-97CC-4DAF09577867","fragment":"7EE67ECE-A2B1-4F4D-97CC-4DAF09577867"},{"uuid":"ED7B9F17-CB2F-47E9-AD2A-76C810BEE129","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"C2219551-0625-4E80-A0F0-20A117AEC72A","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6C3A977B-2A5F-4E61-B75C-F1212E7FF2D7","f1_mode":"CE248D91-7242-4F7F-8783-BC4ACC1B12D3","f1_shininess":"77C4369C-C1F7-4DA4-96D3-FCB3872969D4","f1_specular":"8FCDA9AF-2655-41E8-900D-148F7B1531D9"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"B36B0B8C-9102-491D-BDFF-066F245770E0","f6_alpha":"52BEFAA6-4199-4AE7-95F4-AC2B9C905E82","f6_mode":"F06AD8B8-FBBA-4D7B-B370-A6F918EEE18E"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"0360B18A-3B70-4039-B4B2-8CC962254A41","fragment":"0360B18A-3B70-4039-B4B2-8CC962254A41"},{"uuid":"CB4B5BCE-7A54-402E-BCE3-9C5E230F2BE2","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":7,"uuid":"A031F1D9-D39B-4E37-8AD8-D4AB520ED6B5","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E1AEFCD6-3586-4F56-9BB4-858E013AADD9","f1_mode":"2F954DCF-579E-483D-9733-8A39D7BB96E8","f1_shininess":"D664CAC9-4112-49F7-AB0E-934BE36423CE","f1_specular":"5AFC23A8-B0C3-45BE-9D15-80F9F3CAEC3E"},"next":{"id":6,"type":"color","defines":{},"uniforms":{"f6_color":"BB9E6E99-54E3-440D-BBC4-71C918CDD548","f6_alpha":"83D36540-09C6-440C-9EC1-CFC3404444EF","f6_mode":"19492D45-9EAB-411D-8D19-E1BE2ADC09B6"}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true},"vertex":"52777008-E6C1-4A29-B983-EC9D834DA076","fragment":"52777008-E6C1-4A29-B983-EC9D834DA076"},{"uuid":"D85EC0DE-2E4D-42EE-957A-B37B1360049C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7E4C4C8D-C551-4F3C-B3C5-9308D612D35F","f1_mode":"AFC68500-0351-4CDD-B47B-A3470433E618","f1_shininess":"A781A753-D516-44B4-BE48-5998674F139F","f1_specular":"2700F314-FE44-46F4-BCD7-F03E688A33FE"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5F31136F-788A-43AD-A3C9-6473C2444ABF","f2_ior":"95FEC886-4129-4798-8616-FB5D1561F34F","f2_roughness":"E1810BE3-71A9-4014-8968-64D2D54E29AD","f2_transmissionSamplerSize":"1863A5F3-5C55-42F0-B6BC-A918F1FEBA91","f2_transmissionSamplerMap":"94AB6543-3E81-464D-9BD9-F38063A460FF","f2_transmissionDepthMap":"0AEA62A9-DE09-4E4E-A37B-A3550206451A","f2_aspectRatio":"F61B9108-543A-4006-9F54-3C21F11D3FDE","f2_alpha":"AC414F29-36E3-496C-A207-E294396A12E4","f2_mode":"BA76B718-5A3D-45EB-B034-298BF3A0E119"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"8885CA79-804F-4AE4-BCFC-CBA31227CACE","f4_far":"E4916D9F-97A7-4D9A-B872-6779050A13E0","f4_isVector":"DAA2A3F4-8F00-4753-874B-E3637C73728E","f4_isWorldSpace":"DD9D3E03-D409-4867-B097-A29CFED41E84","f4_origin":"630F85AA-3925-49B3-A816-844D73B65CC4","f4_colorA":"5338DDA3-440E-4B45-A90F-3E3364E2B844","f4_colorB":"2E5F33E0-9E98-41EB-A115-C4BA62154CE0","f4_alpha":"CB5787BC-99F5-4790-BBA3-41B167319992","f4_mode":"CD60D244-D4C5-483C-A04D-0C88287BFE20"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"BBC941CA-8007-4D8C-8175-04A75F60D504","f3_bias":"1A2A58AE-D9B9-4B46-81E8-2E89B2260896","f3_scale":"A02BFCCF-5068-4871-BA03-1B43FD7C424C","f3_intensity":"30085517-3216-4D42-A496-B647055BCD87","f3_factor":"5C72B8EE-3EA3-4AF6-81E9-9999CDBE0509","f3_alpha":"8C3FB356-8C09-4599-950C-BDA4876FC9F9","f3_mode":"8E7FED9A-EF64-4A14-BA30-C2B35B2DC30A"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"8D116142-FDD6-4CD7-90C9-933DCD0E6C8D","fragment":"8D116142-FDD6-4CD7-90C9-933DCD0E6C8D"},{"uuid":"0C3A14C0-5E5D-4D67-8727-082462F557F2","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1E8FD43A-5015-44C4-9491-1B5451E472B8","f1_mode":"6CC4C4DA-EE72-4F15-9D99-0F60A5D932A7","f1_shininess":"CE547A02-BC68-4042-88F5-86C445D3AC24","f1_specular":"86BC5AA3-8898-40C3-B9D1-7C9D961BA895"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"FE3D41F7-C876-4C06-871D-EF75EAA3E386","f2_ior":"413DFC53-6134-42E4-879F-7714B4A3492A","f2_roughness":"259373AD-0EC8-4580-A1C7-A7FCF75CC907","f2_transmissionSamplerSize":"A35269A9-2460-49BC-82D8-6F744F4AAEEF","f2_transmissionSamplerMap":"E6F56D68-132A-488E-B02E-F5FED397AF9A","f2_transmissionDepthMap":"5245FE45-E6D0-46FC-B363-B263886A40DB","f2_aspectRatio":"59E39853-39F6-4636-B5F6-7D1F79C8D615","f2_alpha":"95180440-1EC3-43DA-B555-8E20521C7DD3","f2_mode":"CDFBA816-ADCF-4FD7-BCDB-B45FE5A3E87B"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C8A3685F-FE27-411F-9534-262A36A3BBAE","f4_far":"0C7A3782-32F2-4635-BEAF-6948AD17FBAA","f4_isVector":"C4EFE700-C79B-4E49-8D34-102EDBF50A8A","f4_isWorldSpace":"774E1698-CA6D-42F7-8C4A-CB09E678F48D","f4_origin":"84C4DEC6-9264-4A02-B654-65FFE9582288","f4_colorA":"95FB1ABC-EDEF-40C3-941F-B2D5BF6D88F6","f4_colorB":"66C1AB90-56B7-4ACD-81E0-DF5DE829CD64","f4_alpha":"70204401-8C6B-40A3-BF0B-7562A3CFDF10","f4_mode":"6206CA43-6E82-4964-95CF-E6EC228BC619"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"52245CAE-10D7-42E9-A8F8-043347B53D7E","f3_bias":"F50AD037-D69D-43A2-82F9-C274F260DDAF","f3_scale":"33B61EC1-87BF-40AA-9BEB-D1C54B8EFA4A","f3_intensity":"632DD93E-DC93-4F9A-8BB5-8821E02BB74B","f3_factor":"66BE0959-BE9D-41CD-B2B1-510D82CE1181","f3_alpha":"81360BCD-76BA-4777-9EFC-D8B5CC710C24","f3_mode":"457C39B3-A089-4147-BE7A-FFEB45CEF88F"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"4049BC7D-E1B6-497F-9A63-5B8F1AEA55FD","fragment":"4049BC7D-E1B6-497F-9A63-5B8F1AEA55FD"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"5E4A9400-2AA2-41D1-947C-80453A355309","name":"Base State","position":[6.253766493690371,-265.3621309320789,-136.93014103745625],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"geometry":{"width":135,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3FD509E4-D29F-44D0-8385-BBF6BD0E6E79","f1_mode":"2BEC0B9A-FF89-461C-8228-48E7EEF58C0C","f1_shininess":"34A229F1-E6F3-450E-9F09-161077DC1725","f1_specular":"02B25C34-F7D3-45ED-A928-7EEC3667B29A"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8D060A30-08E0-44AE-903F-907600532258","f2_ior":"D1207446-9F39-40CE-A75C-6ABCACE12AA4","f2_roughness":"EC22E06E-F6C3-4731-A5ED-17CC11E50E75","f2_transmissionSamplerSize":"31B7C321-934B-4D9E-AB93-8B0ABEDC99CB","f2_aspectRatio":"26F12D52-84DA-42DB-8F51-2221350A68E1","f2_alpha":"662697F3-AD24-4B45-A1D8-7D873C8FE65C","f2_mode":"6CD9C06D-8612-4F72-9BC9-0AD1193DB12E"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E942A68A-92ED-416D-990A-F48AD4E9010D","f4_far":"544BDB2D-8B34-4866-8823-F2CFAD321AFE","f4_isVector":"FCDC664F-C276-41D0-87B0-4BFB8294766A","f4_isWorldSpace":"BF9FF54E-0C05-4CA2-A524-D99E4438551E","f4_origin":"348CE39A-B8D3-4558-88F9-CA98472DF456","f4_colorA":"B9F40593-9F2E-478A-8984-077C81F074B7","f4_colorB":"650BCE79-92CF-4B07-A9FC-A12A7DE51F92","f4_alpha":"A595456A-89D5-433C-8BCC-481322959BBE","f4_mode":"269AB9BE-413C-4420-9856-CCD28C65DE34"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3A81777B-429B-4BEE-8807-2951447D6D1D","f3_bias":"6E20C87B-1531-43ED-924A-4CBF0B5BFDD4","f3_scale":"16FAF660-29B2-4EA1-91D3-3B4957D1F243","f3_intensity":"18EEA906-B475-409F-838F-6F38507B0F0F","f3_factor":"F562414C-A6CF-4790-A20B-C60D5A936230","f3_alpha":"818C847C-7256-4A75-A0AD-5AB92DC7F75B","f3_mode":"3EC9FB7D-002E-4D26-A3B5-48CAB7B3DA37"}}]}},{"uuid":"4692111C-F918-43C7-9B04-8295C93D49B7","name":"State 1","position":[6.253766493690371,-265.3621309320789,-136.93014103745625],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"geometry":{"width":135,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6FDB754A-BA97-41A0-83C6-97E88A9E0B0D","f1_mode":"FE1D8C1A-E8BB-4DE3-B498-8CA37BE63B7D","f1_shininess":"BA282683-1513-4D75-B592-0BCD2689622B","f1_specular":"55E446CD-E60E-4E95-A065-5388679AC329"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"3DC2CCBE-C1E6-40F7-9D1C-45131F8C04F1","f2_ior":"ECF02394-A5B4-4836-B0B8-969AE4F1805E","f2_roughness":"B0114E1C-5D1F-44ED-959F-C23A0A548AD2","f2_transmissionSamplerSize":"9900BFA4-B2E7-4FAF-A7C9-399F8C9377F6","f2_aspectRatio":"5A9DD2C4-50FF-479A-B97E-2102E641B36B","f2_alpha":"183FE5E5-EE9D-4779-A031-716C1B4A6518","f2_mode":"B6240B2F-4ADC-4212-88EA-125982A8010A"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"B2198C8A-DD6E-45EF-A973-47D057DFE193","f4_far":"F52CBD38-183C-4BA7-A918-AFCB79049F50","f4_isVector":"DB372C75-958F-4CEE-80C0-49BBF7C4352E","f4_isWorldSpace":"76A2F5AE-C9AD-4E65-8594-2488754CF4D6","f4_origin":"00A8855E-60DF-4838-AAFF-0DD34BCB594D","f4_colorA":"71E0BDA6-CB9E-4D8D-8A08-022E98AD9C6F","f4_colorB":"D248AC28-C65E-4D24-BD35-DCB3C64C59F4","f4_alpha":"C26BECA6-8D83-4E95-B92B-59CE1C9CBC55","f4_mode":"5BAAE0B5-038A-41E2-9F8C-9327AC996113"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"CB8A0C51-5F4A-4B6D-A254-FD664F50B5BB","f3_bias":"ACCD410B-9BB1-477D-9622-301DB3608E39","f3_scale":"2777A5B0-8851-494D-A242-61ACB0F2CDB9","f3_intensity":"BF35D9F5-7808-4770-A7A2-98D16F183896","f3_factor":"17E988CB-B3F7-4187-ABBA-185A1D08A4D2","f3_alpha":"7FC8E1C8-9D02-4C54-95F8-B1965B79D56F","f3_mode":"F7359F02-20F4-4F7D-AE80-8628D828EF39"}}]}},{"uuid":"77DD83DD-76DB-486B-8735-FC15842CFD3C","name":"Base State","position":[92.36935750304066,100.88776286038362,-43.34609616109829],"rotation":[-0.34906585039886595,-2.220446049250313e-16,-1.570796326794897,"XYZ"],"scale":[1.0000000000000009,1.0000000000000004,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2","name":"State 1","position":[92.36935750304066,100.88776286038362,-43.34609616109829],"rotation":[-0.3490658503988659,-2.498001805406602e-16,-1.5889800452763108,"XYZ"],"scale":[1.000000000000003,1.0000000000000022,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"67628BDE-F203-4663-9F76-86CD8738CDEA","name":"Base State","position":[26.216145018242443,82.33863499681486,-15.459433210864475],"rotation":[-0.34906585039886595,0,-0.7853981633974485,"XYZ"],"scale":[0.9999999999999993,0.9999999999999988,0.9999999999999998],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"4FD49F00-A18B-483A-AD36-D46CB67C520D","name":"State 1","position":[26.216145018242443,82.33863499681486,-15.459433210864475],"rotation":[-0.3490658503988661,1.1102230246251565e-16,-0.8032480444141423,"XYZ"],"scale":[1,1,0.999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"64E22259-32F3-4937-A231-B4BF21846298","name":"Base State","position":[0,26.322278031459916,26.909599194303738],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"15300E2D-5D5E-499A-A86C-6509919441AA","name":"State 1","position":[0,26.322278031459916,26.909599194303738],"rotation":[-0.34906585039886623,0,-0.016753365040717234,"XYZ"],"scale":[0.9999999999999961,0.9999999999999991,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"FB45152A-086E-4017-A1B9-90AD10E278B2","name":"Base State","position":[-15.286007910624079,28.193893397430557,-161.37508197525244],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D85A577C-7881-43E5-9A06-6094F8ACAF0D","f1_mode":"65102FAB-2F55-4831-8CDF-861CE72DC5F3","f1_shininess":"D141E138-371D-4D50-B448-6852532A1E2B","f1_specular":"9EA0E336-B9BF-42C0-8771-1A72D981F45F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B3B9B2F7-D5AE-42C3-8B85-B49267027662","f2_ior":"BF22D190-16D5-4979-8E25-9F2EC107AFB6","f2_roughness":"E9AAC8EC-A9C5-4C8E-86D1-E4A175798395","f2_transmissionSamplerSize":"BFD13CD4-6EDC-4476-A041-5D720C5B2A82","f2_aspectRatio":"EF9DFE07-0CEE-4883-B301-B33DAC974C68","f2_alpha":"2EF72EC2-03A7-4328-BFCB-A935FDB1E4E2","f2_mode":"1B0D4A59-32A7-4422-9BA3-B9B57E4405A8"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"1C3B2493-11C9-48B2-BDA9-4BBEE3BD3DFE","f4_far":"86A41103-CBE5-4618-9860-CB37E01CD45F","f4_isVector":"490113CD-118D-411A-ACF5-8861407ED55B","f4_isWorldSpace":"E81536CE-5641-4D3E-8B54-82F610B31240","f4_origin":"B241C56F-46A6-4E0C-89A2-A9078B8F7CCD","f4_colorA":"C4244EA8-9D41-42AB-BDF7-6C9DD20EE95F","f4_colorB":"74E73578-920F-45EE-BAB5-152B61A85C63","f4_alpha":"E56EBAB9-9087-4712-8AC9-D06EF2F25005","f4_mode":"784962D7-4E37-4675-9FC3-0C527F376BE7"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D98E3CD8-7976-4D03-B015-D5234A2A0505","f3_bias":"3F240F39-61FA-440C-B711-ABA946D32D06","f3_scale":"F7FF2954-2453-47C0-9A9F-82398DF2F0BF","f3_intensity":"577B9A2D-6921-4326-8A2B-FCAEA2596259","f3_factor":"4B2D5C52-9F9F-4CDB-ADB4-84BF790C4558","f3_alpha":"1A056D6A-FC70-4F4C-B041-0CDE0B6F2F17","f3_mode":"300C95D1-2EE4-44D1-AD8E-5836017238E6"}}]}},{"uuid":"246E6078-E9F7-4306-B51A-114474566778","name":"State 1","position":[-15.286007910624079,28.193893397430557,-161.37508197525244],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6C4E80E6-8146-4041-90E8-A9CF4604BDAD","f1_mode":"7C8E425C-3E29-446E-9C63-AAFC32759F0B","f1_shininess":"75E5C94D-872E-4C05-8BC7-D3AD5EEE9887","f1_specular":"5FBE4A1A-FEAC-44E2-80A7-08186D1A47CD"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CE5F3932-B5F1-4725-82F1-19D674690149","f2_ior":"C624B7FC-4905-4A11-BD23-9D52B4FF3B99","f2_roughness":"3D457C55-D07F-4724-A5E8-F22387D4AD1A","f2_transmissionSamplerSize":"A4E8D670-6CFC-445C-89B6-9669F842A349","f2_aspectRatio":"48741304-5766-4A66-BFC7-37C2F29B6C5D","f2_alpha":"FBCE74E1-7369-4105-98F4-2FC85BBBDF63","f2_mode":"DB353346-5E8D-4F8A-BC35-095278DFF364"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"3622D62D-00B0-4649-8FDD-34A388BA84AE","f4_far":"1DD45303-DA0A-4EC0-A0E7-9573DCF019DD","f4_isVector":"2511313C-D77E-418A-AD09-23204C37ED0C","f4_isWorldSpace":"C2277CCD-A2F3-4910-916F-59556B16D073","f4_origin":"029CB127-0098-4A54-BA8C-DE6E809DDFFA","f4_colorA":"3F2CFA8B-0DAC-4A76-BB8C-3980668E89C5","f4_colorB":"57ABC1E9-B210-4775-A346-EB8D4FBFF75F","f4_alpha":"D55C00B9-1EF1-4169-95B4-ADFBE9B419E7","f4_mode":"EF469764-AA5A-4BD6-8B4D-6F373A22F1FC"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B5132211-AAC1-4838-AD36-2B1FDFF62048","f3_bias":"E71EB924-C5C5-438E-BD03-3474ED3E158D","f3_scale":"63D6D5C8-7EB5-4BFA-B6F9-C8A98FF451CE","f3_intensity":"CFEF1C16-012C-41D9-BF98-9F90485F05ED","f3_factor":"1F21DDED-9902-454C-90E6-65A99487042F","f3_alpha":"25598414-5C7F-4B95-8AEC-D4A4F5502D4B","f3_mode":"E464A59D-F9DB-472A-9103-503F4364AD34"}}]}},{"uuid":"EB00B0DA-0673-40D7-980F-F8E1B0576DEE","name":"Base State","position":[34.16950113948363,15.799680549464426,-205.0808009164132],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4147CCC4-905F-4FCE-A8DC-3C7E9F70B4E0","f1_mode":"BCCA5CC0-60E7-4990-B2E5-95C95D182777","f1_shininess":"A8DDCB6A-887F-4AD9-B008-30CB27276286","f1_specular":"BE330792-62FB-48A5-A40F-8DE567E3CBF4"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CA2789F4-D9FB-43ED-A2E4-B6480FFAC1AD","f2_ior":"17D835E9-D96A-4328-A639-6D1225F704A9","f2_roughness":"DCD811D5-0BE9-45FA-9EF3-8B80A57BB7A9","f2_transmissionSamplerSize":"CA29B1CC-ACDB-47B3-B788-F96483BC8296","f2_aspectRatio":"7CF0C8CC-AE3C-450D-A8EA-00958D1823DF","f2_alpha":"5CB05C64-9B9B-4376-BA73-898FFE02A586","f2_mode":"C24E4B68-E76B-4F1D-AEB1-8A82818FE15E"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"69C691E8-2D1C-43A1-8C64-5F6F59BA1EE3","f4_far":"6533523F-5C2A-46F2-8C67-9C2B393D3B44","f4_isVector":"8483FBAD-E155-4D19-8CD9-1D72ED3E821D","f4_isWorldSpace":"EBEF7E9A-F8C0-49FB-841A-FC56802CF62E","f4_origin":"491F29DD-44DF-4551-83AA-B4CE47C839BB","f4_colorA":"D6F6D41E-8BF5-4A63-A867-FBE9A1998C5A","f4_colorB":"A3A9CB62-E317-44CA-9311-4021DE2E9084","f4_alpha":"340FE63F-CAD5-435E-B95D-AF9CC18CBBA3","f4_mode":"EB0B5AC9-EB88-481F-BC02-7988D50C4AFC"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"71013CCD-2C26-4027-B5C0-C090E1C13C47","f3_bias":"78A24CEB-3F73-4333-851C-93DBE414389A","f3_scale":"39C05E5D-D796-44AB-874B-66720B2447DF","f3_intensity":"62067E9C-F29C-4B3A-B765-D15A8A5CF825","f3_factor":"654FC1CD-4822-42CC-B452-B33B1929207B","f3_alpha":"C8CDF1A4-AE42-4F88-A9AA-9279DDC0169F","f3_mode":"0F66E1EE-AFDE-4726-8521-162AECD21E7A"}}]}},{"uuid":"2FA1C378-8809-42B2-B41B-0A704465EA60","name":"State 1","position":[34.16950113948363,15.799680549464426,-205.0808009164132],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2EDB92C7-EF2A-41C5-8B51-3EC4AF89B6D9","f1_mode":"2267E48C-154D-4EDE-8CE9-5594937DB083","f1_shininess":"A6357BC4-2E63-43D0-A030-28249B5DF239","f1_specular":"9476A457-CD3F-4A88-908F-3BD794A86F75"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"37B6B6B9-0C46-46CA-9947-029F2C831CC3","f2_ior":"42AE6D7D-19F9-4832-9BC5-63C2FB1F2D0D","f2_roughness":"9C217E01-92A8-4845-82B9-CFC5DED64BEF","f2_transmissionSamplerSize":"247CEC38-BA86-4B8A-B2A3-C06BF279BD18","f2_aspectRatio":"A0DEF823-01CE-413B-8FC6-FC3F6CAD9DB2","f2_alpha":"61CA36BC-8264-4F4F-A4C5-3941A8B5A2DA","f2_mode":"4B67293E-7CAF-465A-BD2B-D0BBF5F2259A"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"AD85EAF6-8BDB-48AA-B1BD-DF845912EB02","f4_far":"EB1C61F0-1CF4-4BFC-80DF-D3AC490E3074","f4_isVector":"58595274-5AFA-4A2D-97EC-0112D3F500D6","f4_isWorldSpace":"00E6A1C4-212B-4482-8C9F-13E0C32D9F83","f4_origin":"64E539D1-AD23-4284-8F9B-56FD6B32E74C","f4_colorA":"846A09F3-758E-4784-8273-1AB680E08972","f4_colorB":"4F30ADEC-AFC2-4CC9-B179-6EBCB9106529","f4_alpha":"8F0820DD-6796-47C0-9421-FBD739DA730B","f4_mode":"E0C3F42C-3F66-4938-AF83-E24071897DB5"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7D39BB4A-37B9-4764-825C-2A2F8F1C930C","f3_bias":"1D7182AC-5723-420B-A60F-0554B7ADBE83","f3_scale":"3A54C0CA-1827-4FC5-A24A-B65E2F71670C","f3_intensity":"7B2ACC6C-D640-480B-A88A-2C1312FF5A91","f3_factor":"8638DAC1-C564-4832-8B49-B235C728E463","f3_alpha":"FCF86628-D421-45A1-90F5-11011CB36B2E","f3_mode":"00564B2F-E1DE-4A71-B9AD-44A29AC1BB1E"}}]}}],"nodes":[{"uuid":"3FD509E4-D29F-44D0-8385-BBF6BD0E6E79","type":"f","value":1,"nodeType":"Float"},{"uuid":"2BEC0B9A-FF89-461C-8228-48E7EEF58C0C","type":"i","value":0,"nodeType":"Int"},{"uuid":"34A229F1-E6F3-450E-9F09-161077DC1725","type":"f","value":30,"nodeType":"Float"},{"uuid":"02B25C34-F7D3-45ED-A928-7EEC3667B29A","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"8D060A30-08E0-44AE-903F-907600532258","type":"f","value":10,"nodeType":"Float"},{"uuid":"D1207446-9F39-40CE-A75C-6ABCACE12AA4","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"EC22E06E-F6C3-4731-A5ED-17CC11E50E75","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"31B7C321-934B-4D9E-AB93-8B0ABEDC99CB","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"26F12D52-84DA-42DB-8F51-2221350A68E1","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"662697F3-AD24-4B45-A1D8-7D873C8FE65C","type":"f","value":1,"nodeType":"Float"},{"uuid":"6CD9C06D-8612-4F72-9BC9-0AD1193DB12E","type":"i","value":0,"nodeType":"Int"},{"uuid":"E942A68A-92ED-416D-990A-F48AD4E9010D","type":"f","value":50,"nodeType":"Float"},{"uuid":"544BDB2D-8B34-4866-8823-F2CFAD321AFE","type":"f","value":168,"nodeType":"Float"},{"uuid":"FCDC664F-C276-41D0-87B0-4BFB8294766A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BF9FF54E-0C05-4CA2-A524-D99E4438551E","type":"f","value":0,"nodeType":"Float"},{"uuid":"348CE39A-B8D3-4558-88F9-CA98472DF456","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"B9F40593-9F2E-478A-8984-077C81F074B7","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"650BCE79-92CF-4B07-A9FC-A12A7DE51F92","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"A595456A-89D5-433C-8BCC-481322959BBE","type":"f","value":1,"nodeType":"Float"},{"uuid":"269AB9BE-413C-4420-9856-CCD28C65DE34","type":"i","value":2,"nodeType":"Int"},{"uuid":"3A81777B-429B-4BEE-8807-2951447D6D1D","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6E20C87B-1531-43ED-924A-4CBF0B5BFDD4","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"16FAF660-29B2-4EA1-91D3-3B4957D1F243","type":"f","value":1,"nodeType":"Float"},{"uuid":"18EEA906-B475-409F-838F-6F38507B0F0F","type":"f","value":2,"nodeType":"Float"},{"uuid":"F562414C-A6CF-4790-A20B-C60D5A936230","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"818C847C-7256-4A75-A0AD-5AB92DC7F75B","type":"f","value":1,"nodeType":"Float"},{"uuid":"3EC9FB7D-002E-4D26-A3B5-48CAB7B3DA37","type":"i","value":2,"nodeType":"Int"},{"uuid":"6FDB754A-BA97-41A0-83C6-97E88A9E0B0D","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE1D8C1A-E8BB-4DE3-B498-8CA37BE63B7D","type":"i","value":0,"nodeType":"Int"},{"uuid":"BA282683-1513-4D75-B592-0BCD2689622B","type":"f","value":30,"nodeType":"Float"},{"uuid":"55E446CD-E60E-4E95-A065-5388679AC329","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"3DC2CCBE-C1E6-40F7-9D1C-45131F8C04F1","type":"f","value":10,"nodeType":"Float"},{"uuid":"ECF02394-A5B4-4836-B0B8-969AE4F1805E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"B0114E1C-5D1F-44ED-959F-C23A0A548AD2","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9900BFA4-B2E7-4FAF-A7C9-399F8C9377F6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"5A9DD2C4-50FF-479A-B97E-2102E641B36B","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"183FE5E5-EE9D-4779-A031-716C1B4A6518","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6240B2F-4ADC-4212-88EA-125982A8010A","type":"i","value":0,"nodeType":"Int"},{"uuid":"B2198C8A-DD6E-45EF-A973-47D057DFE193","type":"f","value":50,"nodeType":"Float"},{"uuid":"F52CBD38-183C-4BA7-A918-AFCB79049F50","type":"f","value":168,"nodeType":"Float"},{"uuid":"DB372C75-958F-4CEE-80C0-49BBF7C4352E","type":"f","value":1,"nodeType":"Float"},{"uuid":"76A2F5AE-C9AD-4E65-8594-2488754CF4D6","type":"f","value":0,"nodeType":"Float"},{"uuid":"00A8855E-60DF-4838-AAFF-0DD34BCB594D","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"71E0BDA6-CB9E-4D8D-8A08-022E98AD9C6F","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"D248AC28-C65E-4D24-BD35-DCB3C64C59F4","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"C26BECA6-8D83-4E95-B92B-59CE1C9CBC55","type":"f","value":1,"nodeType":"Float"},{"uuid":"5BAAE0B5-038A-41E2-9F8C-9327AC996113","type":"i","value":2,"nodeType":"Int"},{"uuid":"CB8A0C51-5F4A-4B6D-A254-FD664F50B5BB","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"ACCD410B-9BB1-477D-9622-301DB3608E39","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2777A5B0-8851-494D-A242-61ACB0F2CDB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"BF35D9F5-7808-4770-A7A2-98D16F183896","type":"f","value":2,"nodeType":"Float"},{"uuid":"17E988CB-B3F7-4187-ABBA-185A1D08A4D2","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"7FC8E1C8-9D02-4C54-95F8-B1965B79D56F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F7359F02-20F4-4F7D-AE80-8628D828EF39","type":"i","value":2,"nodeType":"Int"},{"uuid":"9E7478FA-BD99-4BA6-B58B-80A7AFBCAE56","type":"f","value":1,"nodeType":"Float"},{"uuid":"498878D4-98A3-434E-BAEA-7AA726F1617A","type":"i","value":0,"nodeType":"Int"},{"uuid":"64D8B96C-FF7C-4CAB-AC8B-C011CF4818D2","type":"f","value":30,"nodeType":"Float"},{"uuid":"FBECE1BD-42FD-4DCE-B5AB-26A92C4D96F1","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"C99745BC-14B3-4DC7-8721-62DF3DB4E806","type":"f","value":10,"nodeType":"Float"},{"uuid":"3011E041-2620-4054-BBCB-DD8B55589BF4","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"90D63B37-DEF5-492C-A31D-B5C9FFEE7865","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"17897827-A1C9-4092-9DB1-7E7BD7024D82","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9776D8B2-361C-412B-9489-3E13221D2DA9","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"B4C54647-67BE-4685-A148-31D3E8F118A2","project":false,"nodeType":"Texture"},{"uuid":"B4C54647-67BE-4685-A148-31D3E8F118A2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"863C4B32-5A61-4B3D-B1E9-B8B6A06A89DB","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"39936AF0-C12A-454B-8434-F79931F3204A","project":false,"nodeType":"Texture"},{"uuid":"39936AF0-C12A-454B-8434-F79931F3204A","type":"v2","index":0,"nodeType":"UV"},{"uuid":"6747F167-7ACD-4090-9795-193C2A043FB9","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"36DD701E-C63A-41C4-98FD-B616F3A6D6AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"6E9EFEE7-7338-4EE6-86BB-C682C9B47C00","type":"i","value":0,"nodeType":"Int"},{"uuid":"E6270D3A-B200-42F0-83FC-4EA87698A763","type":"f","value":50,"nodeType":"Float"},{"uuid":"3893B357-7D2D-458A-89EC-32D8F33BB3A8","type":"f","value":168,"nodeType":"Float"},{"uuid":"C4C2F112-B267-4F63-ACBB-6687444EADC6","type":"f","value":1,"nodeType":"Float"},{"uuid":"F86516BD-C499-4A99-975B-0FAF8A2A9473","type":"f","value":0,"nodeType":"Float"},{"uuid":"F42FF326-04F8-4857-AB15-F987402267F0","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"01443ADE-A1D6-47DC-B32C-A23BFB43401A","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"D8DD55CD-B100-458E-96B7-97E84FADBECE","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"C4761A44-EFF3-4772-8A2D-279306C04FE2","type":"f","value":1,"nodeType":"Float"},{"uuid":"B100FD29-3CA7-4955-B4D8-610656EB69F8","type":"i","value":2,"nodeType":"Int"},{"uuid":"F5582F37-4C60-4C98-9859-3F232EB3282C","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"92376BC6-BA71-4837-9017-3139EAFCB57B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"A1C86F12-374E-4472-A010-3430D079F1AA","type":"f","value":1,"nodeType":"Float"},{"uuid":"09A5CA1F-EA45-4340-9360-19561F16A419","type":"f","value":2,"nodeType":"Float"},{"uuid":"E97156BB-0508-49A1-8EE7-549DB2D6AD65","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"55F50552-1310-483E-8012-336C46A5F8F1","type":"f","value":1,"nodeType":"Float"},{"uuid":"17023741-A20E-4DDE-A983-396B8FF49FFD","type":"i","value":2,"nodeType":"Int"},{"uuid":"050A23BD-C19F-4E9E-AAAB-8596D8D4A964","type":"phong","color":"6F0911CA-7A6A-4348-8B37-4F249D3F5AA3","specular":"FBECE1BD-42FD-4DCE-B5AB-26A92C4D96F1","shininess":"64D8B96C-FF7C-4CAB-AC8B-C011CF4818D2","shadingAlpha":"9E7478FA-BD99-4BA6-B58B-80A7AFBCAE56","shadingBlend":"498878D4-98A3-434E-BAEA-7AA726F1617A","afterColor":"DADF378B-935F-4DAE-8D48-EB43A782CDB9","alpha":"E1F8F65B-59D0-442B-9DB8-1B6ABD19203A","nodeType":"Phong"},{"uuid":"6F0911CA-7A6A-4348-8B37-4F249D3F5AA3","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"DADF378B-935F-4DAE-8D48-EB43A782CDB9","type":"v3","a":"4F7E533B-3D9D-4A02-A595-668AC848FFEC","b":"5FE48CA6-BC4E-4505-A47B-CE31142B3DBE","alpha":"858F384D-0090-4FF3-B713-1D055A07B85B","mode":"17023741-A20E-4DDE-A983-396B8FF49FFD","nodeType":"Blend"},{"uuid":"4F7E533B-3D9D-4A02-A595-668AC848FFEC","type":"v3","a":"65BC3050-75A7-4331-B317-29BB5B06D0A7","b":"374A5EBB-CD57-4D47-BCD3-6402C6E7F5A6","alpha":"8AEB413B-9397-410A-9A3B-19BC5B81411B","mode":"B100FD29-3CA7-4955-B4D8-610656EB69F8","nodeType":"Blend"},{"uuid":"65BC3050-75A7-4331-B317-29BB5B06D0A7","type":"v3","a":"20ADB468-51CF-4AE3-A43A-75B901CD8DDB","b":"D3D28CD4-7520-4745-A52A-09A2285C79F3","alpha":"09729255-2A6A-42B3-9B9E-FFEBC7C6B73B","mode":"6E9EFEE7-7338-4EE6-86BB-C682C9B47C00","nodeType":"Blend"},{"uuid":"20ADB468-51CF-4AE3-A43A-75B901CD8DDB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D3D28CD4-7520-4745-A52A-09A2285C79F3","type":"v3","thickness":"C99745BC-14B3-4DC7-8721-62DF3DB4E806","ior":"3011E041-2620-4054-BBCB-DD8B55589BF4","roughness":"90D63B37-DEF5-492C-A31D-B5C9FFEE7865","alpha":"36DD701E-C63A-41C4-98FD-B616F3A6D6AB","calpha":"gD3D28CD475204745A52A09A2285C79F3_calpha","nodeType":"Transmission"},{"uuid":"09729255-2A6A-42B3-9B9E-FFEBC7C6B73B","type":"f","src":"gD3D28CD475204745A52A09A2285C79F3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"374A5EBB-CD57-4D47-BCD3-6402C6E7F5A6","type":"v3","near":"E6270D3A-B200-42F0-83FC-4EA87698A763","far":"3893B357-7D2D-458A-89EC-32D8F33BB3A8","isVector":"C4C2F112-B267-4F63-ACBB-6687444EADC6","isWorldSpace":"F86516BD-C499-4A99-975B-0FAF8A2A9473","origin":"F42FF326-04F8-4857-AB15-F987402267F0","colorA":"01443ADE-A1D6-47DC-B32C-A23BFB43401A","colorB":"D8DD55CD-B100-458E-96B7-97E84FADBECE","alpha":"C4761A44-EFF3-4772-8A2D-279306C04FE2","nodeType":"Depth"},{"uuid":"8AEB413B-9397-410A-9A3B-19BC5B81411B","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"C4761A44-EFF3-4772-8A2D-279306C04FE2"},"nodeType":"Expression"},{"uuid":"5FE48CA6-BC4E-4505-A47B-CE31142B3DBE","type":"v3","color":"F5582F37-4C60-4C98-9859-3F232EB3282C","bias":"92376BC6-BA71-4837-9017-3139EAFCB57B","scale":"A1C86F12-374E-4472-A010-3430D079F1AA","intensity":"09A5CA1F-EA45-4340-9360-19561F16A419","factor":"E97156BB-0508-49A1-8EE7-549DB2D6AD65","alpha":"55F50552-1310-483E-8012-336C46A5F8F1","mode":"17023741-A20E-4DDE-A983-396B8FF49FFD","calpha":"g5FE48CA6BC4E4505A47BCE31142B3DBE_calpha","nodeType":"Fresnel"},{"uuid":"858F384D-0090-4FF3-B713-1D055A07B85B","type":"f","src":"g5FE48CA6BC4E4505A47BCE31142B3DBE_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E1F8F65B-59D0-442B-9DB8-1B6ABD19203A","type":"f","value":1,"nodeType":"Float"},{"uuid":"37C2A27C-ED51-469B-BF55-A718D62D6868","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"250DF8E3-8A81-434E-8293-F20CF4609C38","nodeType":"Color"},{"uuid":"250DF8E3-8A81-434E-8293-F20CF4609C38","type":"f","value":1,"nodeType":"Float"},{"uuid":"8B231016-3918-48CD-8BA3-F35E610B0A23","type":"i","value":0,"nodeType":"Int"},{"uuid":"22398205-756D-432F-9F26-997A2FE82742","type":"f","value":1,"nodeType":"Float"},{"uuid":"79F1B885-ED20-49B0-AA9C-42403C442DEE","type":"i","value":0,"nodeType":"Int"},{"uuid":"B02949DE-5FA6-48C1-A502-D22D950090A7","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"E4292578-DC32-4CB1-B299-6B30B03407D9","type":"f","value":0,"nodeType":"Float"},{"uuid":"5424BF01-EAC4-4889-97A2-FC83BBC48557","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"61525417-BD98-42D5-A3D6-ECF046593686","type":"standard","color":"37C2A27C-ED51-469B-BF55-A718D62D6868","roughness":"B02949DE-5FA6-48C1-A502-D22D950090A7","metalness":"E4292578-DC32-4CB1-B299-6B30B03407D9","alpha":"74BF2E27-431E-43E5-9E2E-04ADB10A6010","reflectivity":"5424BF01-EAC4-4889-97A2-FC83BBC48557","shadingAlpha":"22398205-756D-432F-9F26-997A2FE82742","shadingBlend":"79F1B885-ED20-49B0-AA9C-42403C442DEE","nodeType":"Standard"},{"uuid":"74BF2E27-431E-43E5-9E2E-04ADB10A6010","type":"f","value":1,"nodeType":"Float"},{"uuid":"D227FDE6-BE8F-4647-8C41-CA47E3254BF2","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"9C7D187B-0888-498D-AF85-002EA69C97F0","nodeType":"Color"},{"uuid":"9C7D187B-0888-498D-AF85-002EA69C97F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"BADBE7D4-C9CB-463E-98CB-58068EAF2AFF","type":"i","value":0,"nodeType":"Int"},{"uuid":"35C2F447-C3C5-4DC6-9A3A-1C8CAE6D3B9D","type":"f","value":1,"nodeType":"Float"},{"uuid":"97F8E25A-FB49-4F3A-9B79-79AD4C635F31","type":"i","value":0,"nodeType":"Int"},{"uuid":"E57BA1C9-B5B1-435D-B115-466D7E50920F","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"5F7ECA52-2480-414F-9CE6-E5132D711ACA","type":"f","value":0,"nodeType":"Float"},{"uuid":"22A5B848-50B5-442A-92D0-6A2B07213382","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0ADFF76E-CA89-41C5-9CD2-F685879D8D83","type":"standard","color":"D227FDE6-BE8F-4647-8C41-CA47E3254BF2","roughness":"E57BA1C9-B5B1-435D-B115-466D7E50920F","metalness":"5F7ECA52-2480-414F-9CE6-E5132D711ACA","alpha":"30EBDB7A-4B22-4089-9775-B058AB79CF04","reflectivity":"22A5B848-50B5-442A-92D0-6A2B07213382","shadingAlpha":"35C2F447-C3C5-4DC6-9A3A-1C8CAE6D3B9D","shadingBlend":"97F8E25A-FB49-4F3A-9B79-79AD4C635F31","nodeType":"Standard"},{"uuid":"30EBDB7A-4B22-4089-9775-B058AB79CF04","type":"f","value":1,"nodeType":"Float"},{"uuid":"531E46D1-69CC-4C21-9A24-71BD2E39E90B","type":"f","value":1,"nodeType":"Float"},{"uuid":"79CE6F8A-F674-49FA-930B-04FA95CE684B","type":"i","value":0,"nodeType":"Int"},{"uuid":"7C6176F9-6D27-48E1-9EFC-2A77284C5382","type":"f","value":30,"nodeType":"Float"},{"uuid":"3D935F6A-36DE-48F3-B9C1-2D65E578A4E5","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"A282F0D1-11B1-46BD-8E4A-C14BF736808A","type":"c","r":0.9333333333333333,"g":0.5137254901960784,"b":0.5137254901960784,"value":15631235,"alpha":"A6EE8592-B8F3-4BC4-A7C9-EDC2A8A20F52","nodeType":"Color"},{"uuid":"A6EE8592-B8F3-4BC4-A7C9-EDC2A8A20F52","type":"f","value":1,"nodeType":"Float"},{"uuid":"E296B295-0274-4BA2-8179-A9B7ACC583C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"92A12B33-AD71-4C99-96C2-E8A1C454055A","type":"phong","color":"63A00C03-B78C-4FDF-B50F-E4267637FA42","specular":"3D935F6A-36DE-48F3-B9C1-2D65E578A4E5","shininess":"7C6176F9-6D27-48E1-9EFC-2A77284C5382","shadingAlpha":"531E46D1-69CC-4C21-9A24-71BD2E39E90B","shadingBlend":"79CE6F8A-F674-49FA-930B-04FA95CE684B","afterColor":"CB37E341-6BAF-4FF6-9B96-4AD9774D1C94","alpha":"BE612B26-9C76-4D57-93F7-3EBBD9C02D81","nodeType":"Phong"},{"uuid":"63A00C03-B78C-4FDF-B50F-E4267637FA42","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"CB37E341-6BAF-4FF6-9B96-4AD9774D1C94","type":"v3","a":"3EEC32E6-D11B-4051-A330-53A5EA434F01","b":"A282F0D1-11B1-46BD-8E4A-C14BF736808A","alpha":"AA4A64C5-73F9-442E-B2E2-2DD2943FF936","mode":"E296B295-0274-4BA2-8179-A9B7ACC583C3","nodeType":"Blend"},{"uuid":"3EEC32E6-D11B-4051-A330-53A5EA434F01","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AA4A64C5-73F9-442E-B2E2-2DD2943FF936","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A6EE8592-B8F3-4BC4-A7C9-EDC2A8A20F52"},"nodeType":"Expression"},{"uuid":"BE612B26-9C76-4D57-93F7-3EBBD9C02D81","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F4FD659-5309-4D0E-A258-BD2641952C88","type":"f","value":1,"nodeType":"Float"},{"uuid":"4C9FDD08-7631-473B-804B-E6936C6A0E9E","type":"i","value":0,"nodeType":"Int"},{"uuid":"39D7E48D-F231-4B97-A644-76491EB4C1D1","type":"f","value":30,"nodeType":"Float"},{"uuid":"F5BED1E3-13FE-493B-AF8B-9E4F5B1B2BDA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"80EDC655-2440-4D9D-8190-50C843609774","type":"c","r":0.9137254901960784,"g":0.39215686274509803,"b":0.39215686274509803,"value":15295588,"alpha":"3D8E10A2-772B-426D-B1B3-683643BF4BF9","nodeType":"Color"},{"uuid":"3D8E10A2-772B-426D-B1B3-683643BF4BF9","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E0A6331-A7D7-4C24-9BFC-E018A35ED26E","type":"i","value":0,"nodeType":"Int"},{"uuid":"7E9B1BE8-EE6F-4B28-9ECC-9D8F697C6992","type":"phong","color":"D259A8C9-81C2-4CB9-8C59-A8B6104FA487","specular":"F5BED1E3-13FE-493B-AF8B-9E4F5B1B2BDA","shininess":"39D7E48D-F231-4B97-A644-76491EB4C1D1","shadingAlpha":"9F4FD659-5309-4D0E-A258-BD2641952C88","shadingBlend":"4C9FDD08-7631-473B-804B-E6936C6A0E9E","afterColor":"47CE1035-6CC6-47B7-8485-4B0060726387","alpha":"71D4481E-2E6F-4DC0-9B94-B9F08C6A4A76","nodeType":"Phong"},{"uuid":"D259A8C9-81C2-4CB9-8C59-A8B6104FA487","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"47CE1035-6CC6-47B7-8485-4B0060726387","type":"v3","a":"E969193F-231D-4E93-9DB4-E3A20B2306B4","b":"80EDC655-2440-4D9D-8190-50C843609774","alpha":"F6A11B34-7D09-4173-AD81-BCF08A48C3C6","mode":"0E0A6331-A7D7-4C24-9BFC-E018A35ED26E","nodeType":"Blend"},{"uuid":"E969193F-231D-4E93-9DB4-E3A20B2306B4","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F6A11B34-7D09-4173-AD81-BCF08A48C3C6","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"3D8E10A2-772B-426D-B1B3-683643BF4BF9"},"nodeType":"Expression"},{"uuid":"71D4481E-2E6F-4DC0-9B94-B9F08C6A4A76","type":"f","value":1,"nodeType":"Float"},{"uuid":"E30967B6-4FA9-40D3-A08E-63750CC3FC20","type":"f","value":1,"nodeType":"Float"},{"uuid":"66EEC166-5016-426E-91AE-D800C0C9C48E","type":"i","value":0,"nodeType":"Int"},{"uuid":"D11044CC-52B2-45B7-B221-05C206D2CC76","type":"f","value":30,"nodeType":"Float"},{"uuid":"B835AF68-238C-4D0F-A107-E197037CB999","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"CA352DF4-3FE2-44C6-9B4F-939CF9A714A7","type":"c","r":0.8980392156862745,"g":0.27058823529411763,"b":0.27058823529411763,"value":15025477,"alpha":"D8D4D757-2562-42E3-8295-7515F9AEF78B","nodeType":"Color"},{"uuid":"D8D4D757-2562-42E3-8295-7515F9AEF78B","type":"f","value":1,"nodeType":"Float"},{"uuid":"FAAE434F-19EF-426F-B590-3D5B97C26678","type":"i","value":0,"nodeType":"Int"},{"uuid":"E47F2C81-8397-4D07-9ABF-980B32C21815","type":"phong","color":"6D87350A-E0B9-4C95-9C49-E7116BB7F431","specular":"B835AF68-238C-4D0F-A107-E197037CB999","shininess":"D11044CC-52B2-45B7-B221-05C206D2CC76","shadingAlpha":"E30967B6-4FA9-40D3-A08E-63750CC3FC20","shadingBlend":"66EEC166-5016-426E-91AE-D800C0C9C48E","afterColor":"09419FD8-DEA0-4296-B8EF-07B2295A9B30","alpha":"C78EE404-004F-48D7-8C86-339518C23F4E","nodeType":"Phong"},{"uuid":"6D87350A-E0B9-4C95-9C49-E7116BB7F431","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"09419FD8-DEA0-4296-B8EF-07B2295A9B30","type":"v3","a":"E977F06B-D5FB-4C02-A720-647DBDCC0E21","b":"CA352DF4-3FE2-44C6-9B4F-939CF9A714A7","alpha":"AA2C21CB-393F-46DD-90E1-199EDE91C5AC","mode":"FAAE434F-19EF-426F-B590-3D5B97C26678","nodeType":"Blend"},{"uuid":"E977F06B-D5FB-4C02-A720-647DBDCC0E21","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AA2C21CB-393F-46DD-90E1-199EDE91C5AC","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"D8D4D757-2562-42E3-8295-7515F9AEF78B"},"nodeType":"Expression"},{"uuid":"C78EE404-004F-48D7-8C86-339518C23F4E","type":"f","value":1,"nodeType":"Float"},{"uuid":"70EB799C-AC3F-4F96-82AB-798B7C625A23","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"75CAF392-7F58-43F1-BA2B-CEDEFC1B39D1","nodeType":"Color"},{"uuid":"75CAF392-7F58-43F1-BA2B-CEDEFC1B39D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"1753D490-C02D-4569-B6FE-29C270C41593","type":"i","value":0,"nodeType":"Int"},{"uuid":"2CC0FE91-54AE-4EC4-BD04-B76A0418A7AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"97AFA80D-B6C2-42FA-8457-0655BAAB5172","type":"i","value":0,"nodeType":"Int"},{"uuid":"14F6CFE3-B61E-4970-82BD-A332E96586B6","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"0D88F982-8E0D-41F3-A3F0-C6009A9A01BE","type":"f","value":0,"nodeType":"Float"},{"uuid":"A718CDEA-2BE3-40C2-9E33-B2E7D415ACCF","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"911D6ACB-3203-41FE-9308-8F1C735A8CD8","type":"standard","color":"70EB799C-AC3F-4F96-82AB-798B7C625A23","roughness":"14F6CFE3-B61E-4970-82BD-A332E96586B6","metalness":"0D88F982-8E0D-41F3-A3F0-C6009A9A01BE","alpha":"8B42F1D4-4A4B-4C43-8C39-5531D8B5C49E","reflectivity":"A718CDEA-2BE3-40C2-9E33-B2E7D415ACCF","shadingAlpha":"2CC0FE91-54AE-4EC4-BD04-B76A0418A7AC","shadingBlend":"97AFA80D-B6C2-42FA-8457-0655BAAB5172","nodeType":"Standard"},{"uuid":"8B42F1D4-4A4B-4C43-8C39-5531D8B5C49E","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E5C8158-EE14-4FC1-A22E-96A8F4999B93","type":"f","value":1,"nodeType":"Float"},{"uuid":"2C66283A-16EE-48D8-BE08-9A9DE35745B7","type":"i","value":0,"nodeType":"Int"},{"uuid":"4136AE41-B5CD-4CB1-8E37-3A176B0E8D90","type":"f","value":30,"nodeType":"Float"},{"uuid":"9BF2404C-DEBC-4256-8E7B-2F9DC22FDB2A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"7750B68B-017C-41A0-9470-9C216F24EBB9","type":"c","r":0.3607843137254902,"g":0.8313725490196079,"b":0.5725490196078431,"value":6083730,"alpha":"91019350-70D2-43D1-872A-57E587C98BF0","nodeType":"Color"},{"uuid":"91019350-70D2-43D1-872A-57E587C98BF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"536237BC-73FB-4DB3-B898-1A73AF353817","type":"i","value":0,"nodeType":"Int"},{"uuid":"60D4435D-1084-4FA6-AF4A-36A37F40BF3A","type":"phong","color":"BF2EDD3B-57F9-42D5-AC2C-8B98175789C1","specular":"9BF2404C-DEBC-4256-8E7B-2F9DC22FDB2A","shininess":"4136AE41-B5CD-4CB1-8E37-3A176B0E8D90","shadingAlpha":"0E5C8158-EE14-4FC1-A22E-96A8F4999B93","shadingBlend":"2C66283A-16EE-48D8-BE08-9A9DE35745B7","afterColor":"8E36823F-B426-41AA-8863-7D519567E631","alpha":"75EDF1D9-B7D1-415B-B36F-FE5BDCA8116E","nodeType":"Phong"},{"uuid":"BF2EDD3B-57F9-42D5-AC2C-8B98175789C1","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"8E36823F-B426-41AA-8863-7D519567E631","type":"v3","a":"851503B2-4530-4980-8A07-8EB7EF8B43CF","b":"7750B68B-017C-41A0-9470-9C216F24EBB9","alpha":"CBA6CA73-1F60-4F93-86F9-AB230A8891B5","mode":"536237BC-73FB-4DB3-B898-1A73AF353817","nodeType":"Blend"},{"uuid":"851503B2-4530-4980-8A07-8EB7EF8B43CF","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CBA6CA73-1F60-4F93-86F9-AB230A8891B5","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"91019350-70D2-43D1-872A-57E587C98BF0"},"nodeType":"Expression"},{"uuid":"75EDF1D9-B7D1-415B-B36F-FE5BDCA8116E","type":"f","value":1,"nodeType":"Float"},{"uuid":"32DE2B5C-7424-4E2A-AC5D-E7E0233F325B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9FBD05E-A1FD-4DD4-8215-214B271B5F0C","type":"i","value":0,"nodeType":"Int"},{"uuid":"2972A745-E6E2-4355-971F-959CC2FA0DA8","type":"f","value":30,"nodeType":"Float"},{"uuid":"EE4BFEC3-2A63-48FE-9627-76F68693A6CB","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"9588D976-29A9-4C29-BDD8-F1411980F464","type":"c","r":0.2,"g":0.792156862745098,"b":0.4627450980392157,"value":3394166,"alpha":"4DE6F303-24F5-43F5-A507-44255BE90F7D","nodeType":"Color"},{"uuid":"4DE6F303-24F5-43F5-A507-44255BE90F7D","type":"f","value":1,"nodeType":"Float"},{"uuid":"D131D230-7594-483A-B942-8D762586EE5E","type":"i","value":0,"nodeType":"Int"},{"uuid":"BDF0EFA9-C69B-4D7A-B449-8F8F666F7346","type":"phong","color":"5B8920A2-235C-4CC1-BCCC-503DB60D2027","specular":"EE4BFEC3-2A63-48FE-9627-76F68693A6CB","shininess":"2972A745-E6E2-4355-971F-959CC2FA0DA8","shadingAlpha":"32DE2B5C-7424-4E2A-AC5D-E7E0233F325B","shadingBlend":"C9FBD05E-A1FD-4DD4-8215-214B271B5F0C","afterColor":"883C000B-241F-424C-AD7F-C9B1E77A1F8E","alpha":"A9BF911D-5560-40D3-AD5F-0F381A593066","nodeType":"Phong"},{"uuid":"5B8920A2-235C-4CC1-BCCC-503DB60D2027","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"883C000B-241F-424C-AD7F-C9B1E77A1F8E","type":"v3","a":"C62E15F8-7CAB-4C71-A622-7F9A7BFE68D5","b":"9588D976-29A9-4C29-BDD8-F1411980F464","alpha":"4212E179-7F24-4D3B-9329-E6E8C63D9430","mode":"D131D230-7594-483A-B942-8D762586EE5E","nodeType":"Blend"},{"uuid":"C62E15F8-7CAB-4C71-A622-7F9A7BFE68D5","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4212E179-7F24-4D3B-9329-E6E8C63D9430","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"4DE6F303-24F5-43F5-A507-44255BE90F7D"},"nodeType":"Expression"},{"uuid":"A9BF911D-5560-40D3-AD5F-0F381A593066","type":"f","value":1,"nodeType":"Float"},{"uuid":"2BA13361-FB94-45D2-854F-C111395F145F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F9FA2E32-F570-4617-9287-6CCC99C66597","type":"i","value":0,"nodeType":"Int"},{"uuid":"178BF9AE-0356-47CD-876B-E6C0BA6DBFD0","type":"f","value":30,"nodeType":"Float"},{"uuid":"F98B7DED-77FC-4B06-9DF1-DB259217ACEA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"FD589FB1-906D-4A93-B1B5-159AD86C3065","type":"c","r":0.0392156862745098,"g":0.7490196078431373,"b":0.3568627450980392,"value":704347,"alpha":"EB42E38A-CD9B-4D09-9CF3-DB4D401D00E4","nodeType":"Color"},{"uuid":"EB42E38A-CD9B-4D09-9CF3-DB4D401D00E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"78D67173-EA5A-4BB3-9022-42C8B2DF8EA2","type":"i","value":0,"nodeType":"Int"},{"uuid":"066795CA-302A-4B46-8D7A-30CB6529243F","type":"phong","color":"CA8EA5E3-20FC-4658-A7B3-472F991AB43A","specular":"F98B7DED-77FC-4B06-9DF1-DB259217ACEA","shininess":"178BF9AE-0356-47CD-876B-E6C0BA6DBFD0","shadingAlpha":"2BA13361-FB94-45D2-854F-C111395F145F","shadingBlend":"F9FA2E32-F570-4617-9287-6CCC99C66597","afterColor":"24D96138-6C22-449F-86A7-5D442E9E26CC","alpha":"991C9629-F9F8-4CB2-B1EF-56634B136B77","nodeType":"Phong"},{"uuid":"CA8EA5E3-20FC-4658-A7B3-472F991AB43A","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"24D96138-6C22-449F-86A7-5D442E9E26CC","type":"v3","a":"0594609A-E645-4257-AB8B-4A3BFA330691","b":"FD589FB1-906D-4A93-B1B5-159AD86C3065","alpha":"BF47CD49-7153-4D15-8B49-8CFAB47667B5","mode":"78D67173-EA5A-4BB3-9022-42C8B2DF8EA2","nodeType":"Blend"},{"uuid":"0594609A-E645-4257-AB8B-4A3BFA330691","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BF47CD49-7153-4D15-8B49-8CFAB47667B5","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"EB42E38A-CD9B-4D09-9CF3-DB4D401D00E4"},"nodeType":"Expression"},{"uuid":"991C9629-F9F8-4CB2-B1EF-56634B136B77","type":"f","value":1,"nodeType":"Float"},{"uuid":"13B80439-87CF-48FC-9F82-D0D5C0DDAAC9","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"62A2EA2D-D54C-418F-8352-6483C1112EED","nodeType":"Color"},{"uuid":"62A2EA2D-D54C-418F-8352-6483C1112EED","type":"f","value":1,"nodeType":"Float"},{"uuid":"7489BC88-CDC8-4009-B056-58B933A17D29","type":"i","value":0,"nodeType":"Int"},{"uuid":"069F0EE7-516B-4010-9606-70DC031F6C4E","type":"f","value":1,"nodeType":"Float"},{"uuid":"FC9D9D6C-2D9F-4DB5-B88D-1C45D6CBAC1B","type":"i","value":0,"nodeType":"Int"},{"uuid":"5B560F70-91AA-487E-86B9-3ECDF34D684A","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"2B885091-6098-40EB-9536-D571F23EDDE3","type":"f","value":0,"nodeType":"Float"},{"uuid":"CE56EDF5-0045-4996-B777-B1BFCB63E1CF","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"E3862300-47C5-4C28-924A-562169390EBC","type":"standard","color":"13B80439-87CF-48FC-9F82-D0D5C0DDAAC9","roughness":"5B560F70-91AA-487E-86B9-3ECDF34D684A","metalness":"2B885091-6098-40EB-9536-D571F23EDDE3","alpha":"00706974-C209-4A2E-9974-E477EDB2DF2F","reflectivity":"CE56EDF5-0045-4996-B777-B1BFCB63E1CF","shadingAlpha":"069F0EE7-516B-4010-9606-70DC031F6C4E","shadingBlend":"FC9D9D6C-2D9F-4DB5-B88D-1C45D6CBAC1B","nodeType":"Standard"},{"uuid":"00706974-C209-4A2E-9974-E477EDB2DF2F","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F741864-DE92-4DE3-8B3D-3E626B2C42B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"CEC8D0B1-F4DE-407F-BA31-5C5333F85436","type":"i","value":0,"nodeType":"Int"},{"uuid":"1DE44886-7338-4609-9AE7-0522D61E6E40","type":"f","value":30,"nodeType":"Float"},{"uuid":"FA09C49F-119B-4557-A84C-0A9C7028B4F3","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"A238253E-AC25-441B-964F-9BAE12471E3C","type":"c","r":0.3333333333333333,"g":0.6196078431372549,"b":1,"value":5611263,"alpha":"1BAC809C-21AD-4D30-A240-CCBDD995CD60","nodeType":"Color"},{"uuid":"1BAC809C-21AD-4D30-A240-CCBDD995CD60","type":"f","value":1,"nodeType":"Float"},{"uuid":"312694D2-7991-4C3C-A4A0-A2FC203413D0","type":"i","value":0,"nodeType":"Int"},{"uuid":"7EE67ECE-A2B1-4F4D-97CC-4DAF09577867","type":"phong","color":"C0048039-7C6C-4EC6-82C0-A6FE9821B9F4","specular":"FA09C49F-119B-4557-A84C-0A9C7028B4F3","shininess":"1DE44886-7338-4609-9AE7-0522D61E6E40","shadingAlpha":"4F741864-DE92-4DE3-8B3D-3E626B2C42B4","shadingBlend":"CEC8D0B1-F4DE-407F-BA31-5C5333F85436","afterColor":"0BCF9968-7979-44C4-8895-D12813E6FAE6","alpha":"C87A36BB-F3AA-443B-851B-CE42465F12DA","nodeType":"Phong"},{"uuid":"C0048039-7C6C-4EC6-82C0-A6FE9821B9F4","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"0BCF9968-7979-44C4-8895-D12813E6FAE6","type":"v3","a":"37106E52-B65A-4634-B106-DC5E12128663","b":"A238253E-AC25-441B-964F-9BAE12471E3C","alpha":"8478A49F-3253-4666-82DC-DB985AB35353","mode":"312694D2-7991-4C3C-A4A0-A2FC203413D0","nodeType":"Blend"},{"uuid":"37106E52-B65A-4634-B106-DC5E12128663","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8478A49F-3253-4666-82DC-DB985AB35353","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"1BAC809C-21AD-4D30-A240-CCBDD995CD60"},"nodeType":"Expression"},{"uuid":"C87A36BB-F3AA-443B-851B-CE42465F12DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"6C3A977B-2A5F-4E61-B75C-F1212E7FF2D7","type":"f","value":1,"nodeType":"Float"},{"uuid":"CE248D91-7242-4F7F-8783-BC4ACC1B12D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"77C4369C-C1F7-4DA4-96D3-FCB3872969D4","type":"f","value":30,"nodeType":"Float"},{"uuid":"8FCDA9AF-2655-41E8-900D-148F7B1531D9","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B36B0B8C-9102-491D-BDFF-066F245770E0","type":"c","r":0.16470588235294117,"g":0.5254901960784314,"b":1,"value":2787071,"alpha":"52BEFAA6-4199-4AE7-95F4-AC2B9C905E82","nodeType":"Color"},{"uuid":"52BEFAA6-4199-4AE7-95F4-AC2B9C905E82","type":"f","value":1,"nodeType":"Float"},{"uuid":"F06AD8B8-FBBA-4D7B-B370-A6F918EEE18E","type":"i","value":0,"nodeType":"Int"},{"uuid":"0360B18A-3B70-4039-B4B2-8CC962254A41","type":"phong","color":"0B08BC1F-E942-454D-822F-A7D3E2E3716F","specular":"8FCDA9AF-2655-41E8-900D-148F7B1531D9","shininess":"77C4369C-C1F7-4DA4-96D3-FCB3872969D4","shadingAlpha":"6C3A977B-2A5F-4E61-B75C-F1212E7FF2D7","shadingBlend":"CE248D91-7242-4F7F-8783-BC4ACC1B12D3","afterColor":"7AA6C6EB-7303-4C35-86FD-C51DDB3F6FC5","alpha":"B1A1206C-BE8D-4B12-B41E-D5642832AE62","nodeType":"Phong"},{"uuid":"0B08BC1F-E942-454D-822F-A7D3E2E3716F","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"7AA6C6EB-7303-4C35-86FD-C51DDB3F6FC5","type":"v3","a":"59B8645B-80DC-4632-B08B-2BB1C8D16467","b":"B36B0B8C-9102-491D-BDFF-066F245770E0","alpha":"E42E7ADB-3AE5-4BC4-8290-A97E074010BE","mode":"F06AD8B8-FBBA-4D7B-B370-A6F918EEE18E","nodeType":"Blend"},{"uuid":"59B8645B-80DC-4632-B08B-2BB1C8D16467","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E42E7ADB-3AE5-4BC4-8290-A97E074010BE","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"52BEFAA6-4199-4AE7-95F4-AC2B9C905E82"},"nodeType":"Expression"},{"uuid":"B1A1206C-BE8D-4B12-B41E-D5642832AE62","type":"f","value":1,"nodeType":"Float"},{"uuid":"E1AEFCD6-3586-4F56-9BB4-858E013AADD9","type":"f","value":1,"nodeType":"Float"},{"uuid":"2F954DCF-579E-483D-9733-8A39D7BB96E8","type":"i","value":0,"nodeType":"Int"},{"uuid":"D664CAC9-4112-49F7-AB0E-934BE36423CE","type":"f","value":30,"nodeType":"Float"},{"uuid":"5AFC23A8-B0C3-45BE-9D15-80F9F3CAEC3E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"BB9E6E99-54E3-440D-BBC4-71C918CDD548","type":"c","r":0,"g":0.43137254901960786,"b":1,"value":28415,"alpha":"83D36540-09C6-440C-9EC1-CFC3404444EF","nodeType":"Color"},{"uuid":"83D36540-09C6-440C-9EC1-CFC3404444EF","type":"f","value":1,"nodeType":"Float"},{"uuid":"19492D45-9EAB-411D-8D19-E1BE2ADC09B6","type":"i","value":0,"nodeType":"Int"},{"uuid":"52777008-E6C1-4A29-B983-EC9D834DA076","type":"phong","color":"7C438DAB-6063-4221-AEE1-517D59063171","specular":"5AFC23A8-B0C3-45BE-9D15-80F9F3CAEC3E","shininess":"D664CAC9-4112-49F7-AB0E-934BE36423CE","shadingAlpha":"E1AEFCD6-3586-4F56-9BB4-858E013AADD9","shadingBlend":"2F954DCF-579E-483D-9733-8A39D7BB96E8","afterColor":"889D57FE-2C68-401F-B018-CFD921C90756","alpha":"6A6DC700-1D1E-46E4-8C2E-2CE2E3FA4E74","nodeType":"Phong"},{"uuid":"7C438DAB-6063-4221-AEE1-517D59063171","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"889D57FE-2C68-401F-B018-CFD921C90756","type":"v3","a":"80453B33-6260-4F03-BB65-B1CD725075F7","b":"BB9E6E99-54E3-440D-BBC4-71C918CDD548","alpha":"B218C2DB-E366-4A6A-9D27-9A5E47650697","mode":"19492D45-9EAB-411D-8D19-E1BE2ADC09B6","nodeType":"Blend"},{"uuid":"80453B33-6260-4F03-BB65-B1CD725075F7","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B218C2DB-E366-4A6A-9D27-9A5E47650697","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"83D36540-09C6-440C-9EC1-CFC3404444EF"},"nodeType":"Expression"},{"uuid":"6A6DC700-1D1E-46E4-8C2E-2CE2E3FA4E74","type":"f","value":1,"nodeType":"Float"},{"uuid":"D85A577C-7881-43E5-9A06-6094F8ACAF0D","type":"f","value":1,"nodeType":"Float"},{"uuid":"65102FAB-2F55-4831-8CDF-861CE72DC5F3","type":"i","value":0,"nodeType":"Int"},{"uuid":"D141E138-371D-4D50-B448-6852532A1E2B","type":"f","value":30,"nodeType":"Float"},{"uuid":"9EA0E336-B9BF-42C0-8771-1A72D981F45F","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"B3B9B2F7-D5AE-42C3-8B85-B49267027662","type":"f","value":10,"nodeType":"Float"},{"uuid":"BF22D190-16D5-4979-8E25-9F2EC107AFB6","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"E9AAC8EC-A9C5-4C8E-86D1-E4A175798395","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"BFD13CD4-6EDC-4476-A041-5D720C5B2A82","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"EF9DFE07-0CEE-4883-B301-B33DAC974C68","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"2EF72EC2-03A7-4328-BFCB-A935FDB1E4E2","type":"f","value":1,"nodeType":"Float"},{"uuid":"1B0D4A59-32A7-4422-9BA3-B9B57E4405A8","type":"i","value":0,"nodeType":"Int"},{"uuid":"1C3B2493-11C9-48B2-BDA9-4BBEE3BD3DFE","type":"f","value":50,"nodeType":"Float"},{"uuid":"86A41103-CBE5-4618-9860-CB37E01CD45F","type":"f","value":118,"nodeType":"Float"},{"uuid":"490113CD-118D-411A-ACF5-8861407ED55B","type":"f","value":1,"nodeType":"Float"},{"uuid":"E81536CE-5641-4D3E-8B54-82F610B31240","type":"f","value":0,"nodeType":"Float"},{"uuid":"B241C56F-46A6-4E0C-89A2-A9078B8F7CCD","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C4244EA8-9D41-42AB-BDF7-6C9DD20EE95F","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"74E73578-920F-45EE-BAB5-152B61A85C63","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E56EBAB9-9087-4712-8AC9-D06EF2F25005","type":"f","value":1,"nodeType":"Float"},{"uuid":"784962D7-4E37-4675-9FC3-0C527F376BE7","type":"i","value":2,"nodeType":"Int"},{"uuid":"D98E3CD8-7976-4D03-B015-D5234A2A0505","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"3F240F39-61FA-440C-B711-ABA946D32D06","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F7FF2954-2453-47C0-9A9F-82398DF2F0BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"577B9A2D-6921-4326-8A2B-FCAEA2596259","type":"f","value":2,"nodeType":"Float"},{"uuid":"4B2D5C52-9F9F-4CDB-ADB4-84BF790C4558","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"1A056D6A-FC70-4F4C-B041-0CDE0B6F2F17","type":"f","value":1,"nodeType":"Float"},{"uuid":"300C95D1-2EE4-44D1-AD8E-5836017238E6","type":"i","value":2,"nodeType":"Int"},{"uuid":"6C4E80E6-8146-4041-90E8-A9CF4604BDAD","type":"f","value":1,"nodeType":"Float"},{"uuid":"7C8E425C-3E29-446E-9C63-AAFC32759F0B","type":"i","value":0,"nodeType":"Int"},{"uuid":"75E5C94D-872E-4C05-8BC7-D3AD5EEE9887","type":"f","value":30,"nodeType":"Float"},{"uuid":"5FBE4A1A-FEAC-44E2-80A7-08186D1A47CD","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"CE5F3932-B5F1-4725-82F1-19D674690149","type":"f","value":10,"nodeType":"Float"},{"uuid":"C624B7FC-4905-4A11-BD23-9D52B4FF3B99","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3D457C55-D07F-4724-A5E8-F22387D4AD1A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A4E8D670-6CFC-445C-89B6-9669F842A349","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"48741304-5766-4A66-BFC7-37C2F29B6C5D","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"FBCE74E1-7369-4105-98F4-2FC85BBBDF63","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB353346-5E8D-4F8A-BC35-095278DFF364","type":"i","value":0,"nodeType":"Int"},{"uuid":"3622D62D-00B0-4649-8FDD-34A388BA84AE","type":"f","value":50,"nodeType":"Float"},{"uuid":"1DD45303-DA0A-4EC0-A0E7-9573DCF019DD","type":"f","value":118,"nodeType":"Float"},{"uuid":"2511313C-D77E-418A-AD09-23204C37ED0C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C2277CCD-A2F3-4910-916F-59556B16D073","type":"f","value":0,"nodeType":"Float"},{"uuid":"029CB127-0098-4A54-BA8C-DE6E809DDFFA","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3F2CFA8B-0DAC-4A76-BB8C-3980668E89C5","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"57ABC1E9-B210-4775-A346-EB8D4FBFF75F","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"D55C00B9-1EF1-4169-95B4-ADFBE9B419E7","type":"f","value":1,"nodeType":"Float"},{"uuid":"EF469764-AA5A-4BD6-8B4D-6F373A22F1FC","type":"i","value":2,"nodeType":"Int"},{"uuid":"B5132211-AAC1-4838-AD36-2B1FDFF62048","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"E71EB924-C5C5-438E-BD03-3474ED3E158D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"63D6D5C8-7EB5-4BFA-B6F9-C8A98FF451CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"CFEF1C16-012C-41D9-BF98-9F90485F05ED","type":"f","value":2,"nodeType":"Float"},{"uuid":"1F21DDED-9902-454C-90E6-65A99487042F","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"25598414-5C7F-4B95-8AEC-D4A4F5502D4B","type":"f","value":1,"nodeType":"Float"},{"uuid":"E464A59D-F9DB-472A-9103-503F4364AD34","type":"i","value":2,"nodeType":"Int"},{"uuid":"7E4C4C8D-C551-4F3C-B3C5-9308D612D35F","type":"f","value":1,"nodeType":"Float"},{"uuid":"AFC68500-0351-4CDD-B47B-A3470433E618","type":"i","value":0,"nodeType":"Int"},{"uuid":"A781A753-D516-44B4-BE48-5998674F139F","type":"f","value":30,"nodeType":"Float"},{"uuid":"2700F314-FE44-46F4-BCD7-F03E688A33FE","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"5F31136F-788A-43AD-A3C9-6473C2444ABF","type":"f","value":10,"nodeType":"Float"},{"uuid":"95FEC886-4129-4798-8616-FB5D1561F34F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"E1810BE3-71A9-4014-8968-64D2D54E29AD","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1863A5F3-5C55-42F0-B6BC-A918F1FEBA91","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"94AB6543-3E81-464D-9BD9-F38063A460FF","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"961BE7B4-A7FD-4B98-90A3-36A4688A2C08","project":false,"nodeType":"Texture"},{"uuid":"961BE7B4-A7FD-4B98-90A3-36A4688A2C08","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0AEA62A9-DE09-4E4E-A37B-A3550206451A","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"C1CC092F-379D-4AAE-AC5A-07D7BA88F124","project":false,"nodeType":"Texture"},{"uuid":"C1CC092F-379D-4AAE-AC5A-07D7BA88F124","type":"v2","index":0,"nodeType":"UV"},{"uuid":"F61B9108-543A-4006-9F54-3C21F11D3FDE","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"AC414F29-36E3-496C-A207-E294396A12E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA76B718-5A3D-45EB-B034-298BF3A0E119","type":"i","value":0,"nodeType":"Int"},{"uuid":"8885CA79-804F-4AE4-BCFC-CBA31227CACE","type":"f","value":50,"nodeType":"Float"},{"uuid":"E4916D9F-97A7-4D9A-B872-6779050A13E0","type":"f","value":118,"nodeType":"Float"},{"uuid":"DAA2A3F4-8F00-4753-874B-E3637C73728E","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD9D3E03-D409-4867-B097-A29CFED41E84","type":"f","value":0,"nodeType":"Float"},{"uuid":"630F85AA-3925-49B3-A816-844D73B65CC4","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"5338DDA3-440E-4B45-A90F-3E3364E2B844","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"2E5F33E0-9E98-41EB-A115-C4BA62154CE0","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"CB5787BC-99F5-4790-BBA3-41B167319992","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD60D244-D4C5-483C-A04D-0C88287BFE20","type":"i","value":2,"nodeType":"Int"},{"uuid":"BBC941CA-8007-4D8C-8175-04A75F60D504","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"1A2A58AE-D9B9-4B46-81E8-2E89B2260896","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"A02BFCCF-5068-4871-BA03-1B43FD7C424C","type":"f","value":1,"nodeType":"Float"},{"uuid":"30085517-3216-4D42-A496-B647055BCD87","type":"f","value":2,"nodeType":"Float"},{"uuid":"5C72B8EE-3EA3-4AF6-81E9-9999CDBE0509","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"8C3FB356-8C09-4599-950C-BDA4876FC9F9","type":"f","value":1,"nodeType":"Float"},{"uuid":"8E7FED9A-EF64-4A14-BA30-C2B35B2DC30A","type":"i","value":2,"nodeType":"Int"},{"uuid":"8D116142-FDD6-4CD7-90C9-933DCD0E6C8D","type":"phong","color":"75ACF730-B5B2-419F-8E6D-7F28F8134D4B","specular":"2700F314-FE44-46F4-BCD7-F03E688A33FE","shininess":"A781A753-D516-44B4-BE48-5998674F139F","shadingAlpha":"7E4C4C8D-C551-4F3C-B3C5-9308D612D35F","shadingBlend":"AFC68500-0351-4CDD-B47B-A3470433E618","afterColor":"621C14A1-1934-47C3-983C-340E89A25A88","alpha":"23D27F75-F1AA-4BF8-A1B9-C61DEDB7AB12","nodeType":"Phong"},{"uuid":"75ACF730-B5B2-419F-8E6D-7F28F8134D4B","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"621C14A1-1934-47C3-983C-340E89A25A88","type":"v3","a":"AC04FB96-D508-495F-AC82-CCFF9E7D526F","b":"EF4A39C1-A713-4A18-AE5B-884E17E59DDA","alpha":"47A20BB0-30DB-4AF2-ABAD-5ED45FEC5616","mode":"8E7FED9A-EF64-4A14-BA30-C2B35B2DC30A","nodeType":"Blend"},{"uuid":"AC04FB96-D508-495F-AC82-CCFF9E7D526F","type":"v3","a":"BD9912BC-48E4-4AE6-B240-F6634BEEA2A3","b":"5FEBB93A-B634-4381-823B-0A1A1C88AA95","alpha":"2C3E93BE-759F-4F24-9F8F-827562DDFBE0","mode":"CD60D244-D4C5-483C-A04D-0C88287BFE20","nodeType":"Blend"},{"uuid":"BD9912BC-48E4-4AE6-B240-F6634BEEA2A3","type":"v3","a":"C61F9ABD-AF08-4AB1-A000-D11CA6F32E7E","b":"035BD8F2-2554-4C04-AA08-41838BBA9FC2","alpha":"53D39DEB-187A-4B25-B320-E3F4DBD23BBC","mode":"BA76B718-5A3D-45EB-B034-298BF3A0E119","nodeType":"Blend"},{"uuid":"C61F9ABD-AF08-4AB1-A000-D11CA6F32E7E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"035BD8F2-2554-4C04-AA08-41838BBA9FC2","type":"v3","thickness":"5F31136F-788A-43AD-A3C9-6473C2444ABF","ior":"95FEC886-4129-4798-8616-FB5D1561F34F","roughness":"E1810BE3-71A9-4014-8968-64D2D54E29AD","alpha":"AC414F29-36E3-496C-A207-E294396A12E4","calpha":"g035BD8F225544C04AA0841838BBA9FC2_calpha","nodeType":"Transmission"},{"uuid":"53D39DEB-187A-4B25-B320-E3F4DBD23BBC","type":"f","src":"g035BD8F225544C04AA0841838BBA9FC2_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5FEBB93A-B634-4381-823B-0A1A1C88AA95","type":"v3","near":"8885CA79-804F-4AE4-BCFC-CBA31227CACE","far":"E4916D9F-97A7-4D9A-B872-6779050A13E0","isVector":"DAA2A3F4-8F00-4753-874B-E3637C73728E","isWorldSpace":"DD9D3E03-D409-4867-B097-A29CFED41E84","origin":"630F85AA-3925-49B3-A816-844D73B65CC4","colorA":"5338DDA3-440E-4B45-A90F-3E3364E2B844","colorB":"2E5F33E0-9E98-41EB-A115-C4BA62154CE0","alpha":"CB5787BC-99F5-4790-BBA3-41B167319992","nodeType":"Depth"},{"uuid":"2C3E93BE-759F-4F24-9F8F-827562DDFBE0","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"CB5787BC-99F5-4790-BBA3-41B167319992"},"nodeType":"Expression"},{"uuid":"EF4A39C1-A713-4A18-AE5B-884E17E59DDA","type":"v3","color":"BBC941CA-8007-4D8C-8175-04A75F60D504","bias":"1A2A58AE-D9B9-4B46-81E8-2E89B2260896","scale":"A02BFCCF-5068-4871-BA03-1B43FD7C424C","intensity":"30085517-3216-4D42-A496-B647055BCD87","factor":"5C72B8EE-3EA3-4AF6-81E9-9999CDBE0509","alpha":"8C3FB356-8C09-4599-950C-BDA4876FC9F9","mode":"8E7FED9A-EF64-4A14-BA30-C2B35B2DC30A","calpha":"gEF4A39C1A7134A18AE5B884E17E59DDA_calpha","nodeType":"Fresnel"},{"uuid":"47A20BB0-30DB-4AF2-ABAD-5ED45FEC5616","type":"f","src":"gEF4A39C1A7134A18AE5B884E17E59DDA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"23D27F75-F1AA-4BF8-A1B9-C61DEDB7AB12","type":"f","value":1,"nodeType":"Float"},{"uuid":"4147CCC4-905F-4FCE-A8DC-3C7E9F70B4E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"BCCA5CC0-60E7-4990-B2E5-95C95D182777","type":"i","value":0,"nodeType":"Int"},{"uuid":"A8DDCB6A-887F-4AD9-B008-30CB27276286","type":"f","value":30,"nodeType":"Float"},{"uuid":"BE330792-62FB-48A5-A40F-8DE567E3CBF4","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"CA2789F4-D9FB-43ED-A2E4-B6480FFAC1AD","type":"f","value":10,"nodeType":"Float"},{"uuid":"17D835E9-D96A-4328-A639-6D1225F704A9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"DCD811D5-0BE9-45FA-9EF3-8B80A57BB7A9","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CA29B1CC-ACDB-47B3-B788-F96483BC8296","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"7CF0C8CC-AE3C-450D-A8EA-00958D1823DF","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"5CB05C64-9B9B-4376-BA73-898FFE02A586","type":"f","value":1,"nodeType":"Float"},{"uuid":"C24E4B68-E76B-4F1D-AEB1-8A82818FE15E","type":"i","value":0,"nodeType":"Int"},{"uuid":"69C691E8-2D1C-43A1-8C64-5F6F59BA1EE3","type":"f","value":50,"nodeType":"Float"},{"uuid":"6533523F-5C2A-46F2-8C67-9C2B393D3B44","type":"f","value":118,"nodeType":"Float"},{"uuid":"8483FBAD-E155-4D19-8CD9-1D72ED3E821D","type":"f","value":1,"nodeType":"Float"},{"uuid":"EBEF7E9A-F8C0-49FB-841A-FC56802CF62E","type":"f","value":0,"nodeType":"Float"},{"uuid":"491F29DD-44DF-4551-83AA-B4CE47C839BB","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D6F6D41E-8BF5-4A63-A867-FBE9A1998C5A","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A3A9CB62-E317-44CA-9311-4021DE2E9084","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"340FE63F-CAD5-435E-B95D-AF9CC18CBBA3","type":"f","value":1,"nodeType":"Float"},{"uuid":"EB0B5AC9-EB88-481F-BC02-7988D50C4AFC","type":"i","value":2,"nodeType":"Int"},{"uuid":"71013CCD-2C26-4027-B5C0-C090E1C13C47","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"78A24CEB-3F73-4333-851C-93DBE414389A","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"39C05E5D-D796-44AB-874B-66720B2447DF","type":"f","value":1,"nodeType":"Float"},{"uuid":"62067E9C-F29C-4B3A-B765-D15A8A5CF825","type":"f","value":2,"nodeType":"Float"},{"uuid":"654FC1CD-4822-42CC-B452-B33B1929207B","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"C8CDF1A4-AE42-4F88-A9AA-9279DDC0169F","type":"f","value":1,"nodeType":"Float"},{"uuid":"0F66E1EE-AFDE-4726-8521-162AECD21E7A","type":"i","value":2,"nodeType":"Int"},{"uuid":"2EDB92C7-EF2A-41C5-8B51-3EC4AF89B6D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"2267E48C-154D-4EDE-8CE9-5594937DB083","type":"i","value":0,"nodeType":"Int"},{"uuid":"A6357BC4-2E63-43D0-A030-28249B5DF239","type":"f","value":30,"nodeType":"Float"},{"uuid":"9476A457-CD3F-4A88-908F-3BD794A86F75","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"37B6B6B9-0C46-46CA-9947-029F2C831CC3","type":"f","value":10,"nodeType":"Float"},{"uuid":"42AE6D7D-19F9-4832-9BC5-63C2FB1F2D0D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"9C217E01-92A8-4845-82B9-CFC5DED64BEF","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"247CEC38-BA86-4B8A-B2A3-C06BF279BD18","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A0DEF823-01CE-413B-8FC6-FC3F6CAD9DB2","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"61CA36BC-8264-4F4F-A4C5-3941A8B5A2DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"4B67293E-7CAF-465A-BD2B-D0BBF5F2259A","type":"i","value":0,"nodeType":"Int"},{"uuid":"AD85EAF6-8BDB-48AA-B1BD-DF845912EB02","type":"f","value":50,"nodeType":"Float"},{"uuid":"EB1C61F0-1CF4-4BFC-80DF-D3AC490E3074","type":"f","value":118,"nodeType":"Float"},{"uuid":"58595274-5AFA-4A2D-97EC-0112D3F500D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"00E6A1C4-212B-4482-8C9F-13E0C32D9F83","type":"f","value":0,"nodeType":"Float"},{"uuid":"64E539D1-AD23-4284-8F9B-56FD6B32E74C","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"846A09F3-758E-4784-8273-1AB680E08972","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"4F30ADEC-AFC2-4CC9-B179-6EBCB9106529","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"8F0820DD-6796-47C0-9421-FBD739DA730B","type":"f","value":1,"nodeType":"Float"},{"uuid":"E0C3F42C-3F66-4938-AF83-E24071897DB5","type":"i","value":2,"nodeType":"Int"},{"uuid":"7D39BB4A-37B9-4764-825C-2A2F8F1C930C","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"1D7182AC-5723-420B-A60F-0554B7ADBE83","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3A54C0CA-1827-4FC5-A24A-B65E2F71670C","type":"f","value":1,"nodeType":"Float"},{"uuid":"7B2ACC6C-D640-480B-A88A-2C1312FF5A91","type":"f","value":2,"nodeType":"Float"},{"uuid":"8638DAC1-C564-4832-8B49-B235C728E463","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"FCF86628-D421-45A1-90F5-11011CB36B2E","type":"f","value":1,"nodeType":"Float"},{"uuid":"00564B2F-E1DE-4A71-B9AD-44A29AC1BB1E","type":"i","value":2,"nodeType":"Int"},{"uuid":"1E8FD43A-5015-44C4-9491-1B5451E472B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"6CC4C4DA-EE72-4F15-9D99-0F60A5D932A7","type":"i","value":0,"nodeType":"Int"},{"uuid":"CE547A02-BC68-4042-88F5-86C445D3AC24","type":"f","value":30,"nodeType":"Float"},{"uuid":"86BC5AA3-8898-40C3-B9D1-7C9D961BA895","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"FE3D41F7-C876-4C06-871D-EF75EAA3E386","type":"f","value":10,"nodeType":"Float"},{"uuid":"413DFC53-6134-42E4-879F-7714B4A3492A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"259373AD-0EC8-4580-A1C7-A7FCF75CC907","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A35269A9-2460-49BC-82D8-6F744F4AAEEF","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E6F56D68-132A-488E-B02E-F5FED397AF9A","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"EDEBB892-432B-49A9-BBC4-8E268A8E31CA","project":false,"nodeType":"Texture"},{"uuid":"EDEBB892-432B-49A9-BBC4-8E268A8E31CA","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5245FE45-E6D0-46FC-B363-B263886A40DB","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"57F8FA94-76DB-4BF4-8E71-978714E41979","project":false,"nodeType":"Texture"},{"uuid":"57F8FA94-76DB-4BF4-8E71-978714E41979","type":"v2","index":0,"nodeType":"UV"},{"uuid":"59E39853-39F6-4636-B5F6-7D1F79C8D615","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"95180440-1EC3-43DA-B555-8E20521C7DD3","type":"f","value":1,"nodeType":"Float"},{"uuid":"CDFBA816-ADCF-4FD7-BCDB-B45FE5A3E87B","type":"i","value":0,"nodeType":"Int"},{"uuid":"C8A3685F-FE27-411F-9534-262A36A3BBAE","type":"f","value":50,"nodeType":"Float"},{"uuid":"0C7A3782-32F2-4635-BEAF-6948AD17FBAA","type":"f","value":118,"nodeType":"Float"},{"uuid":"C4EFE700-C79B-4E49-8D34-102EDBF50A8A","type":"f","value":1,"nodeType":"Float"},{"uuid":"774E1698-CA6D-42F7-8C4A-CB09E678F48D","type":"f","value":0,"nodeType":"Float"},{"uuid":"84C4DEC6-9264-4A02-B654-65FFE9582288","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"95FB1ABC-EDEF-40C3-941F-B2D5BF6D88F6","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"66C1AB90-56B7-4ACD-81E0-DF5DE829CD64","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"70204401-8C6B-40A3-BF0B-7562A3CFDF10","type":"f","value":1,"nodeType":"Float"},{"uuid":"6206CA43-6E82-4964-95CF-E6EC228BC619","type":"i","value":2,"nodeType":"Int"},{"uuid":"52245CAE-10D7-42E9-A8F8-043347B53D7E","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"F50AD037-D69D-43A2-82F9-C274F260DDAF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"33B61EC1-87BF-40AA-9BEB-D1C54B8EFA4A","type":"f","value":1,"nodeType":"Float"},{"uuid":"632DD93E-DC93-4F9A-8BB5-8821E02BB74B","type":"f","value":2,"nodeType":"Float"},{"uuid":"66BE0959-BE9D-41CD-B2B1-510D82CE1181","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"81360BCD-76BA-4777-9EFC-D8B5CC710C24","type":"f","value":1,"nodeType":"Float"},{"uuid":"457C39B3-A089-4147-BE7A-FFEB45CEF88F","type":"i","value":2,"nodeType":"Int"},{"uuid":"4049BC7D-E1B6-497F-9A63-5B8F1AEA55FD","type":"phong","color":"251B6701-CD31-4C2A-8F51-B3E3D8B459A5","specular":"86BC5AA3-8898-40C3-B9D1-7C9D961BA895","shininess":"CE547A02-BC68-4042-88F5-86C445D3AC24","shadingAlpha":"1E8FD43A-5015-44C4-9491-1B5451E472B8","shadingBlend":"6CC4C4DA-EE72-4F15-9D99-0F60A5D932A7","afterColor":"10C405BB-2527-432F-8D82-3FB3A2D69ECD","alpha":"EA22E0E0-8556-4887-A7F1-58F3335DDCEE","nodeType":"Phong"},{"uuid":"251B6701-CD31-4C2A-8F51-B3E3D8B459A5","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"10C405BB-2527-432F-8D82-3FB3A2D69ECD","type":"v3","a":"76B369EF-6FAD-4807-BAE2-16B5680FB506","b":"B497C2BE-8179-4EF0-93F4-6247A7807CE3","alpha":"557EED8E-3DAC-4273-85AF-A27EBE006A52","mode":"457C39B3-A089-4147-BE7A-FFEB45CEF88F","nodeType":"Blend"},{"uuid":"76B369EF-6FAD-4807-BAE2-16B5680FB506","type":"v3","a":"12E3A63A-25B3-4D3E-9FD4-AE0BD3AA085F","b":"F1E31B18-E2C3-47D6-8469-CB6C1F3BE635","alpha":"2F7DCD62-9981-43B7-94EC-E0DFAE5A333F","mode":"6206CA43-6E82-4964-95CF-E6EC228BC619","nodeType":"Blend"},{"uuid":"12E3A63A-25B3-4D3E-9FD4-AE0BD3AA085F","type":"v3","a":"3FF8310F-E37D-4B22-A833-63B932C58402","b":"30DD5D6B-6926-4E8D-A64A-CDF54F40085F","alpha":"4CC2738C-DFF9-433C-ABAE-EEE699EBB616","mode":"CDFBA816-ADCF-4FD7-BCDB-B45FE5A3E87B","nodeType":"Blend"},{"uuid":"3FF8310F-E37D-4B22-A833-63B932C58402","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"30DD5D6B-6926-4E8D-A64A-CDF54F40085F","type":"v3","thickness":"FE3D41F7-C876-4C06-871D-EF75EAA3E386","ior":"413DFC53-6134-42E4-879F-7714B4A3492A","roughness":"259373AD-0EC8-4580-A1C7-A7FCF75CC907","alpha":"95180440-1EC3-43DA-B555-8E20521C7DD3","calpha":"g30DD5D6B69264E8DA64ACDF54F40085F_calpha","nodeType":"Transmission"},{"uuid":"4CC2738C-DFF9-433C-ABAE-EEE699EBB616","type":"f","src":"g30DD5D6B69264E8DA64ACDF54F40085F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F1E31B18-E2C3-47D6-8469-CB6C1F3BE635","type":"v3","near":"C8A3685F-FE27-411F-9534-262A36A3BBAE","far":"0C7A3782-32F2-4635-BEAF-6948AD17FBAA","isVector":"C4EFE700-C79B-4E49-8D34-102EDBF50A8A","isWorldSpace":"774E1698-CA6D-42F7-8C4A-CB09E678F48D","origin":"84C4DEC6-9264-4A02-B654-65FFE9582288","colorA":"95FB1ABC-EDEF-40C3-941F-B2D5BF6D88F6","colorB":"66C1AB90-56B7-4ACD-81E0-DF5DE829CD64","alpha":"70204401-8C6B-40A3-BF0B-7562A3CFDF10","nodeType":"Depth"},{"uuid":"2F7DCD62-9981-43B7-94EC-E0DFAE5A333F","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"70204401-8C6B-40A3-BF0B-7562A3CFDF10"},"nodeType":"Expression"},{"uuid":"B497C2BE-8179-4EF0-93F4-6247A7807CE3","type":"v3","color":"52245CAE-10D7-42E9-A8F8-043347B53D7E","bias":"F50AD037-D69D-43A2-82F9-C274F260DDAF","scale":"33B61EC1-87BF-40AA-9BEB-D1C54B8EFA4A","intensity":"632DD93E-DC93-4F9A-8BB5-8821E02BB74B","factor":"66BE0959-BE9D-41CD-B2B1-510D82CE1181","alpha":"81360BCD-76BA-4777-9EFC-D8B5CC710C24","mode":"457C39B3-A089-4147-BE7A-FFEB45CEF88F","calpha":"gB497C2BE81794EF093F46247A7807CE3_calpha","nodeType":"Fresnel"},{"uuid":"557EED8E-3DAC-4273-85AF-A27EBE006A52","type":"f","src":"gB497C2BE81794EF093F46247A7807CE3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"EA22E0E0-8556-4887-A7F1-58F3335DDCEE","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1373,1111],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/color_light/index.html b/site/spline/design/color_light/index.html deleted file mode 100644 index 19a8a91aa..000000000 --- a/site/spline/design/color_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/color_light/runtime.js b/site/spline/design/color_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/color_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09Dk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ddKq0ELQh+KL1qUR4MvSEsoENIKrgALHNiMox+94K7tl9qnnMio8MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/color_light/scene.json b/site/spline/design/color_light/scene.json deleted file mode 100644 index 7497c9b47..000000000 --- a/site/spline/design/color_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"8F3FEE45-CB93-4F4A-B4A1-0BF5C92A07DA","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,6.253766493690371,-265.3621309320789,-136.93014103745625,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"interaction":{"uuid":"15D710A4-77AB-4AC2-8EA4-02012E3CFAD4","selectedState":0,"states":["5E4A9400-2AA2-41D1-947C-80453A355309","4692111C-F918-43C7-9B04-8295C93D49B7"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"8F3FEE45-CB93-4F4A-B4A1-0BF5C92A07DA","state":"4692111C-F918-43C7-9B04-8295C93D49B7"}]}]},"geometry":"9E59FFA2-D08B-46EE-887F-5FE835DD119D","material":"AAD0C55B-3E8C-4493-8907-FE4C9055FD17"},{"uuid":"599ECB7C-524E-4CB0-A62B-303F0498DF8D","objectType":"Mesh3D","name":"Cylinder","matrix":[1,0,0,0,0,0.3420201433256691,0.9396926207859083,0,0,-0.9396926207859083,0.3420201433256691,0,97.00000000000003,25.273190235103726,21.10344976262664,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9D53EC7D-BE1D-432F-A28A-FF235567B3A7"},"geometry":"53662741-B7F9-40D3-8FEB-E815E7DAD4B2","material":"ABA14BA3-BB25-4F90-BC07-56ED75A43B47"},{"uuid":"904D53E1-DBAD-4C99-A505-B4CBCDF534B5","objectType":"EmptyObject","name":"Empty Object 3","matrix":[-2.220446049250315e-16,-0.9396926207859092,0.34202014332566893,0,1,0,3.3306690738754706e-16,0,-2.7755575615628914e-16,0.34202014332566866,0.9396926207859084,0,92.36935750304066,100.88776286038362,-43.34609616109829,1],"layers":1,"children":[{"uuid":"8A704905-9920-4EB0-8A3C-7BF0DE2B61AF","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"F0002527-B921-4654-900B-57DBBE5EADD0"},"geometry":"CE4ABFBC-8BF9-4AF3-ADF1-5FB9653748F9","material":"4BFE2A7B-BBD9-4F44-9FDF-5FCFEDBF697C"},{"uuid":"85193378-6124-4FAF-A38C-3D868A2D27EC","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"343D96F0-4297-4ABD-979B-75C6092A9F7F","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"85193378-6124-4FAF-A38C-3D868A2D27EC"}]}]},"geometry":"82976F0D-D2F6-4220-92C8-8B24F4A2497E","material":"EF51B4A5-BDAD-4AEE-91E4-BB233DFE54D2"},{"uuid":"6FB79A05-AD50-42D8-A2F9-AC2CCBDAE892","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"6B545488-F69F-44E1-825C-5C482B67603F","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"6FB79A05-AD50-42D8-A2F9-AC2CCBDAE892"}]}]},"geometry":"C679BE5A-C813-49C1-ABA8-3BAD42D2F74D","material":"5B9EEFD4-1235-4EDD-A95B-9FBD761D4FDB"},{"uuid":"F5F6D84C-7CC2-47C6-8902-56CF344D8D93","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"A8CFA188-919B-47D2-8DE7-779CAA2D019B","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"F5F6D84C-7CC2-47C6-8902-56CF344D8D93"}]}]},"geometry":"98A0123B-31A1-4F9D-A204-FFF7F2B17C93","material":"DF994F3C-FB77-4590-9960-9AA011B61138"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3CCD36E0-D42F-45BF-94CE-DA5575D36750","selectedState":0,"states":["77DD83DD-76DB-486B-8735-FC15842CFD3C","516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"904D53E1-DBAD-4C99-A505-B4CBCDF534B5","state":"516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2"}]}]},"enableHelper":true},{"uuid":"1C01D82F-FBC4-4751-955F-259459EF8F69","objectType":"EmptyObject","name":"Empty Object 2","matrix":[0.707106781186547,-0.6644630243886743,0.2418447626479751,0,0.7071067811865467,0.6644630243886737,-0.2418447626479749,0,-1.3877787807814454e-17,0.34202014332566866,0.9396926207859082,0,26.216145018242443,82.33863499681486,-15.459433210864475,1],"layers":1,"children":[{"uuid":"83F51A1C-E58B-475D-A132-A751401CA72C","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"EA861408-DF34-4749-9AA9-F708E674E132"},"geometry":"800A2C89-8DF6-49A8-9D18-816FEAA84CB2","material":"74B25CEA-C961-40A4-8D1B-B4A93AC06A10"},{"uuid":"B9A4DD37-FC66-4B61-9223-E89FBB8C97A0","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"5693BA94-EAB4-4741-B6A1-532E3530F474","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"B9A4DD37-FC66-4B61-9223-E89FBB8C97A0"}]}]},"geometry":"73FA593B-63F2-4A2D-A903-13C3BEF35631","material":"FF09C548-3217-4D51-A0B6-A2499B8DBDD5"},{"uuid":"BB273F63-F8A1-481B-B443-D0A25AF83694","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"9D2EFB79-4782-43C9-A794-67C457F20D26","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"BB273F63-F8A1-481B-B443-D0A25AF83694"}]}]},"geometry":"18674ED6-3892-43BE-B470-58125BE07B82","material":"9C2AF9CB-F88F-4B35-92A9-58579C5AA32C"},{"uuid":"AA5A6F72-B2DE-497C-9F06-7D5E8CA388E4","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"BC588BE4-0998-4E04-A20D-1311A5689446","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"AA5A6F72-B2DE-497C-9F06-7D5E8CA388E4"}]}]},"geometry":"140B3368-07D0-4C4D-9B7A-3548A6329B56","material":"6A06BC1D-B48B-47DC-B90C-17FC92F16FE9"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"C890FC99-5C3E-4DDE-8449-EDC5545AE731","selectedState":0,"states":["67628BDE-F203-4663-9F76-86CD8738CDEA","4FD49F00-A18B-483A-AD36-D46CB67C520D"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"1C01D82F-FBC4-4751-955F-259459EF8F69","state":"4FD49F00-A18B-483A-AD36-D46CB67C520D"}]}]},"enableHelper":true},{"uuid":"5D8ADD83-A33C-42CD-819E-E06E6A5C4E96","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,0,26.322278031459916,26.909599194303738,1],"layers":1,"children":[{"uuid":"34576422-2066-4423-B65E-CB5A3900E665","objectType":"VectorObject","name":"Rectangle","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"742A4D05-6ED6-4D57-A459-1BE08B0BE871"},"geometry":"2F714834-8007-40FE-B1E9-7B12803C94AC","material":"2352E7DB-8D66-446B-9814-A6BC2E653B40"},{"uuid":"44973C8B-479D-4F2C-BFC7-AF470C6AAE6D","objectType":"Mesh3D","name":"Cube 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,17.633719618215366,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"281B66BE-DFC6-41A3-ADDC-536B97057603","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"44973C8B-479D-4F2C-BFC7-AF470C6AAE6D"}]}]},"geometry":"8401F36A-E7F1-4927-B900-AC111B8F38B8","material":"27BBBAF0-3A2B-49FA-8FF5-97CDDC60C659"},{"uuid":"FCB2FF3B-9A54-41E9-8AEF-F55772F73D07","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-47.80465037485732,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"417AE671-C1F0-4F16-9DD7-A8E81207E877","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"FCB2FF3B-9A54-41E9-8AEF-F55772F73D07"}]}]},"geometry":"D31F8D61-59E6-45C1-905D-FD48D1FF0260","material":"A7D4CB02-3F0C-427E-9D9B-DBD3D56ED2C6"},{"uuid":"F16FF680-3F5D-4600-87AB-E763926E242A","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-113.25455363642953,-0.46051938413916105,17.131948451456992,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,-12.565974225728496,1],"interaction":{"uuid":"2BF334DC-3162-42EF-8D3A-0974C14B257A","events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"F16FF680-3F5D-4600-87AB-E763926E242A"}]}]},"geometry":"7F7635D2-0192-4A82-88FF-F0948C682550","material":"D17A28AC-DC34-4A59-8D82-06B2E9D9CD1F"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"2EC3346F-2151-4E69-A502-885599CC1171","selectedState":0,"states":["64E22259-32F3-4937-A231-B4BF21846298","15300E2D-5D5E-499A-A86C-6509919441AA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":30},"object":"5D8ADD83-A33C-42CD-819E-E06E6A5C4E96","state":"15300E2D-5D5E-499A-A86C-6509919441AA"}]}]},"enableHelper":true},{"uuid":"D2E262C1-77C2-44B6-921B-7A9E9E8D79E7","objectType":"CombinedCamera","name":"Camera","matrix":[0.9324227598223329,2.775557561562891e-17,-0.3613693359504981,0,-0.11131732681956195,0.9513724059493865,-0.28722638797266087,0,0.3437968145795577,0.3080430898398384,0.8870812843741405,0,-290.980076661067,402.48553237217595,1101.0157332958515,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"82267438-18A9-4C53-B288-AA52690E4C35"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":999.9999999999956,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.5987369392383788,"nearOrtho":50,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"04890C0A-A143-4224-ACD2-0A58D1B14695","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-15.286007910624079,28.193893397430557,-161.37508197525244,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"interaction":{"uuid":"3CED1753-E540-47B4-80A8-DBA7D52364F8","selectedState":0,"states":["FB45152A-086E-4017-A1B9-90AD10E278B2","246E6078-E9F7-4306-B51A-114474566778"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"04890C0A-A143-4224-ACD2-0A58D1B14695","state":"246E6078-E9F7-4306-B51A-114474566778"}]}]},"geometry":"F05B6BA5-ADD4-4B53-8616-94D5C31C92E4","material":"0F1E6ECA-5945-494B-90FD-9109A0B63012"},{"uuid":"D3888AA4-44FD-4125-9011-F50929E95FB8","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,34.16950113948363,15.799680549464426,-205.0808009164132,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"interaction":{"uuid":"159A56BB-B56D-40D8-9A2D-9B8E9BF6191B","selectedState":0,"states":["EB00B0DA-0673-40D7-980F-F8E1B0576DEE","2FA1C378-8809-42B2-B41B-0A704465EA60"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D3888AA4-44FD-4125-9011-F50929E95FB8","state":"2FA1C378-8809-42B2-B41B-0A704465EA60"}]}]},"geometry":"8DB9FE98-E9EE-4E14-8E17-9C4B1BFD8FD1","material":"EC7D12C8-1EAB-4C54-B592-48C702A71F12"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.9739890765132867,-6.938893903907226e-17,-0.22659496647718,0,-0.08063521393220367,0.9345407404879134,-0.3466000095822422,0,0.2117622277624178,0.3558561568503523,0.910232472791866,0,211.7622277624177,355.8561568503528,910.2324727918673,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000013,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"D2E262C1-77C2-44B6-921B-7A9E9E8D79E7","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"9E59FFA2-D08B-46EE-887F-5FE835DD119D","userData":{"parameters":{"width":135,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53662741-B7F9-40D3-8FEB-E815E7DAD4B2","userData":{"parameters":{"width":46,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":8,"cornerSegments":8,"hollow":0,"height":46,"depth":46,"radiusTop":23,"radiusBottom":23},"type":"CylinderGeometry"}},{"uuid":"CE4ABFBC-8BF9-4AF3-ADF1-5FB9653748F9","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"82976F0D-D2F6-4220-92C8-8B24F4A2497E","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"C679BE5A-C813-49C1-ABA8-3BAD42D2F74D","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"98A0123B-31A1-4F9D-A204-FFF7F2B17C93","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"800A2C89-8DF6-49A8-9D18-816FEAA84CB2","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"73FA593B-63F2-4A2D-A903-13C3BEF35631","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"18674ED6-3892-43BE-B470-58125BE07B82","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"140B3368-07D0-4C4D-9B7A-3548A6329B56","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"2F714834-8007-40FE-B1E9-7B12803C94AC","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":0,"extrudeDepth":22,"surfaceMaxCount":1000,"extrudeBevelSize":8,"extrudeBevelSegments":1,"height":100,"depth":22},"shape":{"points":[-160.5,67,-160.5,67,-160.5,67,10,160.5,67,160.5,67,160.5,67,100,160.5,-67,160.5,-67,160.5,-67,100,-160.5,-67,-160.5,-67,-160.5,-67,10],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"8401F36A-E7F1-4927-B900-AC111B8F38B8","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"D31F8D61-59E6-45C1-905D-FD48D1FF0260","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"7F7635D2-0192-4A82-88FF-F0948C682550","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":6,"cornerSegments":8,"height":95,"depth":16},"type":"CubeGeometry"}},{"uuid":"F05B6BA5-ADD4-4B53-8616-94D5C31C92E4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8DB9FE98-E9EE-4E14-8E17-9C4B1BFD8FD1","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}}],"materials":[{"uuid":"AAD0C55B-3E8C-4493-8907-FE4C9055FD17","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"21A542DF-17EC-4A83-AEEE-C54B853EE28B","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C9AB9F2E-7190-4514-BC52-F504843E8B52","f1_mode":"9494FA1C-8AF3-408B-9371-BF3E1E49DF3A","f1_shininess":"1E4735A7-80B0-4385-8C0C-3D249D5228EE","f1_specular":"178DE441-100E-47A7-9EE2-DD890C2710A8"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"33987638-4575-4132-B9CF-E9D7EE0D3112","f2_ior":"3DCCD6DA-71F0-4FF1-BA5D-BFF661FB2CB6","f2_roughness":"D6975FAB-081D-4A99-83D0-6253476EAAEE","f2_transmissionSamplerSize":"223DA22C-0C77-4C44-A660-BF3B9B12D232","f2_transmissionSamplerMap":"45717FAA-94D4-4AD2-BF52-7407E5F95B27","f2_transmissionDepthMap":"40BC3F60-2133-4CA2-B758-539EB57CB566","f2_aspectRatio":"ACC32DDE-CCFB-4231-AF02-8697B44EA1FC","f2_alpha":"B70312B7-2348-4659-9419-FA4455A8E337","f2_mode":"EC2EF2B1-627A-4E8A-9D1A-9275940080B5"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"A3C1DC51-CB46-49D1-9225-E229BE428BA7","f4_far":"EBCBA87B-F55E-41A6-AA20-16C8218CC17F","f4_isVector":"43A71C16-D5FC-4903-B0DC-5C2D04E51DAC","f4_isWorldSpace":"5D65932F-6FC6-40BB-A768-3C80E01114CB","f4_origin":"CEE6BA2C-49FC-4CC2-829B-2B2FFBA87D90","f4_colorA":"86EBEC7C-189C-41E0-B3C2-2D03DB1C833A","f4_colorB":"0B86763C-DA59-4CEB-9966-79BAC5048B33","f4_alpha":"2D3D4E1F-CE43-4ECB-815F-DA540D3B5119","f4_mode":"91B54185-0E84-4B9B-A292-AE6F1337D97E"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"55486601-22A2-4D5D-87C6-F05FF874157E","f3_bias":"87DB10E2-0683-471F-9380-89947FB11934","f3_scale":"19BC4CAC-9565-4052-B3E8-AC843BC007C8","f3_intensity":"0BF5EACA-21AA-4312-BD34-DB87FA7FB368","f3_factor":"FE455310-5E20-4757-B1A8-191F80BA9C08","f3_alpha":"258A1B05-299B-4999-8AD0-2E99D1BC7E69","f3_mode":"3A41076D-14C6-480E-A085-0840C6942EA9"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"2E2F9197-4114-40FD-9B9E-114737C841A6","fragment":"2E2F9197-4114-40FD-9B9E-114737C841A6"},{"uuid":"ABA14BA3-BB25-4F90-BC07-56ED75A43B47","type":"ShaderMaterial","emissiveIntensity":{"uuid":"A3349E9A-439E-4E4D-A38C-4CE5D0D659C0","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"AA5D4031-6FB5-401D-BF0A-A96C092D45F4","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BFEC79E8-DC4D-48DB-9758-8738D5092909","f0_alpha":"8BE08877-498B-45DB-82C9-184DEEC015E1","f0_mode":"1E1FA5BD-2B06-4525-9BEA-2996B91853EF"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"76033C39-A0A3-4572-85FE-42494C7D589D","f1_mode":"7AF8ACE9-E091-4A84-B1A0-36156FD650A9","f1_emissive":"BAD177FC-82A7-4BE8-B3AB-1FAD85B97787"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"BF489775-4D6C-4AD5-BCAE-E9FE9ECDC6E4","f2_bias":"2334810B-18EF-4D63-B4FE-C112EEEBC186","f2_scale":"F07F7D6C-6C7A-48DC-AE0F-29270F5432F3","f2_intensity":"0AB6B2D1-B725-40FE-9DD4-9221620B7E6E","f2_factor":"2E989558-2105-4FA7-9481-AF35033D9D13","f2_alpha":"5739CB8D-34DD-4004-B154-4BB1D8E6F3D9","f2_mode":"69CB4FDC-ECF8-4973-A4B0-658475E6F758"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"2C88DC35-E054-47B2-84BF-1D2570DCCFAF","fragment":"2C88DC35-E054-47B2-84BF-1D2570DCCFAF"},{"uuid":"4BFE2A7B-BBD9-4F44-9FDF-5FCFEDBF697C","type":"ShaderMaterial","emissiveIntensity":{"uuid":"80E0E581-AB3B-4290-8BFA-5414767663BF","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"0FFE2130-0CF0-4A57-A079-0FB79A99FC2D","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"87552004-FEB9-41D6-A11E-4FE3CB70F850","f0_alpha":"0BF68EB5-71F2-4BDC-8B63-CACF36F2D708","f0_mode":"FA986B85-6B9B-4D8A-AFBD-A9F7D57D7896"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"99D0EAA8-90FF-40A7-88A1-98CB528B1BB9","f1_mode":"87B79E1E-9941-4A6B-A521-E2E6A0B1BA5D","f1_emissive":"1F110155-95DC-4D16-92A4-320A09F69718"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"6F5E1625-3AD3-48A0-A489-6A37065B4B14","f2_bias":"365987B8-3FB1-4433-96F5-B90019634ABF","f2_scale":"EC55B649-B443-462C-B44A-8C5F528BEFDA","f2_intensity":"078FFC06-25DB-464E-909F-8480F9C14433","f2_factor":"A2F3B962-161D-40DA-A1BD-162836C3C769","f2_alpha":"74CA9F7B-D82B-4FFE-A97F-E971F1EC43F6","f2_mode":"22321D96-D723-448B-9336-25148B18C4D9"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"6693B675-33D1-44CD-BAB5-3945530B5121","fragment":"6693B675-33D1-44CD-BAB5-3945530B5121"},{"uuid":"EF51B4A5-BDAD-4AEE-91E4-BB233DFE54D2","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"A915D7FD-DD8F-40D4-8CC6-186FB106B8E2","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F9C13482-249C-41AB-9E83-6EA6F4E5B6F7","f1_mode":"156AC25A-A7DF-497E-951E-980E43F954D2","f1_shininess":"2C40B31C-280A-45F1-B053-2375553E10AF","f1_specular":"4B981DFC-0EA9-4AD4-8BB8-06D060226072"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"AA5EDAF7-74B1-4F3F-AE19-001F12400A29","f2_ior":"DC8C9C58-AFD7-4DA9-8E07-9E767C3294E1","f2_roughness":"C3224CF5-D9B5-49F9-A0C4-543C40278065","f2_transmissionSamplerSize":"A4DEF40B-7B87-4ED0-BFBE-D4FB048592A9","f2_transmissionSamplerMap":"3E32C24D-FC0A-4F9A-B6DB-B44C03018954","f2_transmissionDepthMap":"4528D6AE-7197-435E-A9F6-F6E5E70F4048","f2_aspectRatio":"BE3C1A10-5F5B-4580-8152-6AF1EAA19B84","f2_alpha":"0C2CAB73-0F3E-4BFF-B18E-A3F577786131","f2_mode":"DAA9B963-6EE4-4819-94E0-0310C2E20068"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"19C2CCE5-5345-4A0B-B011-FB362B8F2CA8","f4_far":"11D2F097-C8E2-4A5B-9211-6045EA32A86B","f4_isVector":"FB5AD950-4010-431B-9B4D-62C55B755A73","f4_isWorldSpace":"5919901A-F89E-4015-8D24-F7694CC701DA","f4_origin":"23F605A2-D46D-4C92-B24F-838924221A09","f4_colorA":"A42E30D2-5D22-4FF4-B70B-EDBDA5D0291B","f4_colorB":"B0865AFE-BA03-4C38-9B46-A08BE564F1C0","f4_alpha":"848AD509-0FB2-4CC1-A4CF-9B7A7AD83186","f4_mode":"CFA37B1B-D936-4BF0-B2E1-6C5277718919"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"57696F64-EDA0-4B92-9037-17CDB1DEDA73","f3_bias":"4350E09C-1C16-46E1-84C9-77BF64AA226C","f3_scale":"E360B3A2-6588-42FD-8595-FA9D5872CE4C","f3_intensity":"7A59A56C-925A-4069-8B7F-1DC0A36206FB","f3_factor":"60065F0B-60D3-4140-B4AC-FE71B69C606A","f3_alpha":"F48CAC61-CFE1-45EC-A6A1-093E1CCD965C","f3_mode":"3162557A-3F5F-4A86-90D5-0874C3510A13"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"98253943-A1FD-42C4-8738-04A463582C51","fragment":"98253943-A1FD-42C4-8738-04A463582C51"},{"uuid":"5B9EEFD4-1235-4EDD-A95B-9FBD761D4FDB","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"A9BE1208-A39D-45D1-A0CA-06A9C09FC798","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2ABDE3E1-2621-4A12-8E32-82F4729826DF","f1_mode":"41256B8B-D19C-433C-9A98-20BA684A7CB2","f1_shininess":"2F3802A2-5907-4F79-814E-0D9AE0A91613","f1_specular":"F681BF72-B22C-4E38-8983-0BEF5A87B37A"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DEC225FA-C94E-46E5-BB7E-09229A99AE0A","f2_ior":"EF7BBAD0-89D7-481F-8B6E-07E85010B065","f2_roughness":"56E1F026-E49B-44B1-8EED-9C503BA4E2FF","f2_transmissionSamplerSize":"65F8929D-0B67-41E4-9E05-0AF6BC0DC0CC","f2_transmissionSamplerMap":"7329E780-5E03-42E3-AFCE-773B202A27C8","f2_transmissionDepthMap":"0CF940EF-85CF-4DE4-A194-EB3B53B16176","f2_aspectRatio":"BA777197-3F02-4CCD-9E3E-2635E05CBC88","f2_alpha":"29F93129-F252-4DD8-AE41-3E261B440DF0","f2_mode":"C63016F1-2347-44E0-A76F-DCA29CD49A0C"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"66361FE1-0B1B-4289-B449-A1F2ABA0C42E","f4_far":"0F658C5B-7FDB-4FB5-8F15-FF706268B7F4","f4_isVector":"BF0261E4-18E8-471C-95F7-3832788A3E12","f4_isWorldSpace":"FAE5DFDD-1DAF-4341-BB32-4E818EE89787","f4_origin":"8179E2C7-598A-466D-B808-15F6CCA6A6FD","f4_colorA":"53DCB421-4DB7-407B-9697-48D159C3AB06","f4_colorB":"0E8F8750-5285-4EFF-8A24-9E8A2FEA356D","f4_alpha":"A0A52037-3CFA-4544-8DC8-5C557FB131AE","f4_mode":"AEBCF7AC-CB2E-4A64-90F0-40A0DF1A86B4"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B2E601A3-8714-4269-8241-266B7663BBB9","f3_bias":"83531713-0249-442B-9D83-27B6262D670E","f3_scale":"E6BD314B-BFFD-48A5-B43C-4A98EE5F471C","f3_intensity":"0F3B9503-6AB7-4FAA-80CA-1AA9FADBF4FE","f3_factor":"6518E964-6ECA-42AD-882E-0A8D99CFFBED","f3_alpha":"CA1F4085-1C99-48E6-B447-24F94FF6C538","f3_mode":"89190305-DCB4-4153-937F-EBFCCD4D5A48"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"C9DE9848-15D7-4B28-B061-F3F8E34EBF65","fragment":"C9DE9848-15D7-4B28-B061-F3F8E34EBF65"},{"uuid":"DF994F3C-FB77-4590-9960-9AA011B61138","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"62A6FFA1-6B7D-45F0-A697-E8829DA5E0BD","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8D908A24-B7BC-4FAC-874B-566B638F5675","f1_mode":"C54D03FD-331F-4F11-99BD-304025BC4D43","f1_shininess":"116DE751-7C9D-46EF-9D59-6F50809293FF","f1_specular":"E576D8DC-8E65-45E4-96CE-3E1386D035B4"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"99A861EA-2484-424C-A472-B0D4FF0D1367","f2_ior":"EAC99946-E8C5-4BD5-97A2-7FDF2CE1E89C","f2_roughness":"508CDA6B-BBD5-4A2A-AE5C-CA366B34B229","f2_transmissionSamplerSize":"A7FB4ECB-B3AD-453B-B851-90AA531F1247","f2_transmissionSamplerMap":"E9365C99-A362-408C-9B46-227BC9188D93","f2_transmissionDepthMap":"A8964A7B-6BD2-4482-B6CD-31227D1CAA9E","f2_aspectRatio":"3BC0D060-C738-478B-9597-8240F2247FB2","f2_alpha":"73A7464B-7E6B-4D46-B766-1136AB7542A5","f2_mode":"5C44DA17-6034-4EC9-9CE3-C610D6DA83B2"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"83FC757B-357D-4B97-A8EE-8A985DF02321","f4_far":"505BCA11-029A-4D31-994F-5FAD19112810","f4_isVector":"A8794069-84EF-4BBB-B6DF-F6096DAC4585","f4_isWorldSpace":"AC8DEF5A-8C82-4699-B565-6398450F5C38","f4_origin":"A2919771-0D3E-4B4E-ADFE-E549CC2DAAE1","f4_colorA":"24ED793A-9017-4313-A115-CA996762B5BE","f4_colorB":"02B04F26-CD5E-49FF-8EF3-B41EB68E06BA","f4_alpha":"A98F7470-F248-44B3-8E88-04C419E385FA","f4_mode":"60A49D0E-86DC-4FB7-9636-D5D22AB7A3F0"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F02F1BF5-70C5-43E9-AB26-CA69EC8F6D76","f3_bias":"474BE9BB-F558-4AB6-AC49-9CDB65790FDE","f3_scale":"63923A34-1FF6-4AFA-AECC-5E99D135788A","f3_intensity":"34B42E09-38BF-441F-A76F-4BE2FBC49080","f3_factor":"2610BD71-6D7B-4347-92DF-6E6576BBE1F4","f3_alpha":"4FEF7036-A484-4F90-B398-93BC99CA4D61","f3_mode":"E8338D29-FDB2-4E36-8E48-E658EF6FE896"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"2643CA1A-186A-44FE-9C6B-C62AB25F820D","fragment":"2643CA1A-186A-44FE-9C6B-C62AB25F820D"},{"uuid":"74B25CEA-C961-40A4-8D1B-B4A93AC06A10","type":"ShaderMaterial","emissiveIntensity":{"uuid":"09201BDB-9749-4A38-9FC3-B333E2EA8C7A","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"8375C3D9-B81B-4B7C-BCBD-5F7BE2661376","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"FDF33604-9B4B-4746-9F38-4272FC78774A","f0_alpha":"91E68C70-DE77-4ED5-BB69-5538CA0ECF88","f0_mode":"F3F6B9DB-668B-4A3E-898C-C3814B19C11A"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BE6810BA-3C73-48A7-B00C-B625FA274A7F","f1_mode":"7A787867-F99B-40E5-8C22-FF84FDEBEF9E","f1_emissive":"F9F89CCD-F406-471B-A4C5-8024FAA24042"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"6F75EADE-3232-4A85-8FCE-111CBF47B146","f2_bias":"4043DDFA-EADF-4449-A3EF-E1612EF90EBF","f2_scale":"FAA56B23-D01C-46F4-AC3B-6541C63A35D6","f2_intensity":"FB1E40E9-E4C5-4CCD-97A6-512FB51C49B8","f2_factor":"F0F3AF6F-3ADD-444A-B597-EB15F3348260","f2_alpha":"3823B7E9-E929-4A7C-A6C5-A826AA17068F","f2_mode":"BE990376-9E2A-45B6-A764-AAD410FF8CEA"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"787D74A9-1816-4739-BCF7-632E89CF64D2","fragment":"787D74A9-1816-4739-BCF7-632E89CF64D2"},{"uuid":"FF09C548-3217-4D51-A0B6-A2499B8DBDD5","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"7F1B837D-FA94-425C-8A2D-13E4A7FC7FEC","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5D723D5E-58C8-41AD-B328-AA8ACAACDE42","f1_mode":"9CC55006-BEED-489B-91D6-A5B54AE1ED8B","f1_shininess":"175E1423-5958-45FB-AF7E-6AE0A47131C9","f1_specular":"966999E2-D4FF-4BC1-A450-9A115091FA78"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"62401A58-1B3F-4BAE-88A3-B67299B68190","f2_ior":"4E5A51C5-88D4-4711-83D4-FAD651160BEE","f2_roughness":"513C6510-9629-4A35-A7C7-B4D6BB598E3D","f2_transmissionSamplerSize":"32D486F2-9F44-4080-8B59-07B4826756F5","f2_transmissionSamplerMap":"0964EE45-C8FC-48D4-9C55-EC5FA86E6CDF","f2_transmissionDepthMap":"4BCD9EF6-A590-4F41-B689-6D0C3F36F66D","f2_aspectRatio":"51F81343-A9A6-45D6-8700-B4B1E7AAB214","f2_alpha":"CD8C13C2-C5E5-4534-9ECA-C058AB73CFF4","f2_mode":"FE6B56D8-22AD-4F7A-8056-EA821A16DAF5"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"50EA0E6E-13E9-4628-BEB5-C2D948C825D5","f4_far":"D1B7C8E5-6AE4-4305-95BF-F64AE259ADBE","f4_isVector":"1EE3367B-0015-4045-851C-301DB588ED02","f4_isWorldSpace":"C47568FD-516C-47D6-89F2-166F6E08CF8E","f4_origin":"91556329-AA79-4C72-9800-FD3791AE670D","f4_colorA":"0733A8BE-68A3-4B07-956F-7572C054FB15","f4_colorB":"8006D527-DC10-445C-B4DA-DA019DAA0313","f4_alpha":"2AB37687-DBAA-4FFA-9A3E-387077442CB6","f4_mode":"4F4C04EE-BF6C-4038-8178-C4B65D70E0A1"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F9C4E0A5-13C7-4505-8228-F4A16AD8CF91","f3_bias":"9A598DFD-F573-4D97-AC08-C23CB31ED3F1","f3_scale":"C35F1E2F-D63D-4635-BC42-F244E5C3B383","f3_intensity":"3F859F58-BF6E-4284-BC4F-1802F779167D","f3_factor":"92A384B6-36BA-44D0-ADE8-0850425416A1","f3_alpha":"B6A888AA-0282-470A-99F9-A04C60C1D4F6","f3_mode":"8E08E7FD-C38B-44E9-B5B6-086E0A3F3602"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"9EB6A1E1-1971-46F9-A3B0-E52A01DF1653","fragment":"9EB6A1E1-1971-46F9-A3B0-E52A01DF1653"},{"uuid":"9C2AF9CB-F88F-4B35-92A9-58579C5AA32C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"EE49FADF-433A-4DB2-99D0-6D2083AC0CD3","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"484C1514-5D4F-429A-8009-E46E4532AED7","f1_mode":"FFE7A746-81E4-49D0-B48E-3DAC4CAFA2DA","f1_shininess":"5358C6B5-36B2-4886-8CBB-94B5ED4D6EC4","f1_specular":"C1592B91-6BF5-46E3-8839-C496B080C92D"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"68F3510F-6558-4210-91A4-3E76AE82DC31","f2_ior":"A7F81714-E5DD-44D6-B4D8-06B88E1F41A9","f2_roughness":"FE61D2EE-EF32-4C30-88ED-B11AF1CCCA53","f2_transmissionSamplerSize":"AA3FD39C-21F3-4E5E-B414-4BD85F1E7CB6","f2_transmissionSamplerMap":"DDA50281-069E-4134-8369-DD34B47D35DA","f2_transmissionDepthMap":"30ABA315-6B50-40D0-B57E-92FEF8678CD2","f2_aspectRatio":"4E3A6CFA-9D8F-45FD-BA67-B29AFED8AE18","f2_alpha":"61C4F0B2-05CF-4A29-870D-6338C712C372","f2_mode":"483A5ECA-ECD5-409A-90E3-8FD8C5B3C5A1"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"42C59357-0FAA-420B-A6B8-4D2FDBE3D4CA","f4_far":"6B1EA8D3-A828-444D-95B4-DAF5710F7C00","f4_isVector":"A59F3827-FA5E-495A-A92F-32E8AD51EF64","f4_isWorldSpace":"6587C43F-1339-48D1-87BF-590D91919E14","f4_origin":"0C53B79F-0D2E-4C8C-A414-C241C7C2C8A9","f4_colorA":"1F946CF8-4E85-49F6-85B3-41ED13D64C11","f4_colorB":"90BD8B34-7C9F-419B-A391-C41E2CF6F993","f4_alpha":"A83C94D9-F56E-4730-A129-5D5812EB74E1","f4_mode":"AF23D36E-BA13-4C52-81C4-BE1CBBE50690"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"EAB961B2-910C-498A-8CA7-CC9E0868C410","f3_bias":"BBD3EC53-F3DE-4639-A2B5-039B6B4DB117","f3_scale":"F3D8E9F6-ECCC-4097-8F18-FB0699C5365C","f3_intensity":"C684FB39-C6C3-4386-A1C5-AD2FEB9F305F","f3_factor":"7844ED4C-DD4B-43FC-9F22-CFBF07DACB40","f3_alpha":"BB79AC22-0050-4962-A9BD-46D524E7A925","f3_mode":"EF672207-E4AA-4C50-982F-F7FBC358C1C9"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"BC91557F-E870-43F1-BE64-08F126AAA313","fragment":"BC91557F-E870-43F1-BE64-08F126AAA313"},{"uuid":"6A06BC1D-B48B-47DC-B90C-17FC92F16FE9","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"46367505-5266-4007-8F3F-F0CAEEB5473A","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2BA13361-FB94-45D2-854F-C111395F145F","f1_mode":"F9FA2E32-F570-4617-9287-6CCC99C66597","f1_shininess":"B3E00C21-5CFA-4A34-A6CE-3726D15F08FB","f1_specular":"5A0D4F70-E86B-4F7F-8E9F-1CC80ED76630"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5484C4D2-0DB5-4465-8E63-CF303124534C","f2_ior":"9054AD34-3EA7-48E7-9A95-831E0C8D837F","f2_roughness":"76D7E7DA-DCF1-4F4B-9343-7138C5BE4B10","f2_transmissionSamplerSize":"BC25B4F6-0C5B-4F60-800E-BFF6620F4127","f2_transmissionSamplerMap":"04B76353-C723-4690-BB5A-80DEC938202A","f2_transmissionDepthMap":"ED09B5A9-DAF3-460B-97A7-7A690F7759EA","f2_aspectRatio":"BC1FD3BD-563C-4987-AE3C-066D0D36F0ED","f2_alpha":"C5B50162-BFC4-48EF-B6EA-1B968DB0553F","f2_mode":"1AF57012-D004-4E60-AF5C-BB05E4513297"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"48104DF0-AE27-42F2-89E0-07267A6DCE69","f4_far":"29C2105B-F2CC-474B-B84F-42CC33DEDC9D","f4_isVector":"5A2CF87C-18B4-47ED-BF76-6FB1E550F22F","f4_isWorldSpace":"4801E43A-99C5-4FD8-BD99-185C5E473E2B","f4_origin":"99F63B3A-105F-4C99-8F85-EF04F1DAD5E4","f4_colorA":"9D01C42E-3985-4156-8A77-6ABDAC29063D","f4_colorB":"447D0D22-5FA0-4830-BD49-98AD3E2CA682","f4_alpha":"5EDE7900-51AC-44AA-A387-4678621F0D63","f4_mode":"77950BA7-1E8B-454B-A4AC-119E9440189F"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"1488B993-5420-4767-9A95-4F39A2FB2D8F","f3_bias":"7A66DB8B-58E1-40A8-990C-4A2EC942DBE3","f3_scale":"397E68D1-20F7-48A2-9992-1F1FBB7CF7E3","f3_intensity":"4C1008DA-D1FB-40D0-860D-5CE9E67FCBCA","f3_factor":"0A0CA126-9DEA-4AA3-8C6B-6A63115A29C9","f3_alpha":"7888E796-3CB1-4AC1-8644-BF5452B06FBC","f3_mode":"A8AB473C-E072-45F0-B192-E595B5911ABE"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"066795CA-302A-4B46-8D7A-30CB6529243F","fragment":"066795CA-302A-4B46-8D7A-30CB6529243F"},{"uuid":"2352E7DB-8D66-446B-9814-A6BC2E653B40","type":"ShaderMaterial","emissiveIntensity":{"uuid":"1FD72F11-0E00-4E0A-810B-079A68E35C24","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"5904E71A-14EA-49F9-9BA7-C96DB28271CD","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"C9A769E1-43DF-4418-AB19-9E4C0A2533D1","f0_alpha":"9BA2E2D3-0539-4F81-9C11-C8FC223191EC","f0_mode":"7CF936D8-D39A-4E1D-80F1-2C457818D764"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"647660D0-1206-4EC2-9DD5-60DC648550AC","f1_mode":"AF7F09A8-08AD-4A80-9BAB-1AC5784F11F9","f1_emissive":"1653D575-A0A5-4982-8C7F-84319722A0FF"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"A663181D-AFDD-4F35-88A8-1B2C79A48125","f2_bias":"370E5D12-A562-4A65-8586-C3157BEE284D","f2_scale":"884CB91C-A4D6-4503-A21F-CE8E81922DCC","f2_intensity":"5BF1A9EC-61E4-4711-A9F6-4CE8C91F7F1D","f2_factor":"13C3CA7C-9AD2-492C-96C7-96BBC1BFDD77","f2_alpha":"1A3D6141-5E19-4499-B9E6-62A4C546095F","f2_mode":"A8DB1A2F-5E84-4A5F-A862-D064C83B42DF"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"0C2EDF54-7E99-4D32-854C-54443B3B66E8","fragment":"0C2EDF54-7E99-4D32-854C-54443B3B66E8"},{"uuid":"27BBBAF0-3A2B-49FA-8FF5-97CDDC60C659","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"0405CE18-9B5D-4908-A53C-5302BE17D8D5","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"A65CA6B0-054E-4FD2-8589-2FE09BE8767C","f1_mode":"40449ABC-49F8-4EE5-8BB4-841CD72C7295","f1_shininess":"3C40B306-8A60-4EB9-A7AB-146C0B077053","f1_specular":"FAC20942-DD34-4E7E-8766-A55F7F21D7E1"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6240E78F-A9B3-41BB-8E4B-50F36312277A","f2_ior":"EC80C9FF-E763-4171-A927-8A1A89DB39AE","f2_roughness":"12C00ABD-CF8D-48FB-857B-3AE515130095","f2_transmissionSamplerSize":"0E37A3F7-1DE3-48ED-8B8D-F8510D265583","f2_transmissionSamplerMap":"C72A74B1-80C0-4D72-9AB9-476E2710C40F","f2_transmissionDepthMap":"D3B1A4D4-E7F4-4013-A005-0A573ADB47D9","f2_aspectRatio":"7498B20F-8926-45A0-82DB-8B4E22062FFF","f2_alpha":"1318EEBB-3370-4B5D-A6F0-51B51ACCFBE5","f2_mode":"365D787F-5F6F-4783-9942-A7B1896533F7"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"0BCD19F0-A86E-4F78-83E7-9F09CAB3CB94","f4_far":"80FF2F5D-F45B-4B33-AE6A-E0597F6339AA","f4_isVector":"228841E2-49C8-4A6C-A562-E0FD0B438814","f4_isWorldSpace":"C60EE18A-0CAF-4F18-9741-9D3229CD7F01","f4_origin":"ABE590E5-3B9A-4EFA-9E1D-7B9023E5BEF8","f4_colorA":"FFB2DEE8-DDAB-4FFF-88A4-0253E0948FDC","f4_colorB":"6E590138-6786-49D0-BB51-6175CEC278C2","f4_alpha":"0A7F2832-5C42-44DE-93F6-BAE6EB1F2ECE","f4_mode":"A3145E79-ADB6-4CE0-AE5A-838E105108E6"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"589EF3A6-DA8B-4DD5-97B1-73DF2677BA99","f3_bias":"65B1DAF5-BD29-40B3-9E59-37E9DF715DAA","f3_scale":"DD6185AD-8385-46C5-A4EC-1C7A02155B3E","f3_intensity":"67249777-FC4A-4A37-90C7-90A8ED6861E8","f3_factor":"005E6840-F7EC-4CD4-A8A7-AABBEDCEB2E2","f3_alpha":"D573E4B3-24BA-4443-9A99-7D1D3B8B6AC0","f3_mode":"A755EC0E-A1EB-411E-A7A9-D0A4F3613E43"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"E0123BBF-A4D9-4B79-B02B-541E15F8506C","fragment":"E0123BBF-A4D9-4B79-B02B-541E15F8506C"},{"uuid":"A7D4CB02-3F0C-427E-9D9B-DBD3D56ED2C6","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"D9438D90-564B-4488-8BBF-48FE7CC8D148","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D88BA1B7-5A9B-4D4F-BFC9-7427F6C25813","f1_mode":"8FDE0E7C-68AF-4CDB-90B9-D82FEE34F083","f1_shininess":"992E79FF-D3F5-495D-B7B5-92193DEFB0DB","f1_specular":"D18F822A-C5AF-4512-A258-EB69BF567E24"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"502D1FE5-8B3E-4184-BE6B-EEBE72A1D983","f2_ior":"285C5029-D887-4946-8630-1D6CFD5CF455","f2_roughness":"DD5FAED6-C3B6-43E1-B0AC-A96F0AC25F8B","f2_transmissionSamplerSize":"57DDE948-0D3D-4544-BD1B-69D3FDA8D6E8","f2_transmissionSamplerMap":"9EEADD74-9BEE-49D2-891D-0C027183DB68","f2_transmissionDepthMap":"94256F27-2334-42AE-9ECA-E3C6724ECB51","f2_aspectRatio":"9F1592D7-76AA-4094-92F6-026AE1E6138F","f2_alpha":"EE752D12-EBC4-48EB-B1BB-C86155A10B20","f2_mode":"9FEEC81C-8107-4182-8533-D53DAB80BCE9"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D3792316-B100-4DC9-A4D0-4ACD79BD6CB8","f4_far":"39514DE8-731D-44EA-9505-6389FEE4321C","f4_isVector":"5A232138-325C-443D-AF0C-335D731CE859","f4_isWorldSpace":"9632E64F-3A83-4A8B-86AF-2167917D7224","f4_origin":"697AAF77-34AD-41C9-AEFB-364995CFD84A","f4_colorA":"2D210595-3F34-4BFF-ADF6-AE748732546C","f4_colorB":"7795B6A4-7450-4CF2-ADFD-C4C177C46808","f4_alpha":"DBC57924-E7AC-4E5F-A1DA-684BA8A730C0","f4_mode":"7D2C63B4-FD2F-408B-8C95-F0B95BCDAD9C"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"AEAA25DE-F136-4225-8405-915937E700E0","f3_bias":"1C4FC337-0D03-4C51-A614-E1154D182862","f3_scale":"FEE79E88-D899-4A06-AFEC-59F610273F78","f3_intensity":"9BA428C0-B0A4-4EE0-A79A-47348E76A293","f3_factor":"F9455A5B-FFBF-40C8-8336-0392134FD5D0","f3_alpha":"FCCDA6BC-2793-49F8-91D7-98AD077AA151","f3_mode":"4EB7775B-8E80-434D-BD25-FB9FC6BC29E1"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"145A0902-0A69-4D8C-8474-8FDA1661C1A4","fragment":"145A0902-0A69-4D8C-8474-8FDA1661C1A4"},{"uuid":"D17A28AC-DC34-4A59-8D82-06B2E9D9CD1F","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"407B1ECF-6F8A-4242-A766-5CF9035EA1BA","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C945F7A1-EFC0-4ED1-87A0-7C33BB9FA43F","f1_mode":"6F2EDC34-CF76-4663-8E71-14F0B3EEF894","f1_shininess":"163BD641-4991-4904-8A7E-3A6043CA8046","f1_specular":"1F0FB2B6-F197-4708-9AC7-BF734207B1DA"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"018447A8-61B4-4942-B472-4A9012B697DB","f2_ior":"33F66752-9447-4943-AA13-6DE401E71F27","f2_roughness":"3BF5C95E-3B61-48E7-9542-67F2BE92D74A","f2_transmissionSamplerSize":"50D73010-ACF4-450C-A9BD-95890ABB3500","f2_transmissionSamplerMap":"30699311-6457-46A3-8ADC-8797A4D42E66","f2_transmissionDepthMap":"0684F1FD-DAE9-4141-BBAD-ED42E6BC9270","f2_aspectRatio":"87D214B8-09AF-4785-BCB8-7963E0F76D16","f2_alpha":"1B7730FB-2632-44FE-83F6-3744376F6E21","f2_mode":"A137770B-858A-4074-BC71-018165BBE247"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"5645E55F-81E4-4BB7-B22A-999140F2AE06","f4_far":"7C574E29-82A2-4B6E-92E9-A98E6EFFB357","f4_isVector":"1B27DD54-BA11-40DE-8746-4FEE189DCDBC","f4_isWorldSpace":"C1C97AB2-6D08-4639-82F4-A38AE8812347","f4_origin":"B3792114-9DC7-499C-AC3D-395E06E66EC1","f4_colorA":"3AFEE082-B047-499B-9497-31F3581306C4","f4_colorB":"1DC1DCB9-28BC-4269-9D94-B4DFC32E95D4","f4_alpha":"BC99BFD5-E0C9-40F1-8C52-4EA57B814D46","f4_mode":"E2CE9C92-FD67-4C2A-8F80-BED0DE6DD915"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"87ADFA15-CBFA-4164-8E84-3D166F73CBCA","f3_bias":"75D5D667-F7B6-42D1-AAD8-1EC335599088","f3_scale":"C03FECAB-3C8D-4CBD-A2FF-83A75FAEDB35","f3_intensity":"3D3DE70C-BCA3-49E7-BE9F-70344EA82BF4","f3_factor":"AB539115-BA17-483C-B020-2231A0431CDD","f3_alpha":"C8711B08-701A-4CED-86E6-53A68E9C950C","f3_mode":"C3BC28CB-646A-4BF5-AC3E-1D286D33F46B"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"1AF7BCCB-B827-4644-844A-968D3A3883D4","fragment":"1AF7BCCB-B827-4644-844A-968D3A3883D4"},{"uuid":"0F1E6ECA-5945-494B-90FD-9109A0B63012","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"24F59AEA-7578-4D12-9FD1-2677690163D0","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C00A2568-2D70-4C7C-B69C-894F65714681","f1_mode":"9249A607-3C94-4098-B076-1EE7324A3566","f1_shininess":"011BA7EE-BBC4-4A72-9469-57562E2958B3","f1_specular":"469D3246-2E57-4C62-AA7B-F8D1CF46D3DB"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B7C6EA51-18CB-4906-9D34-86583AD384C3","f2_ior":"83C45AD9-F416-4E60-81CC-96D8D790E2D3","f2_roughness":"F239F2F2-1B6C-462C-BDB2-94A0D6A457E7","f2_transmissionSamplerSize":"9C097F89-4824-494A-8361-2902B17C2E10","f2_transmissionSamplerMap":"7EE6762D-FE2D-41C2-A150-A9BEABB52CAA","f2_transmissionDepthMap":"446A44B0-E1CF-4470-A48C-F3D21EF77B2D","f2_aspectRatio":"09C89CAB-8FB9-43C1-88F0-5B0E8F016A08","f2_alpha":"79FE293B-116C-433B-AB37-67BC202628CA","f2_mode":"B54F4322-7821-44F9-87D2-C19F09E5B2E2"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E94E5936-B05D-431A-82EB-B08D2E333100","f4_far":"D833BB61-82FF-4FA0-8E19-E92617735A0D","f4_isVector":"EC92E25D-134C-4459-A8DB-11F0FDA9AA57","f4_isWorldSpace":"1BAE41AA-E4E7-490F-86AC-C8C6D1A33C21","f4_origin":"FFE9D9E7-AC2B-4410-B869-0F6BA252F72A","f4_colorA":"D414832B-BDB7-4DDE-9635-DD7E6ADC0595","f4_colorB":"00A818EB-CDF3-4E98-9770-0C7877BE91DC","f4_alpha":"ACB1DF72-5335-4807-B5E9-44AE5E61E806","f4_mode":"EF41405F-F8AC-4425-9AE7-36F750481FFA"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"01E86A42-AC6B-4C92-80B9-BF70984494AE","f3_bias":"591625F3-E974-4529-8A05-0D5F09D6F272","f3_scale":"4771018E-7A1A-48C1-B7DC-FA54EB2AECE3","f3_intensity":"DA848ADA-68C1-4B8D-9E86-1858A0425785","f3_factor":"254BB84F-9E53-4305-812A-BE6A7CBFFED1","f3_alpha":"A2130A6A-9D16-4FF5-99F4-59F299B2EC4B","f3_mode":"2543792B-4A9C-4D45-B24E-0137FEC5958D"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"898DD51E-82E5-4ECF-936C-DB9BB8869008","fragment":"898DD51E-82E5-4ECF-936C-DB9BB8869008"},{"uuid":"EC7D12C8-1EAB-4C54-B592-48C702A71F12","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"84770754-4439-458A-89C1-EB1B3FF4C68E","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2D01189F-D61B-490B-8B85-4A1175159DA1","f1_mode":"44367F92-FF9C-44B3-8292-B060B13CE38B","f1_shininess":"E17CBDE0-69FF-44CD-B932-CE7008203DB9","f1_specular":"A55F6C1B-331F-463B-AFF4-79373099A694"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"264A1EB0-5A13-4689-9C8D-56D78986371A","f2_ior":"B35A4597-B419-4A57-BD9E-3FBFB0E72D30","f2_roughness":"CFD9E468-A87A-440C-A8C0-CD3020EB06AC","f2_transmissionSamplerSize":"8957C859-0C67-4573-B87B-4596045C3BE7","f2_transmissionSamplerMap":"C2262E10-6ADC-4EC2-8554-0AD07D9DD7AD","f2_transmissionDepthMap":"53E26472-8706-4636-A692-DB17DD553DCE","f2_aspectRatio":"16911111-A0B4-4645-9061-CDBC11316771","f2_alpha":"96642886-B5A8-4FAC-BAF0-05179689E970","f2_mode":"636E1E6D-7A78-4F55-B9CD-3BC5E7913C64"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E1DE21A6-AE68-4B25-879B-EB005F00010A","f4_far":"15F80B00-AE56-465D-B687-E48607B8DEDF","f4_isVector":"1CC2AD57-FA1D-4F75-ADAF-4CB51CA9054E","f4_isWorldSpace":"FCB56A05-D7CF-4CA0-9EF7-964AEAFD141F","f4_origin":"176C635E-ADB4-4C17-8EF3-56AEA0E425E9","f4_colorA":"AB435291-A95F-4FAD-9690-5A57C7EC2F9E","f4_colorB":"BB89ED14-68DB-4C3E-AD8B-02DDF35CF499","f4_alpha":"949EC30E-4092-42B7-A966-B18DD36ED153","f4_mode":"0B5C5CD8-398B-4B17-A52A-159CB66093D0"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"02E2850E-C276-40D6-90D0-3FF0E466B254","f3_bias":"646AF896-441D-4D60-9481-987CDAFEA871","f3_scale":"A495FADF-A576-4FFD-9D2F-28AC8F271D99","f3_intensity":"4BB1CE90-4874-412D-BB17-8C40B9B87930","f3_factor":"050C1D72-C1A6-4B22-8071-51B02D2E5F84","f3_alpha":"8951F2F0-4B18-4751-BBF8-00DC51442EA4","f3_mode":"602E5348-FEB2-4B93-BE94-B2A440CFAE97"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"10503716-FA03-4ECF-9671-8B72F623C746","fragment":"10503716-FA03-4ECF-9671-8B72F623C746"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"5E4A9400-2AA2-41D1-947C-80453A355309","name":"Base State","position":[6.253766493690371,-265.3621309320789,-136.93014103745625],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"geometry":{"width":135,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0B0FEBCA-740D-4179-812C-2193F794DE91","f1_mode":"26A74691-4F17-41A8-9D11-83D687A64B3A","f1_shininess":"851836AE-85B7-4E56-AD85-4E0E6951B7ED","f1_specular":"86C643A0-BCEA-4413-B339-D04AE5CC612B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"79F2B25C-B207-49AE-9DFC-109C2B94A127","f2_ior":"7AC80086-D836-4BCD-8B7D-30ADCE624407","f2_roughness":"09F77B2F-CF2F-4DC0-9109-F20789B77403","f2_transmissionSamplerSize":"FB384979-7A7F-45C7-9747-75356DB14544","f2_aspectRatio":"B1ABEAA9-24A4-48FF-8F6F-C29E3BEC117C","f2_alpha":"1D24B7ED-9496-4DDB-ABED-D9E0AE7D21EC","f2_mode":"E137E1FD-2CFA-4C07-83CE-A19B557455B7"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4142730C-2FC2-47A3-A994-7B9AC866635D","f4_far":"2E5CA0D0-1D9A-4D83-8A82-8116777847AE","f4_isVector":"95A33572-5F9F-4D73-A1A0-7B71F748D27E","f4_isWorldSpace":"A4F8E75D-CD4B-48C5-A5D8-17CB756FEAB5","f4_origin":"2C395FE8-FAA0-4F49-BE48-4A4F6A802833","f4_colorA":"A7F146A8-D159-4A72-A7F2-018E61A044CD","f4_colorB":"79B344FE-1580-4239-816E-DF866C6A1C89","f4_alpha":"49A02B2B-37DA-4EBE-8C3A-9CF3750A4277","f4_mode":"7E87A33B-01FF-4ACD-896F-B032C158ED9F"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A4A1FA7F-CD76-4586-B549-1942A51EF697","f3_bias":"8B5F2410-E898-44F3-97E8-188F3716F867","f3_scale":"FD6F5616-B277-40A8-AECF-3969EBFF1D37","f3_intensity":"6198DC6E-9BE5-4394-AEFB-E30DE3DB1268","f3_factor":"6CC09153-21F3-4FAB-BED6-92A7DE6159E3","f3_alpha":"94AD678E-47C8-494E-8597-704254ECCE26","f3_mode":"B572073E-8010-4958-BE49-CD99CD6EB8A6"}}]}},{"uuid":"4692111C-F918-43C7-9B04-8295C93D49B7","name":"State 1","position":[6.253766493690371,-265.3621309320789,-136.93014103745625],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,116.72788238922661,152.79924110331524,76.51849721098415,1],"geometry":{"width":135,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4A236387-46CC-4C13-8FF4-51DC61AF407E","f1_mode":"DD07084D-224E-4522-82BD-FBEEFD830D32","f1_shininess":"76974667-0CB0-4853-81B4-9E74FA54835A","f1_specular":"5FCF349E-C4A0-4D33-B8D4-D87AAEE81C1E"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DE0CB40B-4C7C-4233-955C-DC328AF9F3C4","f2_ior":"7E66AFC9-0ECE-470A-8FB0-BFCB3CBC35DF","f2_roughness":"5C7DE7BA-432C-4944-8931-155A5D30F130","f2_transmissionSamplerSize":"9C35B0A4-FB18-48EA-B5DC-6E74B63A1DC5","f2_aspectRatio":"8E2CFAF6-4494-4D11-9B23-0C2917365C33","f2_alpha":"E540BA68-1390-4952-A384-732B76BD22C2","f2_mode":"4D759F4F-ACB0-4FDB-8E18-38F31F87ECA7"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"AAAD8581-0D87-43A0-A8E9-F695E33CBB44","f4_far":"BE4ECC8E-1FB4-4CDA-A9EE-3020839A5EB8","f4_isVector":"54752F32-330D-4C13-A96B-8C94BB77E25A","f4_isWorldSpace":"9F589581-78F7-4267-B167-D43E372B0CC5","f4_origin":"37CDFB67-48BD-4406-8F1E-A9266C7E0616","f4_colorA":"F808844C-A7D6-4D09-9B55-F9CB6858CFF6","f4_colorB":"4A9F6D98-D7A0-4205-AFFD-E36ABB3386B1","f4_alpha":"4883D47F-8B0E-4488-BD87-1109D765556D","f4_mode":"7AE6C259-8F45-46A2-8CF2-8BBA55E382B2"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"42408C29-80CD-465B-AB37-8DC42B3D450A","f3_bias":"0589E84D-C710-4924-9A68-C264CBB572A5","f3_scale":"DB0BBC2F-683F-453E-8762-3F75FF946C34","f3_intensity":"A8924C15-809C-4161-9D9A-325AFE6EF744","f3_factor":"C4B910FC-4EF6-479F-8532-FD41BBA12B03","f3_alpha":"63A5B5F0-B09F-4E2B-B7A9-CB40A6AFC5B8","f3_mode":"D0734410-626F-4419-BEEA-BC56F93B37B2"}}]}},{"uuid":"77DD83DD-76DB-486B-8735-FC15842CFD3C","name":"Base State","position":[92.36935750304066,100.88776286038362,-43.34609616109829],"rotation":[-0.34906585039886595,-2.220446049250313e-16,-1.570796326794897,"XYZ"],"scale":[1.0000000000000009,1.0000000000000004,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"516EDB01-E53E-4E4F-869E-0B0DBFBDF1A2","name":"State 1","position":[92.36935750304066,100.88776286038362,-43.34609616109829],"rotation":[-0.3490658503988659,-2.498001805406602e-16,-1.5889800452763108,"XYZ"],"scale":[1.000000000000003,1.0000000000000022,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"67628BDE-F203-4663-9F76-86CD8738CDEA","name":"Base State","position":[26.216145018242443,82.33863499681486,-15.459433210864475],"rotation":[-0.34906585039886595,0,-0.7853981633974485,"XYZ"],"scale":[0.9999999999999993,0.9999999999999988,0.9999999999999998],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"4FD49F00-A18B-483A-AD36-D46CB67C520D","name":"State 1","position":[26.216145018242443,82.33863499681486,-15.459433210864475],"rotation":[-0.3490658503988661,1.1102230246251565e-16,-0.8032480444141423,"XYZ"],"scale":[1,1,0.999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"64E22259-32F3-4937-A231-B4BF21846298","name":"Base State","position":[0,26.322278031459916,26.909599194303738],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"15300E2D-5D5E-499A-A86C-6509919441AA","name":"State 1","position":[0,26.322278031459916,26.909599194303738],"rotation":[-0.34906585039886623,0,-0.016753365040717234,"XYZ"],"scale":[0.9999999999999961,0.9999999999999991,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"FB45152A-086E-4017-A1B9-90AD10E278B2","name":"Base State","position":[-15.286007910624079,28.193893397430557,-161.37508197525244],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B7164B44-EB2C-4680-BFAF-961B9CEC73D5","f1_mode":"7A557D73-1AEC-49AB-A613-906B4B873366","f1_shininess":"CC84EC6B-88C6-4049-B4DE-B5182705E4C5","f1_specular":"4FFC60F5-EA83-4BC5-98D1-F29C23A81C48"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4AE19871-5B80-4514-BEBC-8C1A77E124B5","f2_ior":"E6FF2A5C-E29A-4898-9545-280EE32FEB64","f2_roughness":"97412FA1-946F-400F-96D8-2BC557E680E6","f2_transmissionSamplerSize":"8DFE1665-95E2-4EC8-9FCD-0F6241E35E0A","f2_aspectRatio":"D3256E82-604B-4D38-A598-FBC96A7F2744","f2_alpha":"246DF61F-5202-4F72-8E63-E4AAB568B783","f2_mode":"F18151D0-37EB-4ACF-AE04-D24895A059CC"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C9847147-0078-44C6-9D15-702F62D675D8","f4_far":"63C630C5-51D2-4D34-9045-253931828D15","f4_isVector":"F527B3D7-FFBD-4CC2-B40C-3A2F9A9B6220","f4_isWorldSpace":"D651C7E4-63D5-4375-AC94-65E7CDB231F5","f4_origin":"AB367644-D08D-4C59-8AC3-F598F56BD53B","f4_colorA":"44BF7401-C965-4ADF-A6AC-12AD700CD34A","f4_colorB":"B44EBBBD-A526-49A4-9A70-8254FB3A388D","f4_alpha":"F88613A5-B863-43F4-B32B-F0EBD5F0CD75","f4_mode":"6393A22F-3F4E-4E45-92B0-496323566437"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7D2F3DEB-4CF8-4DFA-9D5B-C5FED5810DEF","f3_bias":"49F3FEB4-FFD2-4A24-9E22-1C9F4DB09B9D","f3_scale":"7E7ED73D-3C47-463E-A123-42B381DECDCD","f3_intensity":"FB7B7483-F9C9-40B3-B09A-BA28F26FDB62","f3_factor":"1BC67844-F9AE-435A-A0A1-AE8E4BCAA9F2","f3_alpha":"BC51CFA2-4F08-4C77-81DE-009416E11A68","f3_mode":"F6164187-9CE8-44A1-9A51-19CB8B6AD52F"}}]}},{"uuid":"246E6078-E9F7-4306-B51A-114474566778","name":"State 1","position":[-15.286007910624079,28.193893397430557,-161.37508197525244],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-224.2887527687844,136.20788090448275,110.66917703146927,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DBD773D2-E154-47DA-9738-7C03C27634B8","f1_mode":"8A03247E-81E7-4107-9661-B8B251231C1D","f1_shininess":"0E53E028-8FF3-46FD-9E03-403AF627283C","f1_specular":"D55A5A6D-B7B7-468D-8C80-B4A66070C61B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B2FB0964-2DC7-4DE8-BBD5-E472CB2FF77F","f2_ior":"0EEE3A0A-390C-4A69-BF94-AD1C4BAAFE53","f2_roughness":"ED00FB39-58C5-44C6-8E29-117822D9922F","f2_transmissionSamplerSize":"61005767-B162-4110-A62A-6F045C57C1BA","f2_aspectRatio":"2FDE52A9-C996-4577-9BC7-9B13A06767B4","f2_alpha":"AC81BD71-23FD-4E54-9AAA-C968A6F15CEF","f2_mode":"6009D537-CBFF-4D3D-B782-0171B7FEA517"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"A461DFB4-6849-4017-88DA-1BC791498718","f4_far":"79E09BE2-4A71-475F-9C6C-2ED34273242D","f4_isVector":"7981FA42-FEED-4D90-BFCF-AF32187852AE","f4_isWorldSpace":"E2540DED-561A-4868-8EE6-B9A2965A1081","f4_origin":"8694CAD4-1858-4ACE-A4A0-D528168AC0ED","f4_colorA":"D6C9472E-0D59-4044-8E7E-B56DA59CDB7B","f4_colorB":"388E080A-ADEE-4726-B514-1E16D6A8FE5B","f4_alpha":"E1361F3D-5BFF-43C8-8CAC-64D3D6BD7AF0","f4_mode":"EAA1BAD6-E0C3-48D6-8B0C-6E6532174D2A"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"22A9ECDE-0418-4EF6-9ABB-31C5D2DD84DA","f3_bias":"7DB26221-422D-4D5A-BF1E-0244F56CF865","f3_scale":"90987169-1C65-4B82-9C0B-3A65DAEE818A","f3_intensity":"97D17124-8BAD-4A68-AD1C-683A2255D1C3","f3_factor":"E19C7789-6357-41F8-9A19-5BBCCD3385A3","f3_alpha":"C512DE7C-4D4A-43F8-BBB2-E69AD73E5809","f3_mode":"769025A8-A4E3-4373-BC75-0525733913EC"}}]}},{"uuid":"EB00B0DA-0673-40D7-980F-F8E1B0576DEE","name":"Base State","position":[34.16950113948363,15.799680549464426,-205.0808009164132],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BDD98DD0-AC0E-4D68-8E7B-DB1BFCBCBCE9","f1_mode":"D3F8BE9B-2556-4060-88A4-C89FB412A7A5","f1_shininess":"F479A9C0-51C6-4B4D-B703-1E310903D7F9","f1_specular":"7BCCE0F6-4B35-4AA9-88B0-087BAB29D007"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5C629552-21DD-4FC4-8AF4-F9D3F1FBF5EE","f2_ior":"FAC68640-74F4-4B94-90C2-8ADC2CDC915E","f2_roughness":"E8F94A76-59EB-4A85-AAD8-2B86333E291A","f2_transmissionSamplerSize":"34071F06-0EB3-459B-B5CF-68263F37D822","f2_aspectRatio":"B0DADF5C-46FA-495D-96DF-36CAF737A56C","f2_alpha":"5A37C20B-2AE7-4FF2-94F8-D0B3052503C2","f2_mode":"129D0CF8-D81F-4AD6-BB7B-9AD09A7A3B4B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"35396001-3869-45D6-861C-25D46EEB38B5","f4_far":"9950BB2D-F33A-47E1-87BC-D9E8405D3BA9","f4_isVector":"9A319E8C-D4DD-43CF-9593-6FC8D989F1EA","f4_isWorldSpace":"E20EF353-A910-4CEC-9BAE-DFD1D8DB60D1","f4_origin":"85A1A2C3-064B-4891-9750-3279FF0F3BE8","f4_colorA":"727C98A8-674A-4373-8401-4D1BE1029334","f4_colorB":"C68D0CCC-5A42-4BD5-AD43-1FAE9C4A6035","f4_alpha":"576BB030-88FC-4141-94B5-42BB4673F959","f4_mode":"69E2A9D7-EDB4-46F9-859B-E0ADF642DF2F"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"21140693-88E6-48F8-BC7F-D3B594B95E87","f3_bias":"51A57E9A-3966-4501-874D-3538A88756ED","f3_scale":"76DAD6EE-3644-4718-86F2-C9F55B5DD640","f3_intensity":"03C4FAB4-3ECF-4D6B-9C3F-C011FFC494FA","f3_factor":"26068DF8-4EE6-4825-98D3-BC118FAAA57C","f3_alpha":"1BC40063-C166-447E-BA6A-D50038ADD9E2","f3_mode":"1C14C6EC-4044-462E-8660-31E182A13D0E"}}]}},{"uuid":"2FA1C378-8809-42B2-B41B-0A704465EA60","name":"State 1","position":[34.16950113948363,15.799680549464426,-205.0808009164132],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,162.89043797908207,225.45995942737545,83.76311100547215,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DA2C907D-DC41-45F3-B3D0-E69791B93BAD","f1_mode":"931ADA70-3A00-43C0-8A77-CE7590C3D47D","f1_shininess":"D471FDE2-BA06-44C2-9B0B-78EE0F5B68AB","f1_specular":"B199EF9D-90F7-49FE-8255-0782ED05948A"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"31D63810-2B3C-458C-BC55-A98A5F562318","f2_ior":"47318336-F800-4052-B331-EFFEA362EEFE","f2_roughness":"F7C32DFC-AA8D-4CD7-978A-BF202A2A59E2","f2_transmissionSamplerSize":"51FE92EB-820F-42C8-9E05-9FAC4612C647","f2_aspectRatio":"5B1651C5-B861-4B5E-A809-066F9FCD86E1","f2_alpha":"3C580090-CD5E-4A17-A7B2-41936CAD7D32","f2_mode":"3A7BB33C-EFC6-4D76-AE3F-A2FD70C8DAB3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"7219C4F7-22C1-43D5-BD1D-28FD79967814","f4_far":"55FD9C43-6AF0-4B62-ABA2-C33721E05B45","f4_isVector":"23B42463-0F4F-40AE-B93B-9D11CC307BD9","f4_isWorldSpace":"C0B880A8-22DD-44E0-B74A-5E73BFC41EF3","f4_origin":"1FAD900F-581D-4650-B5C9-68C40D5B7612","f4_colorA":"91EDDB1E-8D6F-4FCB-8323-3577F10CC5C5","f4_colorB":"067D6531-EB1B-4201-BB1F-FBCD2969A359","f4_alpha":"6101E624-24D8-4C6F-BBA2-FA56ECC22F4F","f4_mode":"45E524BB-90CC-4ABC-BC3E-2C79FB646ABB"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"48143EE6-044E-405F-85C1-2D12C40924CA","f3_bias":"6FAF0760-FC59-4454-8F6E-9C53C525A3E4","f3_scale":"968CDBFC-624D-4EA9-BA47-F2A86B09F0B4","f3_intensity":"6A41A9A9-B94D-42C0-B7B6-5B52023C0E93","f3_factor":"1013C849-AC2F-470C-8DAF-4382D130A9E7","f3_alpha":"AFE9D7BD-7D66-4164-A7C2-51ED25DEE09A","f3_mode":"924FD8BE-65BD-4997-B6C9-B4B2C7865446"}}]}}],"nodes":[{"uuid":"0B0FEBCA-740D-4179-812C-2193F794DE91","type":"f","value":1,"nodeType":"Float"},{"uuid":"26A74691-4F17-41A8-9D11-83D687A64B3A","type":"i","value":0,"nodeType":"Int"},{"uuid":"851836AE-85B7-4E56-AD85-4E0E6951B7ED","type":"f","value":30,"nodeType":"Float"},{"uuid":"86C643A0-BCEA-4413-B339-D04AE5CC612B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"79F2B25C-B207-49AE-9DFC-109C2B94A127","type":"f","value":10,"nodeType":"Float"},{"uuid":"7AC80086-D836-4BCD-8B7D-30ADCE624407","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"09F77B2F-CF2F-4DC0-9109-F20789B77403","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FB384979-7A7F-45C7-9747-75356DB14544","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B1ABEAA9-24A4-48FF-8F6F-C29E3BEC117C","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"1D24B7ED-9496-4DDB-ABED-D9E0AE7D21EC","type":"f","value":1,"nodeType":"Float"},{"uuid":"E137E1FD-2CFA-4C07-83CE-A19B557455B7","type":"i","value":0,"nodeType":"Int"},{"uuid":"4142730C-2FC2-47A3-A994-7B9AC866635D","type":"f","value":50,"nodeType":"Float"},{"uuid":"2E5CA0D0-1D9A-4D83-8A82-8116777847AE","type":"f","value":145,"nodeType":"Float"},{"uuid":"95A33572-5F9F-4D73-A1A0-7B71F748D27E","type":"f","value":1,"nodeType":"Float"},{"uuid":"A4F8E75D-CD4B-48C5-A5D8-17CB756FEAB5","type":"f","value":0,"nodeType":"Float"},{"uuid":"2C395FE8-FAA0-4F49-BE48-4A4F6A802833","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A7F146A8-D159-4A72-A7F2-018E61A044CD","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"79B344FE-1580-4239-816E-DF866C6A1C89","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"49A02B2B-37DA-4EBE-8C3A-9CF3750A4277","type":"f","value":1,"nodeType":"Float"},{"uuid":"7E87A33B-01FF-4ACD-896F-B032C158ED9F","type":"i","value":1,"nodeType":"Int"},{"uuid":"A4A1FA7F-CD76-4586-B549-1942A51EF697","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"8B5F2410-E898-44F3-97E8-188F3716F867","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FD6F5616-B277-40A8-AECF-3969EBFF1D37","type":"f","value":1,"nodeType":"Float"},{"uuid":"6198DC6E-9BE5-4394-AEFB-E30DE3DB1268","type":"f","value":2,"nodeType":"Float"},{"uuid":"6CC09153-21F3-4FAB-BED6-92A7DE6159E3","type":"f","value":1,"nodeType":"Float"},{"uuid":"94AD678E-47C8-494E-8597-704254ECCE26","type":"f","value":1,"nodeType":"Float"},{"uuid":"B572073E-8010-4958-BE49-CD99CD6EB8A6","type":"i","value":2,"nodeType":"Int"},{"uuid":"4A236387-46CC-4C13-8FF4-51DC61AF407E","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD07084D-224E-4522-82BD-FBEEFD830D32","type":"i","value":0,"nodeType":"Int"},{"uuid":"76974667-0CB0-4853-81B4-9E74FA54835A","type":"f","value":30,"nodeType":"Float"},{"uuid":"5FCF349E-C4A0-4D33-B8D4-D87AAEE81C1E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"DE0CB40B-4C7C-4233-955C-DC328AF9F3C4","type":"f","value":10,"nodeType":"Float"},{"uuid":"7E66AFC9-0ECE-470A-8FB0-BFCB3CBC35DF","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"5C7DE7BA-432C-4944-8931-155A5D30F130","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9C35B0A4-FB18-48EA-B5DC-6E74B63A1DC5","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"8E2CFAF6-4494-4D11-9B23-0C2917365C33","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"E540BA68-1390-4952-A384-732B76BD22C2","type":"f","value":1,"nodeType":"Float"},{"uuid":"4D759F4F-ACB0-4FDB-8E18-38F31F87ECA7","type":"i","value":0,"nodeType":"Int"},{"uuid":"AAAD8581-0D87-43A0-A8E9-F695E33CBB44","type":"f","value":50,"nodeType":"Float"},{"uuid":"BE4ECC8E-1FB4-4CDA-A9EE-3020839A5EB8","type":"f","value":145,"nodeType":"Float"},{"uuid":"54752F32-330D-4C13-A96B-8C94BB77E25A","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F589581-78F7-4267-B167-D43E372B0CC5","type":"f","value":0,"nodeType":"Float"},{"uuid":"37CDFB67-48BD-4406-8F1E-A9266C7E0616","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F808844C-A7D6-4D09-9B55-F9CB6858CFF6","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"4A9F6D98-D7A0-4205-AFFD-E36ABB3386B1","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"4883D47F-8B0E-4488-BD87-1109D765556D","type":"f","value":1,"nodeType":"Float"},{"uuid":"7AE6C259-8F45-46A2-8CF2-8BBA55E382B2","type":"i","value":1,"nodeType":"Int"},{"uuid":"42408C29-80CD-465B-AB37-8DC42B3D450A","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"0589E84D-C710-4924-9A68-C264CBB572A5","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DB0BBC2F-683F-453E-8762-3F75FF946C34","type":"f","value":1,"nodeType":"Float"},{"uuid":"A8924C15-809C-4161-9D9A-325AFE6EF744","type":"f","value":2,"nodeType":"Float"},{"uuid":"C4B910FC-4EF6-479F-8532-FD41BBA12B03","type":"f","value":1,"nodeType":"Float"},{"uuid":"63A5B5F0-B09F-4E2B-B7A9-CB40A6AFC5B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"D0734410-626F-4419-BEEA-BC56F93B37B2","type":"i","value":2,"nodeType":"Int"},{"uuid":"C9AB9F2E-7190-4514-BC52-F504843E8B52","type":"f","value":1,"nodeType":"Float"},{"uuid":"9494FA1C-8AF3-408B-9371-BF3E1E49DF3A","type":"i","value":0,"nodeType":"Int"},{"uuid":"1E4735A7-80B0-4385-8C0C-3D249D5228EE","type":"f","value":30,"nodeType":"Float"},{"uuid":"178DE441-100E-47A7-9EE2-DD890C2710A8","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"33987638-4575-4132-B9CF-E9D7EE0D3112","type":"f","value":10,"nodeType":"Float"},{"uuid":"3DCCD6DA-71F0-4FF1-BA5D-BFF661FB2CB6","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D6975FAB-081D-4A99-83D0-6253476EAAEE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"223DA22C-0C77-4C44-A660-BF3B9B12D232","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"45717FAA-94D4-4AD2-BF52-7407E5F95B27","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"3ADB87BD-64C6-4AA8-A0A4-77139CEC7E53","project":false,"nodeType":"Texture"},{"uuid":"3ADB87BD-64C6-4AA8-A0A4-77139CEC7E53","type":"v2","index":0,"nodeType":"UV"},{"uuid":"40BC3F60-2133-4CA2-B758-539EB57CB566","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"D891D214-20D0-4F62-AE2C-9101D5781909","project":false,"nodeType":"Texture"},{"uuid":"D891D214-20D0-4F62-AE2C-9101D5781909","type":"v2","index":0,"nodeType":"UV"},{"uuid":"ACC32DDE-CCFB-4231-AF02-8697B44EA1FC","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"B70312B7-2348-4659-9419-FA4455A8E337","type":"f","value":1,"nodeType":"Float"},{"uuid":"EC2EF2B1-627A-4E8A-9D1A-9275940080B5","type":"i","value":0,"nodeType":"Int"},{"uuid":"A3C1DC51-CB46-49D1-9225-E229BE428BA7","type":"f","value":50,"nodeType":"Float"},{"uuid":"EBCBA87B-F55E-41A6-AA20-16C8218CC17F","type":"f","value":145,"nodeType":"Float"},{"uuid":"43A71C16-D5FC-4903-B0DC-5C2D04E51DAC","type":"f","value":1,"nodeType":"Float"},{"uuid":"5D65932F-6FC6-40BB-A768-3C80E01114CB","type":"f","value":0,"nodeType":"Float"},{"uuid":"CEE6BA2C-49FC-4CC2-829B-2B2FFBA87D90","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"86EBEC7C-189C-41E0-B3C2-2D03DB1C833A","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"0B86763C-DA59-4CEB-9966-79BAC5048B33","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"2D3D4E1F-CE43-4ECB-815F-DA540D3B5119","type":"f","value":1,"nodeType":"Float"},{"uuid":"91B54185-0E84-4B9B-A292-AE6F1337D97E","type":"i","value":1,"nodeType":"Int"},{"uuid":"55486601-22A2-4D5D-87C6-F05FF874157E","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"87DB10E2-0683-471F-9380-89947FB11934","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"19BC4CAC-9565-4052-B3E8-AC843BC007C8","type":"f","value":1,"nodeType":"Float"},{"uuid":"0BF5EACA-21AA-4312-BD34-DB87FA7FB368","type":"f","value":2,"nodeType":"Float"},{"uuid":"FE455310-5E20-4757-B1A8-191F80BA9C08","type":"f","value":1,"nodeType":"Float"},{"uuid":"258A1B05-299B-4999-8AD0-2E99D1BC7E69","type":"f","value":1,"nodeType":"Float"},{"uuid":"3A41076D-14C6-480E-A085-0840C6942EA9","type":"i","value":2,"nodeType":"Int"},{"uuid":"2E2F9197-4114-40FD-9B9E-114737C841A6","type":"phong","color":"AE0C6A3A-1815-47DD-84E9-1B45A75C1ACC","specular":"178DE441-100E-47A7-9EE2-DD890C2710A8","shininess":"1E4735A7-80B0-4385-8C0C-3D249D5228EE","shadingAlpha":"C9AB9F2E-7190-4514-BC52-F504843E8B52","shadingBlend":"9494FA1C-8AF3-408B-9371-BF3E1E49DF3A","afterColor":"F9A413F2-319B-446E-9C23-E8324719B0F8","alpha":"F487088A-CC87-4DB9-8DA7-DDB443913EAF","nodeType":"Phong"},{"uuid":"AE0C6A3A-1815-47DD-84E9-1B45A75C1ACC","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"F9A413F2-319B-446E-9C23-E8324719B0F8","type":"v3","a":"AFF76F31-0320-49CD-AD9E-9A8B8556A304","b":"318F2F70-98C9-4B15-8C56-6B63BC7DC8A8","alpha":"5BA85BE6-3D5D-4CD1-B68A-AD2C3B3F7E63","mode":"3A41076D-14C6-480E-A085-0840C6942EA9","nodeType":"Blend"},{"uuid":"AFF76F31-0320-49CD-AD9E-9A8B8556A304","type":"v3","a":"B338C09E-AF41-4823-8B93-3D188A2180FE","b":"E226A323-74FC-44A2-8077-0C01FB1AD3DD","alpha":"AA680744-9141-49F3-BCE8-0BE94191F1BB","mode":"91B54185-0E84-4B9B-A292-AE6F1337D97E","nodeType":"Blend"},{"uuid":"B338C09E-AF41-4823-8B93-3D188A2180FE","type":"v3","a":"D1A59EA3-0A2C-426B-8DD4-90AE5EF9106A","b":"A3CFE9A2-D9B2-49F8-BFB7-2AC57E206802","alpha":"E3944FB5-8D4F-4771-925A-6FCD6C9BF00A","mode":"EC2EF2B1-627A-4E8A-9D1A-9275940080B5","nodeType":"Blend"},{"uuid":"D1A59EA3-0A2C-426B-8DD4-90AE5EF9106A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A3CFE9A2-D9B2-49F8-BFB7-2AC57E206802","type":"v3","thickness":"33987638-4575-4132-B9CF-E9D7EE0D3112","ior":"3DCCD6DA-71F0-4FF1-BA5D-BFF661FB2CB6","roughness":"D6975FAB-081D-4A99-83D0-6253476EAAEE","alpha":"B70312B7-2348-4659-9419-FA4455A8E337","calpha":"gA3CFE9A2D9B249F8BFB72AC57E206802_calpha","nodeType":"Transmission"},{"uuid":"E3944FB5-8D4F-4771-925A-6FCD6C9BF00A","type":"f","src":"gA3CFE9A2D9B249F8BFB72AC57E206802_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E226A323-74FC-44A2-8077-0C01FB1AD3DD","type":"v3","near":"A3C1DC51-CB46-49D1-9225-E229BE428BA7","far":"EBCBA87B-F55E-41A6-AA20-16C8218CC17F","isVector":"43A71C16-D5FC-4903-B0DC-5C2D04E51DAC","isWorldSpace":"5D65932F-6FC6-40BB-A768-3C80E01114CB","origin":"CEE6BA2C-49FC-4CC2-829B-2B2FFBA87D90","colorA":"86EBEC7C-189C-41E0-B3C2-2D03DB1C833A","colorB":"0B86763C-DA59-4CEB-9966-79BAC5048B33","alpha":"2D3D4E1F-CE43-4ECB-815F-DA540D3B5119","nodeType":"Depth"},{"uuid":"AA680744-9141-49F3-BCE8-0BE94191F1BB","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"2D3D4E1F-CE43-4ECB-815F-DA540D3B5119"},"nodeType":"Expression"},{"uuid":"318F2F70-98C9-4B15-8C56-6B63BC7DC8A8","type":"v3","color":"55486601-22A2-4D5D-87C6-F05FF874157E","bias":"87DB10E2-0683-471F-9380-89947FB11934","scale":"19BC4CAC-9565-4052-B3E8-AC843BC007C8","intensity":"0BF5EACA-21AA-4312-BD34-DB87FA7FB368","factor":"FE455310-5E20-4757-B1A8-191F80BA9C08","alpha":"258A1B05-299B-4999-8AD0-2E99D1BC7E69","mode":"3A41076D-14C6-480E-A085-0840C6942EA9","calpha":"g318F2F7098C94B158C566B63BC7DC8A8_calpha","nodeType":"Fresnel"},{"uuid":"5BA85BE6-3D5D-4CD1-B68A-AD2C3B3F7E63","type":"f","src":"g318F2F7098C94B158C566B63BC7DC8A8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F487088A-CC87-4DB9-8DA7-DDB443913EAF","type":"f","value":1,"nodeType":"Float"},{"uuid":"BFEC79E8-DC4D-48DB-9758-8738D5092909","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"8BE08877-498B-45DB-82C9-184DEEC015E1","nodeType":"Color"},{"uuid":"8BE08877-498B-45DB-82C9-184DEEC015E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"1E1FA5BD-2B06-4525-9BEA-2996B91853EF","type":"i","value":0,"nodeType":"Int"},{"uuid":"76033C39-A0A3-4572-85FE-42494C7D589D","type":"f","value":1,"nodeType":"Float"},{"uuid":"7AF8ACE9-E091-4A84-B1A0-36156FD650A9","type":"i","value":0,"nodeType":"Int"},{"uuid":"BAD177FC-82A7-4BE8-B3AB-1FAD85B97787","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"BF489775-4D6C-4AD5-BCAE-E9FE9ECDC6E4","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"2334810B-18EF-4D63-B4FE-C112EEEBC186","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F07F7D6C-6C7A-48DC-AE0F-29270F5432F3","type":"f","value":1,"nodeType":"Float"},{"uuid":"0AB6B2D1-B725-40FE-9DD4-9221620B7E6E","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"2E989558-2105-4FA7-9481-AF35033D9D13","type":"f","value":1,"nodeType":"Float"},{"uuid":"5739CB8D-34DD-4004-B154-4BB1D8E6F3D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"69CB4FDC-ECF8-4973-A4B0-658475E6F758","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C88DC35-E054-47B2-84BF-1D2570DCCFAF","type":"lambert","color":"BFEC79E8-DC4D-48DB-9758-8738D5092909","emissiveIntensity":"A3349E9A-439E-4E4D-A38C-4CE5D0D659C0","shadingAlpha":"76033C39-A0A3-4572-85FE-42494C7D589D","shadingBlend":"7AF8ACE9-E091-4A84-B1A0-36156FD650A9","afterColor":"27B46ED1-A6D9-4894-A7D4-D81659E3332E","alpha":"484ADFD9-8A74-4E83-AB4D-EAEC97126C24","emissive":"BAD177FC-82A7-4BE8-B3AB-1FAD85B97787","nodeType":"Lambert"},{"uuid":"A3349E9A-439E-4E4D-A38C-4CE5D0D659C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"27B46ED1-A6D9-4894-A7D4-D81659E3332E","type":"v3","a":"242A8F19-9D80-4248-835A-D653193F8396","b":"E24BE92D-E0F9-4185-8243-67099E69B543","alpha":"D9BBEEA7-3406-4AFE-A515-F9CBF421B5CF","mode":"69CB4FDC-ECF8-4973-A4B0-658475E6F758","nodeType":"Blend"},{"uuid":"242A8F19-9D80-4248-835A-D653193F8396","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E24BE92D-E0F9-4185-8243-67099E69B543","type":"v3","color":"BF489775-4D6C-4AD5-BCAE-E9FE9ECDC6E4","bias":"2334810B-18EF-4D63-B4FE-C112EEEBC186","scale":"F07F7D6C-6C7A-48DC-AE0F-29270F5432F3","intensity":"0AB6B2D1-B725-40FE-9DD4-9221620B7E6E","factor":"2E989558-2105-4FA7-9481-AF35033D9D13","alpha":"5739CB8D-34DD-4004-B154-4BB1D8E6F3D9","mode":"69CB4FDC-ECF8-4973-A4B0-658475E6F758","calpha":"gE24BE92DE0F94185824367099E69B543_calpha","nodeType":"Fresnel"},{"uuid":"D9BBEEA7-3406-4AFE-A515-F9CBF421B5CF","type":"f","src":"gE24BE92DE0F94185824367099E69B543_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"484ADFD9-8A74-4E83-AB4D-EAEC97126C24","type":"f","value":1,"nodeType":"Float"},{"uuid":"87552004-FEB9-41D6-A11E-4FE3CB70F850","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"0BF68EB5-71F2-4BDC-8B63-CACF36F2D708","nodeType":"Color"},{"uuid":"0BF68EB5-71F2-4BDC-8B63-CACF36F2D708","type":"f","value":1,"nodeType":"Float"},{"uuid":"FA986B85-6B9B-4D8A-AFBD-A9F7D57D7896","type":"i","value":0,"nodeType":"Int"},{"uuid":"99D0EAA8-90FF-40A7-88A1-98CB528B1BB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"87B79E1E-9941-4A6B-A521-E2E6A0B1BA5D","type":"i","value":0,"nodeType":"Int"},{"uuid":"1F110155-95DC-4D16-92A4-320A09F69718","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"6F5E1625-3AD3-48A0-A489-6A37065B4B14","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"365987B8-3FB1-4433-96F5-B90019634ABF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"EC55B649-B443-462C-B44A-8C5F528BEFDA","type":"f","value":1,"nodeType":"Float"},{"uuid":"078FFC06-25DB-464E-909F-8480F9C14433","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"A2F3B962-161D-40DA-A1BD-162836C3C769","type":"f","value":1,"nodeType":"Float"},{"uuid":"74CA9F7B-D82B-4FFE-A97F-E971F1EC43F6","type":"f","value":1,"nodeType":"Float"},{"uuid":"22321D96-D723-448B-9336-25148B18C4D9","type":"i","value":0,"nodeType":"Int"},{"uuid":"6693B675-33D1-44CD-BAB5-3945530B5121","type":"lambert","color":"87552004-FEB9-41D6-A11E-4FE3CB70F850","emissiveIntensity":"80E0E581-AB3B-4290-8BFA-5414767663BF","shadingAlpha":"99D0EAA8-90FF-40A7-88A1-98CB528B1BB9","shadingBlend":"87B79E1E-9941-4A6B-A521-E2E6A0B1BA5D","afterColor":"EE732CA0-538C-4E1E-9455-0514CFF47362","alpha":"0D83714E-10C3-49D8-91CE-9DBF91AF59AE","emissive":"1F110155-95DC-4D16-92A4-320A09F69718","nodeType":"Lambert"},{"uuid":"80E0E581-AB3B-4290-8BFA-5414767663BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"EE732CA0-538C-4E1E-9455-0514CFF47362","type":"v3","a":"73AB56CF-F7E5-454B-89FE-57C0379EB297","b":"8476768F-23AB-43C4-A64B-0FD8F48A6566","alpha":"D747B355-8FF6-4F7B-9978-B322DA7C5F34","mode":"22321D96-D723-448B-9336-25148B18C4D9","nodeType":"Blend"},{"uuid":"73AB56CF-F7E5-454B-89FE-57C0379EB297","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8476768F-23AB-43C4-A64B-0FD8F48A6566","type":"v3","color":"6F5E1625-3AD3-48A0-A489-6A37065B4B14","bias":"365987B8-3FB1-4433-96F5-B90019634ABF","scale":"EC55B649-B443-462C-B44A-8C5F528BEFDA","intensity":"078FFC06-25DB-464E-909F-8480F9C14433","factor":"A2F3B962-161D-40DA-A1BD-162836C3C769","alpha":"74CA9F7B-D82B-4FFE-A97F-E971F1EC43F6","mode":"22321D96-D723-448B-9336-25148B18C4D9","calpha":"g8476768F23AB43C4A64B0FD8F48A6566_calpha","nodeType":"Fresnel"},{"uuid":"D747B355-8FF6-4F7B-9978-B322DA7C5F34","type":"f","src":"g8476768F23AB43C4A64B0FD8F48A6566_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0D83714E-10C3-49D8-91CE-9DBF91AF59AE","type":"f","value":1,"nodeType":"Float"},{"uuid":"F9C13482-249C-41AB-9E83-6EA6F4E5B6F7","type":"f","value":1,"nodeType":"Float"},{"uuid":"156AC25A-A7DF-497E-951E-980E43F954D2","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C40B31C-280A-45F1-B053-2375553E10AF","type":"f","value":30,"nodeType":"Float"},{"uuid":"4B981DFC-0EA9-4AD4-8BB8-06D060226072","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"AA5EDAF7-74B1-4F3F-AE19-001F12400A29","type":"f","value":10,"nodeType":"Float"},{"uuid":"DC8C9C58-AFD7-4DA9-8E07-9E767C3294E1","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"C3224CF5-D9B5-49F9-A0C4-543C40278065","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A4DEF40B-7B87-4ED0-BFBE-D4FB048592A9","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"3E32C24D-FC0A-4F9A-B6DB-B44C03018954","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"FACBD8E5-D676-4ADA-B471-C3C5AD740148","project":false,"nodeType":"Texture"},{"uuid":"FACBD8E5-D676-4ADA-B471-C3C5AD740148","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4528D6AE-7197-435E-A9F6-F6E5E70F4048","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"FD6D7453-ACB6-4C4D-9D86-A870049A913F","project":false,"nodeType":"Texture"},{"uuid":"FD6D7453-ACB6-4C4D-9D86-A870049A913F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BE3C1A10-5F5B-4580-8152-6AF1EAA19B84","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"0C2CAB73-0F3E-4BFF-B18E-A3F577786131","type":"f","value":1,"nodeType":"Float"},{"uuid":"DAA9B963-6EE4-4819-94E0-0310C2E20068","type":"i","value":0,"nodeType":"Int"},{"uuid":"19C2CCE5-5345-4A0B-B011-FB362B8F2CA8","type":"f","value":50,"nodeType":"Float"},{"uuid":"11D2F097-C8E2-4A5B-9211-6045EA32A86B","type":"f","value":138,"nodeType":"Float"},{"uuid":"FB5AD950-4010-431B-9B4D-62C55B755A73","type":"f","value":1,"nodeType":"Float"},{"uuid":"5919901A-F89E-4015-8D24-F7694CC701DA","type":"f","value":0,"nodeType":"Float"},{"uuid":"23F605A2-D46D-4C92-B24F-838924221A09","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"A42E30D2-5D22-4FF4-B70B-EDBDA5D0291B","type":"c","r":1,"g":0.8862745098039215,"b":0.8862745098039215,"value":16769762,"nodeType":"Color"},{"uuid":"B0865AFE-BA03-4C38-9B46-A08BE564F1C0","type":"c","r":1,"g":0.6705882352941176,"b":0.6705882352941176,"value":16755627,"nodeType":"Color"},{"uuid":"848AD509-0FB2-4CC1-A4CF-9B7A7AD83186","type":"f","value":1,"nodeType":"Float"},{"uuid":"CFA37B1B-D936-4BF0-B2E1-6C5277718919","type":"i","value":1,"nodeType":"Int"},{"uuid":"57696F64-EDA0-4B92-9037-17CDB1DEDA73","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"4350E09C-1C16-46E1-84C9-77BF64AA226C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E360B3A2-6588-42FD-8595-FA9D5872CE4C","type":"f","value":1,"nodeType":"Float"},{"uuid":"7A59A56C-925A-4069-8B7F-1DC0A36206FB","type":"f","value":2,"nodeType":"Float"},{"uuid":"60065F0B-60D3-4140-B4AC-FE71B69C606A","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"F48CAC61-CFE1-45EC-A6A1-093E1CCD965C","type":"f","value":1,"nodeType":"Float"},{"uuid":"3162557A-3F5F-4A86-90D5-0874C3510A13","type":"i","value":2,"nodeType":"Int"},{"uuid":"98253943-A1FD-42C4-8738-04A463582C51","type":"phong","color":"5109EB26-F1B9-495E-82E1-B1B94DE39341","specular":"4B981DFC-0EA9-4AD4-8BB8-06D060226072","shininess":"2C40B31C-280A-45F1-B053-2375553E10AF","shadingAlpha":"F9C13482-249C-41AB-9E83-6EA6F4E5B6F7","shadingBlend":"156AC25A-A7DF-497E-951E-980E43F954D2","afterColor":"46F41889-F383-454E-B16D-3A3F728339C8","alpha":"7744A77E-9556-40AE-93CB-1879B2611C0E","nodeType":"Phong"},{"uuid":"5109EB26-F1B9-495E-82E1-B1B94DE39341","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"46F41889-F383-454E-B16D-3A3F728339C8","type":"v3","a":"1668657A-98E7-4A74-B814-CF9409F37B3E","b":"461C4444-8A20-4612-B85C-204AA0629208","alpha":"F49A3138-94E6-457A-A921-B2D7BCA1F273","mode":"3162557A-3F5F-4A86-90D5-0874C3510A13","nodeType":"Blend"},{"uuid":"1668657A-98E7-4A74-B814-CF9409F37B3E","type":"v3","a":"3945BE10-E7DF-4032-A1FF-E2B386C4D7C2","b":"B5EA19D3-C639-4EDA-8616-6C0AD0C90A38","alpha":"92916582-1D80-4F94-A710-D462397A85EA","mode":"CFA37B1B-D936-4BF0-B2E1-6C5277718919","nodeType":"Blend"},{"uuid":"3945BE10-E7DF-4032-A1FF-E2B386C4D7C2","type":"v3","a":"56B467AF-341A-4F65-AFBF-705DD27912D1","b":"BA56A699-D25D-4A41-9ED4-A5F7A593D864","alpha":"49799337-754B-44E8-B752-F7C3CDCA0E4D","mode":"DAA9B963-6EE4-4819-94E0-0310C2E20068","nodeType":"Blend"},{"uuid":"56B467AF-341A-4F65-AFBF-705DD27912D1","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BA56A699-D25D-4A41-9ED4-A5F7A593D864","type":"v3","thickness":"AA5EDAF7-74B1-4F3F-AE19-001F12400A29","ior":"DC8C9C58-AFD7-4DA9-8E07-9E767C3294E1","roughness":"C3224CF5-D9B5-49F9-A0C4-543C40278065","alpha":"0C2CAB73-0F3E-4BFF-B18E-A3F577786131","calpha":"gBA56A699D25D4A419ED4A5F7A593D864_calpha","nodeType":"Transmission"},{"uuid":"49799337-754B-44E8-B752-F7C3CDCA0E4D","type":"f","src":"gBA56A699D25D4A419ED4A5F7A593D864_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B5EA19D3-C639-4EDA-8616-6C0AD0C90A38","type":"v3","near":"19C2CCE5-5345-4A0B-B011-FB362B8F2CA8","far":"11D2F097-C8E2-4A5B-9211-6045EA32A86B","isVector":"FB5AD950-4010-431B-9B4D-62C55B755A73","isWorldSpace":"5919901A-F89E-4015-8D24-F7694CC701DA","origin":"23F605A2-D46D-4C92-B24F-838924221A09","colorA":"A42E30D2-5D22-4FF4-B70B-EDBDA5D0291B","colorB":"B0865AFE-BA03-4C38-9B46-A08BE564F1C0","alpha":"848AD509-0FB2-4CC1-A4CF-9B7A7AD83186","nodeType":"Depth"},{"uuid":"92916582-1D80-4F94-A710-D462397A85EA","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"848AD509-0FB2-4CC1-A4CF-9B7A7AD83186"},"nodeType":"Expression"},{"uuid":"461C4444-8A20-4612-B85C-204AA0629208","type":"v3","color":"57696F64-EDA0-4B92-9037-17CDB1DEDA73","bias":"4350E09C-1C16-46E1-84C9-77BF64AA226C","scale":"E360B3A2-6588-42FD-8595-FA9D5872CE4C","intensity":"7A59A56C-925A-4069-8B7F-1DC0A36206FB","factor":"60065F0B-60D3-4140-B4AC-FE71B69C606A","alpha":"F48CAC61-CFE1-45EC-A6A1-093E1CCD965C","mode":"3162557A-3F5F-4A86-90D5-0874C3510A13","calpha":"g461C44448A204612B85C204AA0629208_calpha","nodeType":"Fresnel"},{"uuid":"F49A3138-94E6-457A-A921-B2D7BCA1F273","type":"f","src":"g461C44448A204612B85C204AA0629208_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7744A77E-9556-40AE-93CB-1879B2611C0E","type":"f","value":1,"nodeType":"Float"},{"uuid":"2ABDE3E1-2621-4A12-8E32-82F4729826DF","type":"f","value":1,"nodeType":"Float"},{"uuid":"41256B8B-D19C-433C-9A98-20BA684A7CB2","type":"i","value":0,"nodeType":"Int"},{"uuid":"2F3802A2-5907-4F79-814E-0D9AE0A91613","type":"f","value":30,"nodeType":"Float"},{"uuid":"F681BF72-B22C-4E38-8983-0BEF5A87B37A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"DEC225FA-C94E-46E5-BB7E-09229A99AE0A","type":"f","value":10,"nodeType":"Float"},{"uuid":"EF7BBAD0-89D7-481F-8B6E-07E85010B065","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"56E1F026-E49B-44B1-8EED-9C503BA4E2FF","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"65F8929D-0B67-41E4-9E05-0AF6BC0DC0CC","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"7329E780-5E03-42E3-AFCE-773B202A27C8","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"14E498F9-9C0D-44FF-8E7B-AAA12CFB06C8","project":false,"nodeType":"Texture"},{"uuid":"14E498F9-9C0D-44FF-8E7B-AAA12CFB06C8","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0CF940EF-85CF-4DE4-A194-EB3B53B16176","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"496DBAE8-ABA6-43C8-9E8A-290F041F9045","project":false,"nodeType":"Texture"},{"uuid":"496DBAE8-ABA6-43C8-9E8A-290F041F9045","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BA777197-3F02-4CCD-9E3E-2635E05CBC88","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"29F93129-F252-4DD8-AE41-3E261B440DF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"C63016F1-2347-44E0-A76F-DCA29CD49A0C","type":"i","value":0,"nodeType":"Int"},{"uuid":"66361FE1-0B1B-4289-B449-A1F2ABA0C42E","type":"f","value":50,"nodeType":"Float"},{"uuid":"0F658C5B-7FDB-4FB5-8F15-FF706268B7F4","type":"f","value":138,"nodeType":"Float"},{"uuid":"BF0261E4-18E8-471C-95F7-3832788A3E12","type":"f","value":1,"nodeType":"Float"},{"uuid":"FAE5DFDD-1DAF-4341-BB32-4E818EE89787","type":"f","value":0,"nodeType":"Float"},{"uuid":"8179E2C7-598A-466D-B808-15F6CCA6A6FD","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"53DCB421-4DB7-407B-9697-48D159C3AB06","type":"c","r":0.996078431372549,"g":0.6078431372549019,"b":0.6078431372549019,"value":16685979,"nodeType":"Color"},{"uuid":"0E8F8750-5285-4EFF-8A24-9E8A2FEA356D","type":"c","r":0.9764705882352941,"g":0.42745098039215684,"b":0.42745098039215684,"value":16346477,"nodeType":"Color"},{"uuid":"A0A52037-3CFA-4544-8DC8-5C557FB131AE","type":"f","value":1,"nodeType":"Float"},{"uuid":"AEBCF7AC-CB2E-4A64-90F0-40A0DF1A86B4","type":"i","value":1,"nodeType":"Int"},{"uuid":"B2E601A3-8714-4269-8241-266B7663BBB9","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"83531713-0249-442B-9D83-27B6262D670E","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E6BD314B-BFFD-48A5-B43C-4A98EE5F471C","type":"f","value":1,"nodeType":"Float"},{"uuid":"0F3B9503-6AB7-4FAA-80CA-1AA9FADBF4FE","type":"f","value":2,"nodeType":"Float"},{"uuid":"6518E964-6ECA-42AD-882E-0A8D99CFFBED","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"CA1F4085-1C99-48E6-B447-24F94FF6C538","type":"f","value":1,"nodeType":"Float"},{"uuid":"89190305-DCB4-4153-937F-EBFCCD4D5A48","type":"i","value":2,"nodeType":"Int"},{"uuid":"C9DE9848-15D7-4B28-B061-F3F8E34EBF65","type":"phong","color":"6C5D14DC-98BB-4869-BF93-8D2ABD0C6F1D","specular":"F681BF72-B22C-4E38-8983-0BEF5A87B37A","shininess":"2F3802A2-5907-4F79-814E-0D9AE0A91613","shadingAlpha":"2ABDE3E1-2621-4A12-8E32-82F4729826DF","shadingBlend":"41256B8B-D19C-433C-9A98-20BA684A7CB2","afterColor":"9818E3AB-CFEE-4A21-8DBC-F08C44DCA98F","alpha":"992E4C8E-417D-436E-9CB3-802E9BA9098D","nodeType":"Phong"},{"uuid":"6C5D14DC-98BB-4869-BF93-8D2ABD0C6F1D","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"9818E3AB-CFEE-4A21-8DBC-F08C44DCA98F","type":"v3","a":"2CF50191-39C7-4DA5-BCB8-110A844C85ED","b":"F5BD634E-4A0D-40A3-AF69-D45AA9FEFFAC","alpha":"E7240082-B9E0-4872-B3D1-D8298C3A6E1D","mode":"89190305-DCB4-4153-937F-EBFCCD4D5A48","nodeType":"Blend"},{"uuid":"2CF50191-39C7-4DA5-BCB8-110A844C85ED","type":"v3","a":"4416DB45-3E2C-46CA-8270-34AE9B9169A9","b":"1E67C6AC-044E-460C-9B95-0D6E5D2BF7CD","alpha":"ABDC1441-EA59-4300-81F9-1181474A1BA2","mode":"AEBCF7AC-CB2E-4A64-90F0-40A0DF1A86B4","nodeType":"Blend"},{"uuid":"4416DB45-3E2C-46CA-8270-34AE9B9169A9","type":"v3","a":"33568254-F99A-4EE2-8142-A6F70BE91190","b":"69993363-0E84-4194-8C4F-3D5153C3616F","alpha":"026328BF-D149-4738-AB3D-DD1154896383","mode":"C63016F1-2347-44E0-A76F-DCA29CD49A0C","nodeType":"Blend"},{"uuid":"33568254-F99A-4EE2-8142-A6F70BE91190","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"69993363-0E84-4194-8C4F-3D5153C3616F","type":"v3","thickness":"DEC225FA-C94E-46E5-BB7E-09229A99AE0A","ior":"EF7BBAD0-89D7-481F-8B6E-07E85010B065","roughness":"56E1F026-E49B-44B1-8EED-9C503BA4E2FF","alpha":"29F93129-F252-4DD8-AE41-3E261B440DF0","calpha":"g699933630E8441948C4F3D5153C3616F_calpha","nodeType":"Transmission"},{"uuid":"026328BF-D149-4738-AB3D-DD1154896383","type":"f","src":"g699933630E8441948C4F3D5153C3616F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1E67C6AC-044E-460C-9B95-0D6E5D2BF7CD","type":"v3","near":"66361FE1-0B1B-4289-B449-A1F2ABA0C42E","far":"0F658C5B-7FDB-4FB5-8F15-FF706268B7F4","isVector":"BF0261E4-18E8-471C-95F7-3832788A3E12","isWorldSpace":"FAE5DFDD-1DAF-4341-BB32-4E818EE89787","origin":"8179E2C7-598A-466D-B808-15F6CCA6A6FD","colorA":"53DCB421-4DB7-407B-9697-48D159C3AB06","colorB":"0E8F8750-5285-4EFF-8A24-9E8A2FEA356D","alpha":"A0A52037-3CFA-4544-8DC8-5C557FB131AE","nodeType":"Depth"},{"uuid":"ABDC1441-EA59-4300-81F9-1181474A1BA2","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A0A52037-3CFA-4544-8DC8-5C557FB131AE"},"nodeType":"Expression"},{"uuid":"F5BD634E-4A0D-40A3-AF69-D45AA9FEFFAC","type":"v3","color":"B2E601A3-8714-4269-8241-266B7663BBB9","bias":"83531713-0249-442B-9D83-27B6262D670E","scale":"E6BD314B-BFFD-48A5-B43C-4A98EE5F471C","intensity":"0F3B9503-6AB7-4FAA-80CA-1AA9FADBF4FE","factor":"6518E964-6ECA-42AD-882E-0A8D99CFFBED","alpha":"CA1F4085-1C99-48E6-B447-24F94FF6C538","mode":"89190305-DCB4-4153-937F-EBFCCD4D5A48","calpha":"gF5BD634E4A0D40A3AF69D45AA9FEFFAC_calpha","nodeType":"Fresnel"},{"uuid":"E7240082-B9E0-4872-B3D1-D8298C3A6E1D","type":"f","src":"gF5BD634E4A0D40A3AF69D45AA9FEFFAC_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"992E4C8E-417D-436E-9CB3-802E9BA9098D","type":"f","value":1,"nodeType":"Float"},{"uuid":"8D908A24-B7BC-4FAC-874B-566B638F5675","type":"f","value":1,"nodeType":"Float"},{"uuid":"C54D03FD-331F-4F11-99BD-304025BC4D43","type":"i","value":0,"nodeType":"Int"},{"uuid":"116DE751-7C9D-46EF-9D59-6F50809293FF","type":"f","value":30,"nodeType":"Float"},{"uuid":"E576D8DC-8E65-45E4-96CE-3E1386D035B4","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"99A861EA-2484-424C-A472-B0D4FF0D1367","type":"f","value":10,"nodeType":"Float"},{"uuid":"EAC99946-E8C5-4BD5-97A2-7FDF2CE1E89C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"508CDA6B-BBD5-4A2A-AE5C-CA366B34B229","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A7FB4ECB-B3AD-453B-B851-90AA531F1247","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E9365C99-A362-408C-9B46-227BC9188D93","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"E78FAC1C-5C4E-4EA1-BBA8-0BE31C3BD8CC","project":false,"nodeType":"Texture"},{"uuid":"E78FAC1C-5C4E-4EA1-BBA8-0BE31C3BD8CC","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A8964A7B-6BD2-4482-B6CD-31227D1CAA9E","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"030280BE-FF40-435F-A78A-45F545327388","project":false,"nodeType":"Texture"},{"uuid":"030280BE-FF40-435F-A78A-45F545327388","type":"v2","index":0,"nodeType":"UV"},{"uuid":"3BC0D060-C738-478B-9597-8240F2247FB2","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"73A7464B-7E6B-4D46-B766-1136AB7542A5","type":"f","value":1,"nodeType":"Float"},{"uuid":"5C44DA17-6034-4EC9-9CE3-C610D6DA83B2","type":"i","value":0,"nodeType":"Int"},{"uuid":"83FC757B-357D-4B97-A8EE-8A985DF02321","type":"f","value":50,"nodeType":"Float"},{"uuid":"505BCA11-029A-4D31-994F-5FAD19112810","type":"f","value":138,"nodeType":"Float"},{"uuid":"A8794069-84EF-4BBB-B6DF-F6096DAC4585","type":"f","value":1,"nodeType":"Float"},{"uuid":"AC8DEF5A-8C82-4699-B565-6398450F5C38","type":"f","value":0,"nodeType":"Float"},{"uuid":"A2919771-0D3E-4B4E-ADFE-E549CC2DAAE1","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"24ED793A-9017-4313-A115-CA996762B5BE","type":"c","r":0.9529411764705882,"g":0.4470588235294118,"b":0.4470588235294118,"value":15954546,"nodeType":"Color"},{"uuid":"02B04F26-CD5E-49FF-8EF3-B41EB68E06BA","type":"c","r":0.8980392156862745,"g":0.27058823529411763,"b":0.27058823529411763,"value":15025477,"nodeType":"Color"},{"uuid":"A98F7470-F248-44B3-8E88-04C419E385FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"60A49D0E-86DC-4FB7-9636-D5D22AB7A3F0","type":"i","value":1,"nodeType":"Int"},{"uuid":"F02F1BF5-70C5-43E9-AB26-CA69EC8F6D76","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"474BE9BB-F558-4AB6-AC49-9CDB65790FDE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"63923A34-1FF6-4AFA-AECC-5E99D135788A","type":"f","value":1,"nodeType":"Float"},{"uuid":"34B42E09-38BF-441F-A76F-4BE2FBC49080","type":"f","value":2,"nodeType":"Float"},{"uuid":"2610BD71-6D7B-4347-92DF-6E6576BBE1F4","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"4FEF7036-A484-4F90-B398-93BC99CA4D61","type":"f","value":1,"nodeType":"Float"},{"uuid":"E8338D29-FDB2-4E36-8E48-E658EF6FE896","type":"i","value":2,"nodeType":"Int"},{"uuid":"2643CA1A-186A-44FE-9C6B-C62AB25F820D","type":"phong","color":"A77C597F-9D86-4E5E-A5EB-4A9350B5DF65","specular":"E576D8DC-8E65-45E4-96CE-3E1386D035B4","shininess":"116DE751-7C9D-46EF-9D59-6F50809293FF","shadingAlpha":"8D908A24-B7BC-4FAC-874B-566B638F5675","shadingBlend":"C54D03FD-331F-4F11-99BD-304025BC4D43","afterColor":"7E943EE4-ACA0-4D2C-9433-D022164C2B05","alpha":"580D9128-364E-4E55-B17D-B3A4C1B12E11","nodeType":"Phong"},{"uuid":"A77C597F-9D86-4E5E-A5EB-4A9350B5DF65","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"7E943EE4-ACA0-4D2C-9433-D022164C2B05","type":"v3","a":"D59DB1AA-E9CB-4B69-8D8F-094565ABD99E","b":"FFFD57CE-DE79-4CB7-875B-1EBDF9561577","alpha":"54493260-C444-4175-A713-64A1CE5EB7B3","mode":"E8338D29-FDB2-4E36-8E48-E658EF6FE896","nodeType":"Blend"},{"uuid":"D59DB1AA-E9CB-4B69-8D8F-094565ABD99E","type":"v3","a":"66029CBA-1B23-42EB-8C1A-357754959536","b":"D43B0770-D4E3-41AD-8372-BEFFC6E7A9B1","alpha":"AE25FBF5-60EB-4EB5-9A87-8EAD5E4A1237","mode":"60A49D0E-86DC-4FB7-9636-D5D22AB7A3F0","nodeType":"Blend"},{"uuid":"66029CBA-1B23-42EB-8C1A-357754959536","type":"v3","a":"1FF3B819-1415-4AC3-9827-A9569392E7DF","b":"BBAFA64E-6B73-495E-92BD-62D9A63BB854","alpha":"7BEB6E30-56CC-484F-90B1-BBD7EB0C33EE","mode":"5C44DA17-6034-4EC9-9CE3-C610D6DA83B2","nodeType":"Blend"},{"uuid":"1FF3B819-1415-4AC3-9827-A9569392E7DF","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BBAFA64E-6B73-495E-92BD-62D9A63BB854","type":"v3","thickness":"99A861EA-2484-424C-A472-B0D4FF0D1367","ior":"EAC99946-E8C5-4BD5-97A2-7FDF2CE1E89C","roughness":"508CDA6B-BBD5-4A2A-AE5C-CA366B34B229","alpha":"73A7464B-7E6B-4D46-B766-1136AB7542A5","calpha":"gBBAFA64E6B73495E92BD62D9A63BB854_calpha","nodeType":"Transmission"},{"uuid":"7BEB6E30-56CC-484F-90B1-BBD7EB0C33EE","type":"f","src":"gBBAFA64E6B73495E92BD62D9A63BB854_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D43B0770-D4E3-41AD-8372-BEFFC6E7A9B1","type":"v3","near":"83FC757B-357D-4B97-A8EE-8A985DF02321","far":"505BCA11-029A-4D31-994F-5FAD19112810","isVector":"A8794069-84EF-4BBB-B6DF-F6096DAC4585","isWorldSpace":"AC8DEF5A-8C82-4699-B565-6398450F5C38","origin":"A2919771-0D3E-4B4E-ADFE-E549CC2DAAE1","colorA":"24ED793A-9017-4313-A115-CA996762B5BE","colorB":"02B04F26-CD5E-49FF-8EF3-B41EB68E06BA","alpha":"A98F7470-F248-44B3-8E88-04C419E385FA","nodeType":"Depth"},{"uuid":"AE25FBF5-60EB-4EB5-9A87-8EAD5E4A1237","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A98F7470-F248-44B3-8E88-04C419E385FA"},"nodeType":"Expression"},{"uuid":"FFFD57CE-DE79-4CB7-875B-1EBDF9561577","type":"v3","color":"F02F1BF5-70C5-43E9-AB26-CA69EC8F6D76","bias":"474BE9BB-F558-4AB6-AC49-9CDB65790FDE","scale":"63923A34-1FF6-4AFA-AECC-5E99D135788A","intensity":"34B42E09-38BF-441F-A76F-4BE2FBC49080","factor":"2610BD71-6D7B-4347-92DF-6E6576BBE1F4","alpha":"4FEF7036-A484-4F90-B398-93BC99CA4D61","mode":"E8338D29-FDB2-4E36-8E48-E658EF6FE896","calpha":"gFFFD57CEDE794CB7875B1EBDF9561577_calpha","nodeType":"Fresnel"},{"uuid":"54493260-C444-4175-A713-64A1CE5EB7B3","type":"f","src":"gFFFD57CEDE794CB7875B1EBDF9561577_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"580D9128-364E-4E55-B17D-B3A4C1B12E11","type":"f","value":1,"nodeType":"Float"},{"uuid":"FDF33604-9B4B-4746-9F38-4272FC78774A","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"91E68C70-DE77-4ED5-BB69-5538CA0ECF88","nodeType":"Color"},{"uuid":"91E68C70-DE77-4ED5-BB69-5538CA0ECF88","type":"f","value":1,"nodeType":"Float"},{"uuid":"F3F6B9DB-668B-4A3E-898C-C3814B19C11A","type":"i","value":0,"nodeType":"Int"},{"uuid":"BE6810BA-3C73-48A7-B00C-B625FA274A7F","type":"f","value":1,"nodeType":"Float"},{"uuid":"7A787867-F99B-40E5-8C22-FF84FDEBEF9E","type":"i","value":0,"nodeType":"Int"},{"uuid":"F9F89CCD-F406-471B-A4C5-8024FAA24042","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"6F75EADE-3232-4A85-8FCE-111CBF47B146","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"4043DDFA-EADF-4449-A3EF-E1612EF90EBF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FAA56B23-D01C-46F4-AC3B-6541C63A35D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"FB1E40E9-E4C5-4CCD-97A6-512FB51C49B8","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"F0F3AF6F-3ADD-444A-B597-EB15F3348260","type":"f","value":1,"nodeType":"Float"},{"uuid":"3823B7E9-E929-4A7C-A6C5-A826AA17068F","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE990376-9E2A-45B6-A764-AAD410FF8CEA","type":"i","value":0,"nodeType":"Int"},{"uuid":"787D74A9-1816-4739-BCF7-632E89CF64D2","type":"lambert","color":"FDF33604-9B4B-4746-9F38-4272FC78774A","emissiveIntensity":"09201BDB-9749-4A38-9FC3-B333E2EA8C7A","shadingAlpha":"BE6810BA-3C73-48A7-B00C-B625FA274A7F","shadingBlend":"7A787867-F99B-40E5-8C22-FF84FDEBEF9E","afterColor":"A6EA693A-EA91-4825-9A26-547282E77896","alpha":"F9BE5F71-DE6F-4C44-ADE1-A583C1554227","emissive":"F9F89CCD-F406-471B-A4C5-8024FAA24042","nodeType":"Lambert"},{"uuid":"09201BDB-9749-4A38-9FC3-B333E2EA8C7A","type":"f","value":1,"nodeType":"Float"},{"uuid":"A6EA693A-EA91-4825-9A26-547282E77896","type":"v3","a":"D19DACE7-40F7-4066-84BE-05831D102BEA","b":"2E28B629-4375-4A62-A4A9-B6D959BFA317","alpha":"1E354C41-7915-49EB-AD6E-F9FD32C01C0F","mode":"BE990376-9E2A-45B6-A764-AAD410FF8CEA","nodeType":"Blend"},{"uuid":"D19DACE7-40F7-4066-84BE-05831D102BEA","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2E28B629-4375-4A62-A4A9-B6D959BFA317","type":"v3","color":"6F75EADE-3232-4A85-8FCE-111CBF47B146","bias":"4043DDFA-EADF-4449-A3EF-E1612EF90EBF","scale":"FAA56B23-D01C-46F4-AC3B-6541C63A35D6","intensity":"FB1E40E9-E4C5-4CCD-97A6-512FB51C49B8","factor":"F0F3AF6F-3ADD-444A-B597-EB15F3348260","alpha":"3823B7E9-E929-4A7C-A6C5-A826AA17068F","mode":"BE990376-9E2A-45B6-A764-AAD410FF8CEA","calpha":"g2E28B62943754A62A4A9B6D959BFA317_calpha","nodeType":"Fresnel"},{"uuid":"1E354C41-7915-49EB-AD6E-F9FD32C01C0F","type":"f","src":"g2E28B62943754A62A4A9B6D959BFA317_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F9BE5F71-DE6F-4C44-ADE1-A583C1554227","type":"f","value":1,"nodeType":"Float"},{"uuid":"5D723D5E-58C8-41AD-B328-AA8ACAACDE42","type":"f","value":1,"nodeType":"Float"},{"uuid":"9CC55006-BEED-489B-91D6-A5B54AE1ED8B","type":"i","value":0,"nodeType":"Int"},{"uuid":"175E1423-5958-45FB-AF7E-6AE0A47131C9","type":"f","value":30,"nodeType":"Float"},{"uuid":"966999E2-D4FF-4BC1-A450-9A115091FA78","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"62401A58-1B3F-4BAE-88A3-B67299B68190","type":"f","value":10,"nodeType":"Float"},{"uuid":"4E5A51C5-88D4-4711-83D4-FAD651160BEE","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"513C6510-9629-4A35-A7C7-B4D6BB598E3D","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"32D486F2-9F44-4080-8B59-07B4826756F5","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"0964EE45-C8FC-48D4-9C55-EC5FA86E6CDF","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"ACE1C256-D4BE-4CE3-8110-BEB4662B01E4","project":false,"nodeType":"Texture"},{"uuid":"ACE1C256-D4BE-4CE3-8110-BEB4662B01E4","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4BCD9EF6-A590-4F41-B689-6D0C3F36F66D","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"537785CB-FBCA-49D8-B277-84AA64A583C0","project":false,"nodeType":"Texture"},{"uuid":"537785CB-FBCA-49D8-B277-84AA64A583C0","type":"v2","index":0,"nodeType":"UV"},{"uuid":"51F81343-A9A6-45D6-8700-B4B1E7AAB214","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"CD8C13C2-C5E5-4534-9ECA-C058AB73CFF4","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE6B56D8-22AD-4F7A-8056-EA821A16DAF5","type":"i","value":0,"nodeType":"Int"},{"uuid":"50EA0E6E-13E9-4628-BEB5-C2D948C825D5","type":"f","value":50,"nodeType":"Float"},{"uuid":"D1B7C8E5-6AE4-4305-95BF-F64AE259ADBE","type":"f","value":138,"nodeType":"Float"},{"uuid":"1EE3367B-0015-4045-851C-301DB588ED02","type":"f","value":1,"nodeType":"Float"},{"uuid":"C47568FD-516C-47D6-89F2-166F6E08CF8E","type":"f","value":0,"nodeType":"Float"},{"uuid":"91556329-AA79-4C72-9800-FD3791AE670D","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"0733A8BE-68A3-4B07-956F-7572C054FB15","type":"c","r":0.5019607843137255,"g":0.9568627450980393,"b":0.7098039215686275,"value":8451253,"nodeType":"Color"},{"uuid":"8006D527-DC10-445C-B4DA-DA019DAA0313","type":"c","r":0.29411764705882354,"g":0.8901960784313725,"b":0.5607843137254902,"value":4973455,"nodeType":"Color"},{"uuid":"2AB37687-DBAA-4FFA-9A3E-387077442CB6","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F4C04EE-BF6C-4038-8178-C4B65D70E0A1","type":"i","value":1,"nodeType":"Int"},{"uuid":"F9C4E0A5-13C7-4505-8228-F4A16AD8CF91","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"9A598DFD-F573-4D97-AC08-C23CB31ED3F1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C35F1E2F-D63D-4635-BC42-F244E5C3B383","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F859F58-BF6E-4284-BC4F-1802F779167D","type":"f","value":2,"nodeType":"Float"},{"uuid":"92A384B6-36BA-44D0-ADE8-0850425416A1","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"B6A888AA-0282-470A-99F9-A04C60C1D4F6","type":"f","value":1,"nodeType":"Float"},{"uuid":"8E08E7FD-C38B-44E9-B5B6-086E0A3F3602","type":"i","value":2,"nodeType":"Int"},{"uuid":"9EB6A1E1-1971-46F9-A3B0-E52A01DF1653","type":"phong","color":"75EBD661-9A08-4340-9E83-74EE3C0B2030","specular":"966999E2-D4FF-4BC1-A450-9A115091FA78","shininess":"175E1423-5958-45FB-AF7E-6AE0A47131C9","shadingAlpha":"5D723D5E-58C8-41AD-B328-AA8ACAACDE42","shadingBlend":"9CC55006-BEED-489B-91D6-A5B54AE1ED8B","afterColor":"19102E93-E855-4C9E-AE33-45DA23F46D55","alpha":"944EB3D3-9C35-4B58-8E32-68ECEDEC26C3","nodeType":"Phong"},{"uuid":"75EBD661-9A08-4340-9E83-74EE3C0B2030","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"19102E93-E855-4C9E-AE33-45DA23F46D55","type":"v3","a":"E21DD732-BAD1-431C-90DA-6666061DBDF9","b":"4DBE244B-E885-4EBD-A45A-FBA456A910B2","alpha":"B4E74DCC-1417-4BF4-BF02-93188696F9AF","mode":"8E08E7FD-C38B-44E9-B5B6-086E0A3F3602","nodeType":"Blend"},{"uuid":"E21DD732-BAD1-431C-90DA-6666061DBDF9","type":"v3","a":"88EA7779-E585-435D-A8A6-76303C1D99F3","b":"3EFF9410-6D18-4907-8F54-A81FC61C077B","alpha":"0F54E710-FFD7-4A4E-9F3D-EFAEF85D6C21","mode":"4F4C04EE-BF6C-4038-8178-C4B65D70E0A1","nodeType":"Blend"},{"uuid":"88EA7779-E585-435D-A8A6-76303C1D99F3","type":"v3","a":"1332FEB6-3B9A-44E2-BCB3-62EABD2572D7","b":"8013746C-4DFB-4B3E-8728-9211C07DF1CF","alpha":"1E54D1D1-13A5-4E94-A358-411466B9DA33","mode":"FE6B56D8-22AD-4F7A-8056-EA821A16DAF5","nodeType":"Blend"},{"uuid":"1332FEB6-3B9A-44E2-BCB3-62EABD2572D7","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8013746C-4DFB-4B3E-8728-9211C07DF1CF","type":"v3","thickness":"62401A58-1B3F-4BAE-88A3-B67299B68190","ior":"4E5A51C5-88D4-4711-83D4-FAD651160BEE","roughness":"513C6510-9629-4A35-A7C7-B4D6BB598E3D","alpha":"CD8C13C2-C5E5-4534-9ECA-C058AB73CFF4","calpha":"g8013746C4DFB4B3E87289211C07DF1CF_calpha","nodeType":"Transmission"},{"uuid":"1E54D1D1-13A5-4E94-A358-411466B9DA33","type":"f","src":"g8013746C4DFB4B3E87289211C07DF1CF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3EFF9410-6D18-4907-8F54-A81FC61C077B","type":"v3","near":"50EA0E6E-13E9-4628-BEB5-C2D948C825D5","far":"D1B7C8E5-6AE4-4305-95BF-F64AE259ADBE","isVector":"1EE3367B-0015-4045-851C-301DB588ED02","isWorldSpace":"C47568FD-516C-47D6-89F2-166F6E08CF8E","origin":"91556329-AA79-4C72-9800-FD3791AE670D","colorA":"0733A8BE-68A3-4B07-956F-7572C054FB15","colorB":"8006D527-DC10-445C-B4DA-DA019DAA0313","alpha":"2AB37687-DBAA-4FFA-9A3E-387077442CB6","nodeType":"Depth"},{"uuid":"0F54E710-FFD7-4A4E-9F3D-EFAEF85D6C21","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"2AB37687-DBAA-4FFA-9A3E-387077442CB6"},"nodeType":"Expression"},{"uuid":"4DBE244B-E885-4EBD-A45A-FBA456A910B2","type":"v3","color":"F9C4E0A5-13C7-4505-8228-F4A16AD8CF91","bias":"9A598DFD-F573-4D97-AC08-C23CB31ED3F1","scale":"C35F1E2F-D63D-4635-BC42-F244E5C3B383","intensity":"3F859F58-BF6E-4284-BC4F-1802F779167D","factor":"92A384B6-36BA-44D0-ADE8-0850425416A1","alpha":"B6A888AA-0282-470A-99F9-A04C60C1D4F6","mode":"8E08E7FD-C38B-44E9-B5B6-086E0A3F3602","calpha":"g4DBE244BE8854EBDA45AFBA456A910B2_calpha","nodeType":"Fresnel"},{"uuid":"B4E74DCC-1417-4BF4-BF02-93188696F9AF","type":"f","src":"g4DBE244BE8854EBDA45AFBA456A910B2_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"944EB3D3-9C35-4B58-8E32-68ECEDEC26C3","type":"f","value":1,"nodeType":"Float"},{"uuid":"484C1514-5D4F-429A-8009-E46E4532AED7","type":"f","value":1,"nodeType":"Float"},{"uuid":"FFE7A746-81E4-49D0-B48E-3DAC4CAFA2DA","type":"i","value":0,"nodeType":"Int"},{"uuid":"5358C6B5-36B2-4886-8CBB-94B5ED4D6EC4","type":"f","value":30,"nodeType":"Float"},{"uuid":"C1592B91-6BF5-46E3-8839-C496B080C92D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"68F3510F-6558-4210-91A4-3E76AE82DC31","type":"f","value":10,"nodeType":"Float"},{"uuid":"A7F81714-E5DD-44D6-B4D8-06B88E1F41A9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"FE61D2EE-EF32-4C30-88ED-B11AF1CCCA53","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"AA3FD39C-21F3-4E5E-B414-4BD85F1E7CB6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"DDA50281-069E-4134-8369-DD34B47D35DA","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"F2B3CA17-7ACB-4E70-B268-107EF96B84F3","project":false,"nodeType":"Texture"},{"uuid":"F2B3CA17-7ACB-4E70-B268-107EF96B84F3","type":"v2","index":0,"nodeType":"UV"},{"uuid":"30ABA315-6B50-40D0-B57E-92FEF8678CD2","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"6FD7F59B-D96B-47A5-9744-FF15EFAE7EC8","project":false,"nodeType":"Texture"},{"uuid":"6FD7F59B-D96B-47A5-9744-FF15EFAE7EC8","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4E3A6CFA-9D8F-45FD-BA67-B29AFED8AE18","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"61C4F0B2-05CF-4A29-870D-6338C712C372","type":"f","value":1,"nodeType":"Float"},{"uuid":"483A5ECA-ECD5-409A-90E3-8FD8C5B3C5A1","type":"i","value":0,"nodeType":"Int"},{"uuid":"42C59357-0FAA-420B-A6B8-4D2FDBE3D4CA","type":"f","value":50,"nodeType":"Float"},{"uuid":"6B1EA8D3-A828-444D-95B4-DAF5710F7C00","type":"f","value":138,"nodeType":"Float"},{"uuid":"A59F3827-FA5E-495A-A92F-32E8AD51EF64","type":"f","value":1,"nodeType":"Float"},{"uuid":"6587C43F-1339-48D1-87BF-590D91919E14","type":"f","value":0,"nodeType":"Float"},{"uuid":"0C53B79F-0D2E-4C8C-A414-C241C7C2C8A9","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"1F946CF8-4E85-49F6-85B3-41ED13D64C11","type":"c","r":0.27450980392156865,"g":0.8980392156862745,"b":0.5568627450980392,"value":4646286,"nodeType":"Color"},{"uuid":"90BD8B34-7C9F-419B-A391-C41E2CF6F993","type":"c","r":0.1450980392156863,"g":0.803921568627451,"b":0.4392156862745098,"value":2477424,"nodeType":"Color"},{"uuid":"A83C94D9-F56E-4730-A129-5D5812EB74E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"AF23D36E-BA13-4C52-81C4-BE1CBBE50690","type":"i","value":1,"nodeType":"Int"},{"uuid":"EAB961B2-910C-498A-8CA7-CC9E0868C410","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"BBD3EC53-F3DE-4639-A2B5-039B6B4DB117","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F3D8E9F6-ECCC-4097-8F18-FB0699C5365C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C684FB39-C6C3-4386-A1C5-AD2FEB9F305F","type":"f","value":2,"nodeType":"Float"},{"uuid":"7844ED4C-DD4B-43FC-9F22-CFBF07DACB40","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"BB79AC22-0050-4962-A9BD-46D524E7A925","type":"f","value":1,"nodeType":"Float"},{"uuid":"EF672207-E4AA-4C50-982F-F7FBC358C1C9","type":"i","value":2,"nodeType":"Int"},{"uuid":"BC91557F-E870-43F1-BE64-08F126AAA313","type":"phong","color":"F3A4D093-082C-4293-8DE1-C486BED960CA","specular":"C1592B91-6BF5-46E3-8839-C496B080C92D","shininess":"5358C6B5-36B2-4886-8CBB-94B5ED4D6EC4","shadingAlpha":"484C1514-5D4F-429A-8009-E46E4532AED7","shadingBlend":"FFE7A746-81E4-49D0-B48E-3DAC4CAFA2DA","afterColor":"20812EA1-97E5-4DB0-808E-745171AE48D8","alpha":"2A59FE47-88E7-4519-91E7-4AD75FED897E","nodeType":"Phong"},{"uuid":"F3A4D093-082C-4293-8DE1-C486BED960CA","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"20812EA1-97E5-4DB0-808E-745171AE48D8","type":"v3","a":"6BC32EF5-FD35-4639-8D9A-96EB10F6CDDA","b":"E729C5C1-B29B-40D1-94D8-8F3A3812B6F7","alpha":"BC5B2513-9F31-442B-B5C7-D382BFAD1176","mode":"EF672207-E4AA-4C50-982F-F7FBC358C1C9","nodeType":"Blend"},{"uuid":"6BC32EF5-FD35-4639-8D9A-96EB10F6CDDA","type":"v3","a":"FCFAC7A0-ED14-4D45-A809-3E710DDC7E32","b":"92C8F2A7-1A9B-4F22-8212-B6C49A5827AB","alpha":"62E5ED3D-3134-4CB4-9E8C-8AE6B4820508","mode":"AF23D36E-BA13-4C52-81C4-BE1CBBE50690","nodeType":"Blend"},{"uuid":"FCFAC7A0-ED14-4D45-A809-3E710DDC7E32","type":"v3","a":"F4D96FF5-D45F-4297-9EFC-9B4D93D8F093","b":"4C78386C-6ECB-4BA9-A8B2-2991B6303963","alpha":"C8E86596-2BE4-49E0-A50B-E148004C74A6","mode":"483A5ECA-ECD5-409A-90E3-8FD8C5B3C5A1","nodeType":"Blend"},{"uuid":"F4D96FF5-D45F-4297-9EFC-9B4D93D8F093","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4C78386C-6ECB-4BA9-A8B2-2991B6303963","type":"v3","thickness":"68F3510F-6558-4210-91A4-3E76AE82DC31","ior":"A7F81714-E5DD-44D6-B4D8-06B88E1F41A9","roughness":"FE61D2EE-EF32-4C30-88ED-B11AF1CCCA53","alpha":"61C4F0B2-05CF-4A29-870D-6338C712C372","calpha":"g4C78386C6ECB4BA9A8B22991B6303963_calpha","nodeType":"Transmission"},{"uuid":"C8E86596-2BE4-49E0-A50B-E148004C74A6","type":"f","src":"g4C78386C6ECB4BA9A8B22991B6303963_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"92C8F2A7-1A9B-4F22-8212-B6C49A5827AB","type":"v3","near":"42C59357-0FAA-420B-A6B8-4D2FDBE3D4CA","far":"6B1EA8D3-A828-444D-95B4-DAF5710F7C00","isVector":"A59F3827-FA5E-495A-A92F-32E8AD51EF64","isWorldSpace":"6587C43F-1339-48D1-87BF-590D91919E14","origin":"0C53B79F-0D2E-4C8C-A414-C241C7C2C8A9","colorA":"1F946CF8-4E85-49F6-85B3-41ED13D64C11","colorB":"90BD8B34-7C9F-419B-A391-C41E2CF6F993","alpha":"A83C94D9-F56E-4730-A129-5D5812EB74E1","nodeType":"Depth"},{"uuid":"62E5ED3D-3134-4CB4-9E8C-8AE6B4820508","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A83C94D9-F56E-4730-A129-5D5812EB74E1"},"nodeType":"Expression"},{"uuid":"E729C5C1-B29B-40D1-94D8-8F3A3812B6F7","type":"v3","color":"EAB961B2-910C-498A-8CA7-CC9E0868C410","bias":"BBD3EC53-F3DE-4639-A2B5-039B6B4DB117","scale":"F3D8E9F6-ECCC-4097-8F18-FB0699C5365C","intensity":"C684FB39-C6C3-4386-A1C5-AD2FEB9F305F","factor":"7844ED4C-DD4B-43FC-9F22-CFBF07DACB40","alpha":"BB79AC22-0050-4962-A9BD-46D524E7A925","mode":"EF672207-E4AA-4C50-982F-F7FBC358C1C9","calpha":"gE729C5C1B29B40D194D88F3A3812B6F7_calpha","nodeType":"Fresnel"},{"uuid":"BC5B2513-9F31-442B-B5C7-D382BFAD1176","type":"f","src":"gE729C5C1B29B40D194D88F3A3812B6F7_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2A59FE47-88E7-4519-91E7-4AD75FED897E","type":"f","value":1,"nodeType":"Float"},{"uuid":"2BA13361-FB94-45D2-854F-C111395F145F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F9FA2E32-F570-4617-9287-6CCC99C66597","type":"i","value":0,"nodeType":"Int"},{"uuid":"B3E00C21-5CFA-4A34-A6CE-3726D15F08FB","type":"f","value":30,"nodeType":"Float"},{"uuid":"5A0D4F70-E86B-4F7F-8E9F-1CC80ED76630","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"5484C4D2-0DB5-4465-8E63-CF303124534C","type":"f","value":10,"nodeType":"Float"},{"uuid":"9054AD34-3EA7-48E7-9A95-831E0C8D837F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"76D7E7DA-DCF1-4F4B-9343-7138C5BE4B10","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"BC25B4F6-0C5B-4F60-800E-BFF6620F4127","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"04B76353-C723-4690-BB5A-80DEC938202A","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"9FBC5DBB-8C88-4CD7-B828-D61010978B4F","project":false,"nodeType":"Texture"},{"uuid":"9FBC5DBB-8C88-4CD7-B828-D61010978B4F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"ED09B5A9-DAF3-460B-97A7-7A690F7759EA","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"6C2ABBB5-9FD6-4710-AF81-5572E6DC2211","project":false,"nodeType":"Texture"},{"uuid":"6C2ABBB5-9FD6-4710-AF81-5572E6DC2211","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BC1FD3BD-563C-4987-AE3C-066D0D36F0ED","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"C5B50162-BFC4-48EF-B6EA-1B968DB0553F","type":"f","value":1,"nodeType":"Float"},{"uuid":"1AF57012-D004-4E60-AF5C-BB05E4513297","type":"i","value":0,"nodeType":"Int"},{"uuid":"48104DF0-AE27-42F2-89E0-07267A6DCE69","type":"f","value":50,"nodeType":"Float"},{"uuid":"29C2105B-F2CC-474B-B84F-42CC33DEDC9D","type":"f","value":138,"nodeType":"Float"},{"uuid":"5A2CF87C-18B4-47ED-BF76-6FB1E550F22F","type":"f","value":1,"nodeType":"Float"},{"uuid":"4801E43A-99C5-4FD8-BD99-185C5E473E2B","type":"f","value":0,"nodeType":"Float"},{"uuid":"99F63B3A-105F-4C99-8F85-EF04F1DAD5E4","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"9D01C42E-3985-4156-8A77-6ABDAC29063D","type":"c","r":0.12941176470588237,"g":0.807843137254902,"b":0.43529411764705883,"value":2215535,"nodeType":"Color"},{"uuid":"447D0D22-5FA0-4830-BD49-98AD3E2CA682","type":"c","r":0.043137254901960784,"g":0.7490196078431373,"b":0.3607843137254902,"value":769884,"nodeType":"Color"},{"uuid":"5EDE7900-51AC-44AA-A387-4678621F0D63","type":"f","value":1,"nodeType":"Float"},{"uuid":"77950BA7-1E8B-454B-A4AC-119E9440189F","type":"i","value":1,"nodeType":"Int"},{"uuid":"1488B993-5420-4767-9A95-4F39A2FB2D8F","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"7A66DB8B-58E1-40A8-990C-4A2EC942DBE3","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"397E68D1-20F7-48A2-9992-1F1FBB7CF7E3","type":"f","value":1,"nodeType":"Float"},{"uuid":"4C1008DA-D1FB-40D0-860D-5CE9E67FCBCA","type":"f","value":2,"nodeType":"Float"},{"uuid":"0A0CA126-9DEA-4AA3-8C6B-6A63115A29C9","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"7888E796-3CB1-4AC1-8644-BF5452B06FBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"A8AB473C-E072-45F0-B192-E595B5911ABE","type":"i","value":2,"nodeType":"Int"},{"uuid":"066795CA-302A-4B46-8D7A-30CB6529243F","type":"phong","color":"3F306F81-A623-400A-8FC7-696CBEA50AB9","specular":"5A0D4F70-E86B-4F7F-8E9F-1CC80ED76630","shininess":"B3E00C21-5CFA-4A34-A6CE-3726D15F08FB","shadingAlpha":"2BA13361-FB94-45D2-854F-C111395F145F","shadingBlend":"F9FA2E32-F570-4617-9287-6CCC99C66597","afterColor":"0D4869B0-2A94-4DE8-BD42-A466B5DEBFD5","alpha":"991C9629-F9F8-4CB2-B1EF-56634B136B77","nodeType":"Phong"},{"uuid":"3F306F81-A623-400A-8FC7-696CBEA50AB9","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"0D4869B0-2A94-4DE8-BD42-A466B5DEBFD5","type":"v3","a":"83B8BBF8-5349-4974-AE38-B9FB84D30E4D","b":"179FD3A7-C9A3-47FC-A298-7C0AB2FA15AF","alpha":"2C9FFE33-E314-42ED-8196-B0FF3927AF8F","mode":"A8AB473C-E072-45F0-B192-E595B5911ABE","nodeType":"Blend"},{"uuid":"83B8BBF8-5349-4974-AE38-B9FB84D30E4D","type":"v3","a":"04D02F29-9BF0-488C-B264-9E9C6D987226","b":"1B2D331B-75D0-4BE1-BEA7-1125D072E8AC","alpha":"4F1909A9-3260-4E2F-A3F5-7E54735B4BC1","mode":"77950BA7-1E8B-454B-A4AC-119E9440189F","nodeType":"Blend"},{"uuid":"04D02F29-9BF0-488C-B264-9E9C6D987226","type":"v3","a":"D88FA03E-56B7-49ED-9A02-AAC36B7BDEE8","b":"C583524A-4980-4F51-8AE1-5ABE831B1C2E","alpha":"FA2B316D-FBDD-42BE-ACA2-7385438A161A","mode":"1AF57012-D004-4E60-AF5C-BB05E4513297","nodeType":"Blend"},{"uuid":"D88FA03E-56B7-49ED-9A02-AAC36B7BDEE8","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C583524A-4980-4F51-8AE1-5ABE831B1C2E","type":"v3","thickness":"5484C4D2-0DB5-4465-8E63-CF303124534C","ior":"9054AD34-3EA7-48E7-9A95-831E0C8D837F","roughness":"76D7E7DA-DCF1-4F4B-9343-7138C5BE4B10","alpha":"C5B50162-BFC4-48EF-B6EA-1B968DB0553F","calpha":"gC583524A49804F518AE15ABE831B1C2E_calpha","nodeType":"Transmission"},{"uuid":"FA2B316D-FBDD-42BE-ACA2-7385438A161A","type":"f","src":"gC583524A49804F518AE15ABE831B1C2E_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1B2D331B-75D0-4BE1-BEA7-1125D072E8AC","type":"v3","near":"48104DF0-AE27-42F2-89E0-07267A6DCE69","far":"29C2105B-F2CC-474B-B84F-42CC33DEDC9D","isVector":"5A2CF87C-18B4-47ED-BF76-6FB1E550F22F","isWorldSpace":"4801E43A-99C5-4FD8-BD99-185C5E473E2B","origin":"99F63B3A-105F-4C99-8F85-EF04F1DAD5E4","colorA":"9D01C42E-3985-4156-8A77-6ABDAC29063D","colorB":"447D0D22-5FA0-4830-BD49-98AD3E2CA682","alpha":"5EDE7900-51AC-44AA-A387-4678621F0D63","nodeType":"Depth"},{"uuid":"4F1909A9-3260-4E2F-A3F5-7E54735B4BC1","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"5EDE7900-51AC-44AA-A387-4678621F0D63"},"nodeType":"Expression"},{"uuid":"179FD3A7-C9A3-47FC-A298-7C0AB2FA15AF","type":"v3","color":"1488B993-5420-4767-9A95-4F39A2FB2D8F","bias":"7A66DB8B-58E1-40A8-990C-4A2EC942DBE3","scale":"397E68D1-20F7-48A2-9992-1F1FBB7CF7E3","intensity":"4C1008DA-D1FB-40D0-860D-5CE9E67FCBCA","factor":"0A0CA126-9DEA-4AA3-8C6B-6A63115A29C9","alpha":"7888E796-3CB1-4AC1-8644-BF5452B06FBC","mode":"A8AB473C-E072-45F0-B192-E595B5911ABE","calpha":"g179FD3A7C9A347FCA2987C0AB2FA15AF_calpha","nodeType":"Fresnel"},{"uuid":"2C9FFE33-E314-42ED-8196-B0FF3927AF8F","type":"f","src":"g179FD3A7C9A347FCA2987C0AB2FA15AF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"991C9629-F9F8-4CB2-B1EF-56634B136B77","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9A769E1-43DF-4418-AB19-9E4C0A2533D1","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"9BA2E2D3-0539-4F81-9C11-C8FC223191EC","nodeType":"Color"},{"uuid":"9BA2E2D3-0539-4F81-9C11-C8FC223191EC","type":"f","value":1,"nodeType":"Float"},{"uuid":"7CF936D8-D39A-4E1D-80F1-2C457818D764","type":"i","value":0,"nodeType":"Int"},{"uuid":"647660D0-1206-4EC2-9DD5-60DC648550AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"AF7F09A8-08AD-4A80-9BAB-1AC5784F11F9","type":"i","value":0,"nodeType":"Int"},{"uuid":"1653D575-A0A5-4982-8C7F-84319722A0FF","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"A663181D-AFDD-4F35-88A8-1B2C79A48125","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"370E5D12-A562-4A65-8586-C3157BEE284D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"884CB91C-A4D6-4503-A21F-CE8E81922DCC","type":"f","value":1,"nodeType":"Float"},{"uuid":"5BF1A9EC-61E4-4711-A9F6-4CE8C91F7F1D","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"13C3CA7C-9AD2-492C-96C7-96BBC1BFDD77","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A3D6141-5E19-4499-B9E6-62A4C546095F","type":"f","value":1,"nodeType":"Float"},{"uuid":"A8DB1A2F-5E84-4A5F-A862-D064C83B42DF","type":"i","value":0,"nodeType":"Int"},{"uuid":"0C2EDF54-7E99-4D32-854C-54443B3B66E8","type":"lambert","color":"C9A769E1-43DF-4418-AB19-9E4C0A2533D1","emissiveIntensity":"1FD72F11-0E00-4E0A-810B-079A68E35C24","shadingAlpha":"647660D0-1206-4EC2-9DD5-60DC648550AC","shadingBlend":"AF7F09A8-08AD-4A80-9BAB-1AC5784F11F9","afterColor":"4062E5AF-201E-4045-B4C9-8510F08AE02D","alpha":"7592D0B2-D0C1-4E00-9E55-C61DCD4A767B","emissive":"1653D575-A0A5-4982-8C7F-84319722A0FF","nodeType":"Lambert"},{"uuid":"1FD72F11-0E00-4E0A-810B-079A68E35C24","type":"f","value":1,"nodeType":"Float"},{"uuid":"4062E5AF-201E-4045-B4C9-8510F08AE02D","type":"v3","a":"590A9E8A-EA0D-4ABC-8736-CE7566DA9DFA","b":"75412401-47FB-467D-936F-EBB69E4B0304","alpha":"ED1ACCC5-23C6-43D0-813D-FEB4CBDA3001","mode":"A8DB1A2F-5E84-4A5F-A862-D064C83B42DF","nodeType":"Blend"},{"uuid":"590A9E8A-EA0D-4ABC-8736-CE7566DA9DFA","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"75412401-47FB-467D-936F-EBB69E4B0304","type":"v3","color":"A663181D-AFDD-4F35-88A8-1B2C79A48125","bias":"370E5D12-A562-4A65-8586-C3157BEE284D","scale":"884CB91C-A4D6-4503-A21F-CE8E81922DCC","intensity":"5BF1A9EC-61E4-4711-A9F6-4CE8C91F7F1D","factor":"13C3CA7C-9AD2-492C-96C7-96BBC1BFDD77","alpha":"1A3D6141-5E19-4499-B9E6-62A4C546095F","mode":"A8DB1A2F-5E84-4A5F-A862-D064C83B42DF","calpha":"g7541240147FB467D936FEBB69E4B0304_calpha","nodeType":"Fresnel"},{"uuid":"ED1ACCC5-23C6-43D0-813D-FEB4CBDA3001","type":"f","src":"g7541240147FB467D936FEBB69E4B0304_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7592D0B2-D0C1-4E00-9E55-C61DCD4A767B","type":"f","value":1,"nodeType":"Float"},{"uuid":"A65CA6B0-054E-4FD2-8589-2FE09BE8767C","type":"f","value":1,"nodeType":"Float"},{"uuid":"40449ABC-49F8-4EE5-8BB4-841CD72C7295","type":"i","value":0,"nodeType":"Int"},{"uuid":"3C40B306-8A60-4EB9-A7AB-146C0B077053","type":"f","value":30,"nodeType":"Float"},{"uuid":"FAC20942-DD34-4E7E-8766-A55F7F21D7E1","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"6240E78F-A9B3-41BB-8E4B-50F36312277A","type":"f","value":10,"nodeType":"Float"},{"uuid":"EC80C9FF-E763-4171-A927-8A1A89DB39AE","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"12C00ABD-CF8D-48FB-857B-3AE515130095","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0E37A3F7-1DE3-48ED-8B8D-F8510D265583","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"C72A74B1-80C0-4D72-9AB9-476E2710C40F","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"1121A3E8-C4D6-4B85-8D43-608A7677D4B4","project":false,"nodeType":"Texture"},{"uuid":"1121A3E8-C4D6-4B85-8D43-608A7677D4B4","type":"v2","index":0,"nodeType":"UV"},{"uuid":"D3B1A4D4-E7F4-4013-A005-0A573ADB47D9","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"938BAC47-8567-4D5C-8919-A9DED2CC43EB","project":false,"nodeType":"Texture"},{"uuid":"938BAC47-8567-4D5C-8919-A9DED2CC43EB","type":"v2","index":0,"nodeType":"UV"},{"uuid":"7498B20F-8926-45A0-82DB-8B4E22062FFF","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"1318EEBB-3370-4B5D-A6F0-51B51ACCFBE5","type":"f","value":1,"nodeType":"Float"},{"uuid":"365D787F-5F6F-4783-9942-A7B1896533F7","type":"i","value":0,"nodeType":"Int"},{"uuid":"0BCD19F0-A86E-4F78-83E7-9F09CAB3CB94","type":"f","value":50,"nodeType":"Float"},{"uuid":"80FF2F5D-F45B-4B33-AE6A-E0597F6339AA","type":"f","value":138,"nodeType":"Float"},{"uuid":"228841E2-49C8-4A6C-A562-E0FD0B438814","type":"f","value":1,"nodeType":"Float"},{"uuid":"C60EE18A-0CAF-4F18-9741-9D3229CD7F01","type":"f","value":0,"nodeType":"Float"},{"uuid":"ABE590E5-3B9A-4EFA-9E1D-7B9023E5BEF8","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"FFB2DEE8-DDAB-4FFF-88A4-0253E0948FDC","type":"c","r":0.8352941176470589,"g":0.8823529411764706,"b":1,"value":14017023,"nodeType":"Color"},{"uuid":"6E590138-6786-49D0-BB51-6175CEC278C2","type":"c","r":0.43529411764705883,"g":0.596078431372549,"b":1,"value":7313663,"nodeType":"Color"},{"uuid":"0A7F2832-5C42-44DE-93F6-BAE6EB1F2ECE","type":"f","value":1,"nodeType":"Float"},{"uuid":"A3145E79-ADB6-4CE0-AE5A-838E105108E6","type":"i","value":1,"nodeType":"Int"},{"uuid":"589EF3A6-DA8B-4DD5-97B1-73DF2677BA99","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"65B1DAF5-BD29-40B3-9E59-37E9DF715DAA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DD6185AD-8385-46C5-A4EC-1C7A02155B3E","type":"f","value":1,"nodeType":"Float"},{"uuid":"67249777-FC4A-4A37-90C7-90A8ED6861E8","type":"f","value":2,"nodeType":"Float"},{"uuid":"005E6840-F7EC-4CD4-A8A7-AABBEDCEB2E2","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"D573E4B3-24BA-4443-9A99-7D1D3B8B6AC0","type":"f","value":1,"nodeType":"Float"},{"uuid":"A755EC0E-A1EB-411E-A7A9-D0A4F3613E43","type":"i","value":2,"nodeType":"Int"},{"uuid":"E0123BBF-A4D9-4B79-B02B-541E15F8506C","type":"phong","color":"A3845468-484A-41B9-A70A-59857CDC5002","specular":"FAC20942-DD34-4E7E-8766-A55F7F21D7E1","shininess":"3C40B306-8A60-4EB9-A7AB-146C0B077053","shadingAlpha":"A65CA6B0-054E-4FD2-8589-2FE09BE8767C","shadingBlend":"40449ABC-49F8-4EE5-8BB4-841CD72C7295","afterColor":"354282AA-8B61-4654-81DD-5B1E55191CE1","alpha":"4DA060BE-8417-4C38-A88A-E7D230356772","nodeType":"Phong"},{"uuid":"A3845468-484A-41B9-A70A-59857CDC5002","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"354282AA-8B61-4654-81DD-5B1E55191CE1","type":"v3","a":"3495A3A1-4812-4E34-BD02-DB8A0B0D633B","b":"2B895072-A8B1-43E5-B422-4AADF787CAB4","alpha":"C7C0667A-72FC-4AF7-8AD3-9568AE3882C8","mode":"A755EC0E-A1EB-411E-A7A9-D0A4F3613E43","nodeType":"Blend"},{"uuid":"3495A3A1-4812-4E34-BD02-DB8A0B0D633B","type":"v3","a":"B19255E9-FACD-48B8-B6A9-6D8A06E7A2B1","b":"7FE0BA20-893B-4508-BD68-8236FC6FF3C0","alpha":"8BDB7BAD-5DF8-4F65-B5A2-B9F3F4D0D3EC","mode":"A3145E79-ADB6-4CE0-AE5A-838E105108E6","nodeType":"Blend"},{"uuid":"B19255E9-FACD-48B8-B6A9-6D8A06E7A2B1","type":"v3","a":"53CD5F01-3E87-424A-AE8A-141CF4937AAC","b":"2E0AED47-C41B-4340-8CAE-F601B1F28C18","alpha":"A0143149-DB78-4E3F-BCE7-22A8B6AFDB4C","mode":"365D787F-5F6F-4783-9942-A7B1896533F7","nodeType":"Blend"},{"uuid":"53CD5F01-3E87-424A-AE8A-141CF4937AAC","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2E0AED47-C41B-4340-8CAE-F601B1F28C18","type":"v3","thickness":"6240E78F-A9B3-41BB-8E4B-50F36312277A","ior":"EC80C9FF-E763-4171-A927-8A1A89DB39AE","roughness":"12C00ABD-CF8D-48FB-857B-3AE515130095","alpha":"1318EEBB-3370-4B5D-A6F0-51B51ACCFBE5","calpha":"g2E0AED47C41B43408CAEF601B1F28C18_calpha","nodeType":"Transmission"},{"uuid":"A0143149-DB78-4E3F-BCE7-22A8B6AFDB4C","type":"f","src":"g2E0AED47C41B43408CAEF601B1F28C18_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7FE0BA20-893B-4508-BD68-8236FC6FF3C0","type":"v3","near":"0BCD19F0-A86E-4F78-83E7-9F09CAB3CB94","far":"80FF2F5D-F45B-4B33-AE6A-E0597F6339AA","isVector":"228841E2-49C8-4A6C-A562-E0FD0B438814","isWorldSpace":"C60EE18A-0CAF-4F18-9741-9D3229CD7F01","origin":"ABE590E5-3B9A-4EFA-9E1D-7B9023E5BEF8","colorA":"FFB2DEE8-DDAB-4FFF-88A4-0253E0948FDC","colorB":"6E590138-6786-49D0-BB51-6175CEC278C2","alpha":"0A7F2832-5C42-44DE-93F6-BAE6EB1F2ECE","nodeType":"Depth"},{"uuid":"8BDB7BAD-5DF8-4F65-B5A2-B9F3F4D0D3EC","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"0A7F2832-5C42-44DE-93F6-BAE6EB1F2ECE"},"nodeType":"Expression"},{"uuid":"2B895072-A8B1-43E5-B422-4AADF787CAB4","type":"v3","color":"589EF3A6-DA8B-4DD5-97B1-73DF2677BA99","bias":"65B1DAF5-BD29-40B3-9E59-37E9DF715DAA","scale":"DD6185AD-8385-46C5-A4EC-1C7A02155B3E","intensity":"67249777-FC4A-4A37-90C7-90A8ED6861E8","factor":"005E6840-F7EC-4CD4-A8A7-AABBEDCEB2E2","alpha":"D573E4B3-24BA-4443-9A99-7D1D3B8B6AC0","mode":"A755EC0E-A1EB-411E-A7A9-D0A4F3613E43","calpha":"g2B895072A8B143E5B4224AADF787CAB4_calpha","nodeType":"Fresnel"},{"uuid":"C7C0667A-72FC-4AF7-8AD3-9568AE3882C8","type":"f","src":"g2B895072A8B143E5B4224AADF787CAB4_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4DA060BE-8417-4C38-A88A-E7D230356772","type":"f","value":1,"nodeType":"Float"},{"uuid":"D88BA1B7-5A9B-4D4F-BFC9-7427F6C25813","type":"f","value":1,"nodeType":"Float"},{"uuid":"8FDE0E7C-68AF-4CDB-90B9-D82FEE34F083","type":"i","value":0,"nodeType":"Int"},{"uuid":"992E79FF-D3F5-495D-B7B5-92193DEFB0DB","type":"f","value":30,"nodeType":"Float"},{"uuid":"D18F822A-C5AF-4512-A258-EB69BF567E24","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"502D1FE5-8B3E-4184-BE6B-EEBE72A1D983","type":"f","value":10,"nodeType":"Float"},{"uuid":"285C5029-D887-4946-8630-1D6CFD5CF455","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"DD5FAED6-C3B6-43E1-B0AC-A96F0AC25F8B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"57DDE948-0D3D-4544-BD1B-69D3FDA8D6E8","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9EEADD74-9BEE-49D2-891D-0C027183DB68","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"EF5B389D-0993-4770-808E-58764093679B","project":false,"nodeType":"Texture"},{"uuid":"EF5B389D-0993-4770-808E-58764093679B","type":"v2","index":0,"nodeType":"UV"},{"uuid":"94256F27-2334-42AE-9ECA-E3C6724ECB51","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"CD6648F0-FD09-405F-A10F-C87FB1564478","project":false,"nodeType":"Texture"},{"uuid":"CD6648F0-FD09-405F-A10F-C87FB1564478","type":"v2","index":0,"nodeType":"UV"},{"uuid":"9F1592D7-76AA-4094-92F6-026AE1E6138F","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"EE752D12-EBC4-48EB-B1BB-C86155A10B20","type":"f","value":1,"nodeType":"Float"},{"uuid":"9FEEC81C-8107-4182-8533-D53DAB80BCE9","type":"i","value":0,"nodeType":"Int"},{"uuid":"D3792316-B100-4DC9-A4D0-4ACD79BD6CB8","type":"f","value":50,"nodeType":"Float"},{"uuid":"39514DE8-731D-44EA-9505-6389FEE4321C","type":"f","value":138,"nodeType":"Float"},{"uuid":"5A232138-325C-443D-AF0C-335D731CE859","type":"f","value":1,"nodeType":"Float"},{"uuid":"9632E64F-3A83-4A8B-86AF-2167917D7224","type":"f","value":0,"nodeType":"Float"},{"uuid":"697AAF77-34AD-41C9-AEFB-364995CFD84A","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"2D210595-3F34-4BFF-ADF6-AE748732546C","type":"c","r":0.615686274509804,"g":0.7215686274509804,"b":0.9882352941176471,"value":10336508,"nodeType":"Color"},{"uuid":"7795B6A4-7450-4CF2-ADFD-C4C177C46808","type":"c","r":0.2,"g":0.4196078431372549,"b":0.984313725490196,"value":3369979,"nodeType":"Color"},{"uuid":"DBC57924-E7AC-4E5F-A1DA-684BA8A730C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"7D2C63B4-FD2F-408B-8C95-F0B95BCDAD9C","type":"i","value":1,"nodeType":"Int"},{"uuid":"AEAA25DE-F136-4225-8405-915937E700E0","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"1C4FC337-0D03-4C51-A614-E1154D182862","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FEE79E88-D899-4A06-AFEC-59F610273F78","type":"f","value":1,"nodeType":"Float"},{"uuid":"9BA428C0-B0A4-4EE0-A79A-47348E76A293","type":"f","value":2,"nodeType":"Float"},{"uuid":"F9455A5B-FFBF-40C8-8336-0392134FD5D0","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"FCCDA6BC-2793-49F8-91D7-98AD077AA151","type":"f","value":1,"nodeType":"Float"},{"uuid":"4EB7775B-8E80-434D-BD25-FB9FC6BC29E1","type":"i","value":2,"nodeType":"Int"},{"uuid":"145A0902-0A69-4D8C-8474-8FDA1661C1A4","type":"phong","color":"60C66EFA-2812-459A-86D1-7BC3F833D4A5","specular":"D18F822A-C5AF-4512-A258-EB69BF567E24","shininess":"992E79FF-D3F5-495D-B7B5-92193DEFB0DB","shadingAlpha":"D88BA1B7-5A9B-4D4F-BFC9-7427F6C25813","shadingBlend":"8FDE0E7C-68AF-4CDB-90B9-D82FEE34F083","afterColor":"957D60A4-FA7F-4C15-BBD6-01EF61C615CB","alpha":"3B62E8B4-4B1C-41E1-BE71-56AAC5FFB5A9","nodeType":"Phong"},{"uuid":"60C66EFA-2812-459A-86D1-7BC3F833D4A5","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"957D60A4-FA7F-4C15-BBD6-01EF61C615CB","type":"v3","a":"6C8E835D-FDF0-4066-B1C8-2223128C564C","b":"A13332AE-1711-4CC3-AB3D-67FB8E0AFA7F","alpha":"9C1BAB4A-5C56-431B-8F3E-2736FE1A2A52","mode":"4EB7775B-8E80-434D-BD25-FB9FC6BC29E1","nodeType":"Blend"},{"uuid":"6C8E835D-FDF0-4066-B1C8-2223128C564C","type":"v3","a":"D642EDA2-1AA6-43A5-91AE-3F2F9D838844","b":"BC762542-FE18-4BC8-83E1-646884517562","alpha":"90A2226D-D2C1-4B18-B835-6FE908160BF5","mode":"7D2C63B4-FD2F-408B-8C95-F0B95BCDAD9C","nodeType":"Blend"},{"uuid":"D642EDA2-1AA6-43A5-91AE-3F2F9D838844","type":"v3","a":"CC8E7272-F049-4957-8B21-E9C33CDB580A","b":"B880BF1D-E522-414F-AC04-8F24BA98EB36","alpha":"A7B86146-7A18-4D4D-8D6C-700D3D98165E","mode":"9FEEC81C-8107-4182-8533-D53DAB80BCE9","nodeType":"Blend"},{"uuid":"CC8E7272-F049-4957-8B21-E9C33CDB580A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B880BF1D-E522-414F-AC04-8F24BA98EB36","type":"v3","thickness":"502D1FE5-8B3E-4184-BE6B-EEBE72A1D983","ior":"285C5029-D887-4946-8630-1D6CFD5CF455","roughness":"DD5FAED6-C3B6-43E1-B0AC-A96F0AC25F8B","alpha":"EE752D12-EBC4-48EB-B1BB-C86155A10B20","calpha":"gB880BF1DE522414FAC048F24BA98EB36_calpha","nodeType":"Transmission"},{"uuid":"A7B86146-7A18-4D4D-8D6C-700D3D98165E","type":"f","src":"gB880BF1DE522414FAC048F24BA98EB36_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BC762542-FE18-4BC8-83E1-646884517562","type":"v3","near":"D3792316-B100-4DC9-A4D0-4ACD79BD6CB8","far":"39514DE8-731D-44EA-9505-6389FEE4321C","isVector":"5A232138-325C-443D-AF0C-335D731CE859","isWorldSpace":"9632E64F-3A83-4A8B-86AF-2167917D7224","origin":"697AAF77-34AD-41C9-AEFB-364995CFD84A","colorA":"2D210595-3F34-4BFF-ADF6-AE748732546C","colorB":"7795B6A4-7450-4CF2-ADFD-C4C177C46808","alpha":"DBC57924-E7AC-4E5F-A1DA-684BA8A730C0","nodeType":"Depth"},{"uuid":"90A2226D-D2C1-4B18-B835-6FE908160BF5","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"DBC57924-E7AC-4E5F-A1DA-684BA8A730C0"},"nodeType":"Expression"},{"uuid":"A13332AE-1711-4CC3-AB3D-67FB8E0AFA7F","type":"v3","color":"AEAA25DE-F136-4225-8405-915937E700E0","bias":"1C4FC337-0D03-4C51-A614-E1154D182862","scale":"FEE79E88-D899-4A06-AFEC-59F610273F78","intensity":"9BA428C0-B0A4-4EE0-A79A-47348E76A293","factor":"F9455A5B-FFBF-40C8-8336-0392134FD5D0","alpha":"FCCDA6BC-2793-49F8-91D7-98AD077AA151","mode":"4EB7775B-8E80-434D-BD25-FB9FC6BC29E1","calpha":"gA13332AE17114CC3AB3D67FB8E0AFA7F_calpha","nodeType":"Fresnel"},{"uuid":"9C1BAB4A-5C56-431B-8F3E-2736FE1A2A52","type":"f","src":"gA13332AE17114CC3AB3D67FB8E0AFA7F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3B62E8B4-4B1C-41E1-BE71-56AAC5FFB5A9","type":"f","value":1,"nodeType":"Float"},{"uuid":"C945F7A1-EFC0-4ED1-87A0-7C33BB9FA43F","type":"f","value":1,"nodeType":"Float"},{"uuid":"6F2EDC34-CF76-4663-8E71-14F0B3EEF894","type":"i","value":0,"nodeType":"Int"},{"uuid":"163BD641-4991-4904-8A7E-3A6043CA8046","type":"f","value":30,"nodeType":"Float"},{"uuid":"1F0FB2B6-F197-4708-9AC7-BF734207B1DA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"018447A8-61B4-4942-B472-4A9012B697DB","type":"f","value":10,"nodeType":"Float"},{"uuid":"33F66752-9447-4943-AA13-6DE401E71F27","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3BF5C95E-3B61-48E7-9542-67F2BE92D74A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"50D73010-ACF4-450C-A9BD-95890ABB3500","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"30699311-6457-46A3-8ADC-8797A4D42E66","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"B65C32AA-7E01-4B73-AC8E-C4AF1AD98651","project":false,"nodeType":"Texture"},{"uuid":"B65C32AA-7E01-4B73-AC8E-C4AF1AD98651","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0684F1FD-DAE9-4141-BBAD-ED42E6BC9270","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"9336C17B-315E-4F13-89B1-574410E211B8","project":false,"nodeType":"Texture"},{"uuid":"9336C17B-315E-4F13-89B1-574410E211B8","type":"v2","index":0,"nodeType":"UV"},{"uuid":"87D214B8-09AF-4785-BCB8-7963E0F76D16","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"1B7730FB-2632-44FE-83F6-3744376F6E21","type":"f","value":1,"nodeType":"Float"},{"uuid":"A137770B-858A-4074-BC71-018165BBE247","type":"i","value":0,"nodeType":"Int"},{"uuid":"5645E55F-81E4-4BB7-B22A-999140F2AE06","type":"f","value":50,"nodeType":"Float"},{"uuid":"7C574E29-82A2-4B6E-92E9-A98E6EFFB357","type":"f","value":138,"nodeType":"Float"},{"uuid":"1B27DD54-BA11-40DE-8746-4FEE189DCDBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"C1C97AB2-6D08-4639-82F4-A38AE8812347","type":"f","value":0,"nodeType":"Float"},{"uuid":"B3792114-9DC7-499C-AC3D-395E06E66EC1","type":"v3","x":0,"y":-93,"z":0,"nodeType":"Vector3"},{"uuid":"3AFEE082-B047-499B-9497-31F3581306C4","type":"c","r":0.43529411764705883,"g":0.596078431372549,"b":1,"value":7313663,"nodeType":"Color"},{"uuid":"1DC1DCB9-28BC-4269-9D94-B4DFC32E95D4","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"BC99BFD5-E0C9-40F1-8C52-4EA57B814D46","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2CE9C92-FD67-4C2A-8F80-BED0DE6DD915","type":"i","value":1,"nodeType":"Int"},{"uuid":"87ADFA15-CBFA-4164-8E84-3D166F73CBCA","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"75D5D667-F7B6-42D1-AAD8-1EC335599088","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C03FECAB-3C8D-4CBD-A2FF-83A75FAEDB35","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D3DE70C-BCA3-49E7-BE9F-70344EA82BF4","type":"f","value":2,"nodeType":"Float"},{"uuid":"AB539115-BA17-483C-B020-2231A0431CDD","type":"f","value":1.2,"nodeType":"Float"},{"uuid":"C8711B08-701A-4CED-86E6-53A68E9C950C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C3BC28CB-646A-4BF5-AC3E-1D286D33F46B","type":"i","value":2,"nodeType":"Int"},{"uuid":"1AF7BCCB-B827-4644-844A-968D3A3883D4","type":"phong","color":"741083A6-D655-4A3F-ACE1-E64F5E32675F","specular":"1F0FB2B6-F197-4708-9AC7-BF734207B1DA","shininess":"163BD641-4991-4904-8A7E-3A6043CA8046","shadingAlpha":"C945F7A1-EFC0-4ED1-87A0-7C33BB9FA43F","shadingBlend":"6F2EDC34-CF76-4663-8E71-14F0B3EEF894","afterColor":"A4AE6E6A-FB0A-41FE-B490-3FEE40CC9030","alpha":"2D2C6DC3-F6D7-4B8A-A08D-C2D9EA1E7C26","nodeType":"Phong"},{"uuid":"741083A6-D655-4A3F-ACE1-E64F5E32675F","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"A4AE6E6A-FB0A-41FE-B490-3FEE40CC9030","type":"v3","a":"8CFB4CAC-DD6E-43FE-BF84-A8D28CA5F8EA","b":"347F4AD9-9D8C-4CFD-9949-C7E9169F419F","alpha":"459C8855-7B1C-4EF4-A4FF-4CC448F48106","mode":"C3BC28CB-646A-4BF5-AC3E-1D286D33F46B","nodeType":"Blend"},{"uuid":"8CFB4CAC-DD6E-43FE-BF84-A8D28CA5F8EA","type":"v3","a":"511CE656-6894-44A9-9083-B7578515993D","b":"9A9BC30E-FF7D-4A52-9363-33F678501498","alpha":"1ECEFECA-B5FB-4A05-9EF9-1D608B9BB0A3","mode":"E2CE9C92-FD67-4C2A-8F80-BED0DE6DD915","nodeType":"Blend"},{"uuid":"511CE656-6894-44A9-9083-B7578515993D","type":"v3","a":"224AB231-10DC-4222-8C3D-AFB5B724B7CB","b":"7BE500DB-FE01-4605-BE93-7F61AAD506B1","alpha":"B7A8998B-01FA-453A-AB3C-D9E7C3B56E3C","mode":"A137770B-858A-4074-BC71-018165BBE247","nodeType":"Blend"},{"uuid":"224AB231-10DC-4222-8C3D-AFB5B724B7CB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7BE500DB-FE01-4605-BE93-7F61AAD506B1","type":"v3","thickness":"018447A8-61B4-4942-B472-4A9012B697DB","ior":"33F66752-9447-4943-AA13-6DE401E71F27","roughness":"3BF5C95E-3B61-48E7-9542-67F2BE92D74A","alpha":"1B7730FB-2632-44FE-83F6-3744376F6E21","calpha":"g7BE500DBFE014605BE937F61AAD506B1_calpha","nodeType":"Transmission"},{"uuid":"B7A8998B-01FA-453A-AB3C-D9E7C3B56E3C","type":"f","src":"g7BE500DBFE014605BE937F61AAD506B1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9A9BC30E-FF7D-4A52-9363-33F678501498","type":"v3","near":"5645E55F-81E4-4BB7-B22A-999140F2AE06","far":"7C574E29-82A2-4B6E-92E9-A98E6EFFB357","isVector":"1B27DD54-BA11-40DE-8746-4FEE189DCDBC","isWorldSpace":"C1C97AB2-6D08-4639-82F4-A38AE8812347","origin":"B3792114-9DC7-499C-AC3D-395E06E66EC1","colorA":"3AFEE082-B047-499B-9497-31F3581306C4","colorB":"1DC1DCB9-28BC-4269-9D94-B4DFC32E95D4","alpha":"BC99BFD5-E0C9-40F1-8C52-4EA57B814D46","nodeType":"Depth"},{"uuid":"1ECEFECA-B5FB-4A05-9EF9-1D608B9BB0A3","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"BC99BFD5-E0C9-40F1-8C52-4EA57B814D46"},"nodeType":"Expression"},{"uuid":"347F4AD9-9D8C-4CFD-9949-C7E9169F419F","type":"v3","color":"87ADFA15-CBFA-4164-8E84-3D166F73CBCA","bias":"75D5D667-F7B6-42D1-AAD8-1EC335599088","scale":"C03FECAB-3C8D-4CBD-A2FF-83A75FAEDB35","intensity":"3D3DE70C-BCA3-49E7-BE9F-70344EA82BF4","factor":"AB539115-BA17-483C-B020-2231A0431CDD","alpha":"C8711B08-701A-4CED-86E6-53A68E9C950C","mode":"C3BC28CB-646A-4BF5-AC3E-1D286D33F46B","calpha":"g347F4AD99D8C4CFD9949C7E9169F419F_calpha","nodeType":"Fresnel"},{"uuid":"459C8855-7B1C-4EF4-A4FF-4CC448F48106","type":"f","src":"g347F4AD99D8C4CFD9949C7E9169F419F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2D2C6DC3-F6D7-4B8A-A08D-C2D9EA1E7C26","type":"f","value":1,"nodeType":"Float"},{"uuid":"B7164B44-EB2C-4680-BFAF-961B9CEC73D5","type":"f","value":1,"nodeType":"Float"},{"uuid":"7A557D73-1AEC-49AB-A613-906B4B873366","type":"i","value":0,"nodeType":"Int"},{"uuid":"CC84EC6B-88C6-4049-B4DE-B5182705E4C5","type":"f","value":30,"nodeType":"Float"},{"uuid":"4FFC60F5-EA83-4BC5-98D1-F29C23A81C48","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"4AE19871-5B80-4514-BEBC-8C1A77E124B5","type":"f","value":10,"nodeType":"Float"},{"uuid":"E6FF2A5C-E29A-4898-9545-280EE32FEB64","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"97412FA1-946F-400F-96D8-2BC557E680E6","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8DFE1665-95E2-4EC8-9FCD-0F6241E35E0A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D3256E82-604B-4D38-A598-FBC96A7F2744","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"246DF61F-5202-4F72-8E63-E4AAB568B783","type":"f","value":1,"nodeType":"Float"},{"uuid":"F18151D0-37EB-4ACF-AE04-D24895A059CC","type":"i","value":0,"nodeType":"Int"},{"uuid":"C9847147-0078-44C6-9D15-702F62D675D8","type":"f","value":50,"nodeType":"Float"},{"uuid":"63C630C5-51D2-4D34-9045-253931828D15","type":"f","value":105,"nodeType":"Float"},{"uuid":"F527B3D7-FFBD-4CC2-B40C-3A2F9A9B6220","type":"f","value":1,"nodeType":"Float"},{"uuid":"D651C7E4-63D5-4375-AC94-65E7CDB231F5","type":"f","value":0,"nodeType":"Float"},{"uuid":"AB367644-D08D-4C59-8AC3-F598F56BD53B","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"44BF7401-C965-4ADF-A6AC-12AD700CD34A","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"B44EBBBD-A526-49A4-9A70-8254FB3A388D","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"F88613A5-B863-43F4-B32B-F0EBD5F0CD75","type":"f","value":1,"nodeType":"Float"},{"uuid":"6393A22F-3F4E-4E45-92B0-496323566437","type":"i","value":1,"nodeType":"Int"},{"uuid":"7D2F3DEB-4CF8-4DFA-9D5B-C5FED5810DEF","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"49F3FEB4-FFD2-4A24-9E22-1C9F4DB09B9D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"7E7ED73D-3C47-463E-A123-42B381DECDCD","type":"f","value":1,"nodeType":"Float"},{"uuid":"FB7B7483-F9C9-40B3-B09A-BA28F26FDB62","type":"f","value":2,"nodeType":"Float"},{"uuid":"1BC67844-F9AE-435A-A0A1-AE8E4BCAA9F2","type":"f","value":1,"nodeType":"Float"},{"uuid":"BC51CFA2-4F08-4C77-81DE-009416E11A68","type":"f","value":1,"nodeType":"Float"},{"uuid":"F6164187-9CE8-44A1-9A51-19CB8B6AD52F","type":"i","value":2,"nodeType":"Int"},{"uuid":"DBD773D2-E154-47DA-9738-7C03C27634B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"8A03247E-81E7-4107-9661-B8B251231C1D","type":"i","value":0,"nodeType":"Int"},{"uuid":"0E53E028-8FF3-46FD-9E03-403AF627283C","type":"f","value":30,"nodeType":"Float"},{"uuid":"D55A5A6D-B7B7-468D-8C80-B4A66070C61B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B2FB0964-2DC7-4DE8-BBD5-E472CB2FF77F","type":"f","value":10,"nodeType":"Float"},{"uuid":"0EEE3A0A-390C-4A69-BF94-AD1C4BAAFE53","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"ED00FB39-58C5-44C6-8E29-117822D9922F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"61005767-B162-4110-A62A-6F045C57C1BA","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2FDE52A9-C996-4577-9BC7-9B13A06767B4","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"AC81BD71-23FD-4E54-9AAA-C968A6F15CEF","type":"f","value":1,"nodeType":"Float"},{"uuid":"6009D537-CBFF-4D3D-B782-0171B7FEA517","type":"i","value":0,"nodeType":"Int"},{"uuid":"A461DFB4-6849-4017-88DA-1BC791498718","type":"f","value":50,"nodeType":"Float"},{"uuid":"79E09BE2-4A71-475F-9C6C-2ED34273242D","type":"f","value":105,"nodeType":"Float"},{"uuid":"7981FA42-FEED-4D90-BFCF-AF32187852AE","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2540DED-561A-4868-8EE6-B9A2965A1081","type":"f","value":0,"nodeType":"Float"},{"uuid":"8694CAD4-1858-4ACE-A4A0-D528168AC0ED","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D6C9472E-0D59-4044-8E7E-B56DA59CDB7B","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"388E080A-ADEE-4726-B514-1E16D6A8FE5B","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"E1361F3D-5BFF-43C8-8CAC-64D3D6BD7AF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"EAA1BAD6-E0C3-48D6-8B0C-6E6532174D2A","type":"i","value":1,"nodeType":"Int"},{"uuid":"22A9ECDE-0418-4EF6-9ABB-31C5D2DD84DA","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"7DB26221-422D-4D5A-BF1E-0244F56CF865","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"90987169-1C65-4B82-9C0B-3A65DAEE818A","type":"f","value":1,"nodeType":"Float"},{"uuid":"97D17124-8BAD-4A68-AD1C-683A2255D1C3","type":"f","value":2,"nodeType":"Float"},{"uuid":"E19C7789-6357-41F8-9A19-5BBCCD3385A3","type":"f","value":1,"nodeType":"Float"},{"uuid":"C512DE7C-4D4A-43F8-BBB2-E69AD73E5809","type":"f","value":1,"nodeType":"Float"},{"uuid":"769025A8-A4E3-4373-BC75-0525733913EC","type":"i","value":2,"nodeType":"Int"},{"uuid":"C00A2568-2D70-4C7C-B69C-894F65714681","type":"f","value":1,"nodeType":"Float"},{"uuid":"9249A607-3C94-4098-B076-1EE7324A3566","type":"i","value":0,"nodeType":"Int"},{"uuid":"011BA7EE-BBC4-4A72-9469-57562E2958B3","type":"f","value":30,"nodeType":"Float"},{"uuid":"469D3246-2E57-4C62-AA7B-F8D1CF46D3DB","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B7C6EA51-18CB-4906-9D34-86583AD384C3","type":"f","value":10,"nodeType":"Float"},{"uuid":"83C45AD9-F416-4E60-81CC-96D8D790E2D3","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F239F2F2-1B6C-462C-BDB2-94A0D6A457E7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9C097F89-4824-494A-8361-2902B17C2E10","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"7EE6762D-FE2D-41C2-A150-A9BEABB52CAA","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"43BA3B35-A78E-42CB-B830-6EA2B3DAA930","project":false,"nodeType":"Texture"},{"uuid":"43BA3B35-A78E-42CB-B830-6EA2B3DAA930","type":"v2","index":0,"nodeType":"UV"},{"uuid":"446A44B0-E1CF-4470-A48C-F3D21EF77B2D","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"77AB3744-7020-4451-B3C2-940CFEFF31A2","project":false,"nodeType":"Texture"},{"uuid":"77AB3744-7020-4451-B3C2-940CFEFF31A2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"09C89CAB-8FB9-43C1-88F0-5B0E8F016A08","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"79FE293B-116C-433B-AB37-67BC202628CA","type":"f","value":1,"nodeType":"Float"},{"uuid":"B54F4322-7821-44F9-87D2-C19F09E5B2E2","type":"i","value":0,"nodeType":"Int"},{"uuid":"E94E5936-B05D-431A-82EB-B08D2E333100","type":"f","value":50,"nodeType":"Float"},{"uuid":"D833BB61-82FF-4FA0-8E19-E92617735A0D","type":"f","value":105,"nodeType":"Float"},{"uuid":"EC92E25D-134C-4459-A8DB-11F0FDA9AA57","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BAE41AA-E4E7-490F-86AC-C8C6D1A33C21","type":"f","value":0,"nodeType":"Float"},{"uuid":"FFE9D9E7-AC2B-4410-B869-0F6BA252F72A","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D414832B-BDB7-4DDE-9635-DD7E6ADC0595","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"00A818EB-CDF3-4E98-9770-0C7877BE91DC","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"ACB1DF72-5335-4807-B5E9-44AE5E61E806","type":"f","value":1,"nodeType":"Float"},{"uuid":"EF41405F-F8AC-4425-9AE7-36F750481FFA","type":"i","value":1,"nodeType":"Int"},{"uuid":"01E86A42-AC6B-4C92-80B9-BF70984494AE","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"591625F3-E974-4529-8A05-0D5F09D6F272","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4771018E-7A1A-48C1-B7DC-FA54EB2AECE3","type":"f","value":1,"nodeType":"Float"},{"uuid":"DA848ADA-68C1-4B8D-9E86-1858A0425785","type":"f","value":2,"nodeType":"Float"},{"uuid":"254BB84F-9E53-4305-812A-BE6A7CBFFED1","type":"f","value":1,"nodeType":"Float"},{"uuid":"A2130A6A-9D16-4FF5-99F4-59F299B2EC4B","type":"f","value":1,"nodeType":"Float"},{"uuid":"2543792B-4A9C-4D45-B24E-0137FEC5958D","type":"i","value":2,"nodeType":"Int"},{"uuid":"898DD51E-82E5-4ECF-936C-DB9BB8869008","type":"phong","color":"658AF83B-F82B-40B8-9589-07092342FCA0","specular":"469D3246-2E57-4C62-AA7B-F8D1CF46D3DB","shininess":"011BA7EE-BBC4-4A72-9469-57562E2958B3","shadingAlpha":"C00A2568-2D70-4C7C-B69C-894F65714681","shadingBlend":"9249A607-3C94-4098-B076-1EE7324A3566","afterColor":"83482FA7-06C0-4124-A2A4-24D2102834FE","alpha":"BFAAF918-6198-4576-BEB8-3751F75AA95C","nodeType":"Phong"},{"uuid":"658AF83B-F82B-40B8-9589-07092342FCA0","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"83482FA7-06C0-4124-A2A4-24D2102834FE","type":"v3","a":"DAA4C9D1-AC3C-4F6E-B367-E6651521D980","b":"542FF610-0FF1-411A-B510-D850C578A328","alpha":"00DDE6F8-7D55-4C6E-86C8-3CD5F38B7242","mode":"2543792B-4A9C-4D45-B24E-0137FEC5958D","nodeType":"Blend"},{"uuid":"DAA4C9D1-AC3C-4F6E-B367-E6651521D980","type":"v3","a":"3E403985-74BB-4DBB-9598-06550DE87BE9","b":"86EBB9D7-F413-48CB-BC71-28E2437ACA08","alpha":"60E552BD-4D1A-4861-AF4A-5BF299053CE6","mode":"EF41405F-F8AC-4425-9AE7-36F750481FFA","nodeType":"Blend"},{"uuid":"3E403985-74BB-4DBB-9598-06550DE87BE9","type":"v3","a":"A6699AE7-5F69-45BA-8766-121E4080A884","b":"07BD75F2-E862-454C-BFF4-4F810143934C","alpha":"639E82FF-E35F-4F42-846E-E29F733F1367","mode":"B54F4322-7821-44F9-87D2-C19F09E5B2E2","nodeType":"Blend"},{"uuid":"A6699AE7-5F69-45BA-8766-121E4080A884","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"07BD75F2-E862-454C-BFF4-4F810143934C","type":"v3","thickness":"B7C6EA51-18CB-4906-9D34-86583AD384C3","ior":"83C45AD9-F416-4E60-81CC-96D8D790E2D3","roughness":"F239F2F2-1B6C-462C-BDB2-94A0D6A457E7","alpha":"79FE293B-116C-433B-AB37-67BC202628CA","calpha":"g07BD75F2E862454CBFF44F810143934C_calpha","nodeType":"Transmission"},{"uuid":"639E82FF-E35F-4F42-846E-E29F733F1367","type":"f","src":"g07BD75F2E862454CBFF44F810143934C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"86EBB9D7-F413-48CB-BC71-28E2437ACA08","type":"v3","near":"E94E5936-B05D-431A-82EB-B08D2E333100","far":"D833BB61-82FF-4FA0-8E19-E92617735A0D","isVector":"EC92E25D-134C-4459-A8DB-11F0FDA9AA57","isWorldSpace":"1BAE41AA-E4E7-490F-86AC-C8C6D1A33C21","origin":"FFE9D9E7-AC2B-4410-B869-0F6BA252F72A","colorA":"D414832B-BDB7-4DDE-9635-DD7E6ADC0595","colorB":"00A818EB-CDF3-4E98-9770-0C7877BE91DC","alpha":"ACB1DF72-5335-4807-B5E9-44AE5E61E806","nodeType":"Depth"},{"uuid":"60E552BD-4D1A-4861-AF4A-5BF299053CE6","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"ACB1DF72-5335-4807-B5E9-44AE5E61E806"},"nodeType":"Expression"},{"uuid":"542FF610-0FF1-411A-B510-D850C578A328","type":"v3","color":"01E86A42-AC6B-4C92-80B9-BF70984494AE","bias":"591625F3-E974-4529-8A05-0D5F09D6F272","scale":"4771018E-7A1A-48C1-B7DC-FA54EB2AECE3","intensity":"DA848ADA-68C1-4B8D-9E86-1858A0425785","factor":"254BB84F-9E53-4305-812A-BE6A7CBFFED1","alpha":"A2130A6A-9D16-4FF5-99F4-59F299B2EC4B","mode":"2543792B-4A9C-4D45-B24E-0137FEC5958D","calpha":"g542FF6100FF1411AB510D850C578A328_calpha","nodeType":"Fresnel"},{"uuid":"00DDE6F8-7D55-4C6E-86C8-3CD5F38B7242","type":"f","src":"g542FF6100FF1411AB510D850C578A328_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BFAAF918-6198-4576-BEB8-3751F75AA95C","type":"f","value":1,"nodeType":"Float"},{"uuid":"BDD98DD0-AC0E-4D68-8E7B-DB1BFCBCBCE9","type":"f","value":1,"nodeType":"Float"},{"uuid":"D3F8BE9B-2556-4060-88A4-C89FB412A7A5","type":"i","value":0,"nodeType":"Int"},{"uuid":"F479A9C0-51C6-4B4D-B703-1E310903D7F9","type":"f","value":30,"nodeType":"Float"},{"uuid":"7BCCE0F6-4B35-4AA9-88B0-087BAB29D007","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"5C629552-21DD-4FC4-8AF4-F9D3F1FBF5EE","type":"f","value":10,"nodeType":"Float"},{"uuid":"FAC68640-74F4-4B94-90C2-8ADC2CDC915E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"E8F94A76-59EB-4A85-AAD8-2B86333E291A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"34071F06-0EB3-459B-B5CF-68263F37D822","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B0DADF5C-46FA-495D-96DF-36CAF737A56C","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"5A37C20B-2AE7-4FF2-94F8-D0B3052503C2","type":"f","value":1,"nodeType":"Float"},{"uuid":"129D0CF8-D81F-4AD6-BB7B-9AD09A7A3B4B","type":"i","value":0,"nodeType":"Int"},{"uuid":"35396001-3869-45D6-861C-25D46EEB38B5","type":"f","value":50,"nodeType":"Float"},{"uuid":"9950BB2D-F33A-47E1-87BC-D9E8405D3BA9","type":"f","value":105,"nodeType":"Float"},{"uuid":"9A319E8C-D4DD-43CF-9593-6FC8D989F1EA","type":"f","value":1,"nodeType":"Float"},{"uuid":"E20EF353-A910-4CEC-9BAE-DFD1D8DB60D1","type":"f","value":0,"nodeType":"Float"},{"uuid":"85A1A2C3-064B-4891-9750-3279FF0F3BE8","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"727C98A8-674A-4373-8401-4D1BE1029334","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"C68D0CCC-5A42-4BD5-AD43-1FAE9C4A6035","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"576BB030-88FC-4141-94B5-42BB4673F959","type":"f","value":1,"nodeType":"Float"},{"uuid":"69E2A9D7-EDB4-46F9-859B-E0ADF642DF2F","type":"i","value":1,"nodeType":"Int"},{"uuid":"21140693-88E6-48F8-BC7F-D3B594B95E87","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"51A57E9A-3966-4501-874D-3538A88756ED","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"76DAD6EE-3644-4718-86F2-C9F55B5DD640","type":"f","value":1,"nodeType":"Float"},{"uuid":"03C4FAB4-3ECF-4D6B-9C3F-C011FFC494FA","type":"f","value":2,"nodeType":"Float"},{"uuid":"26068DF8-4EE6-4825-98D3-BC118FAAA57C","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BC40063-C166-447E-BA6A-D50038ADD9E2","type":"f","value":1,"nodeType":"Float"},{"uuid":"1C14C6EC-4044-462E-8660-31E182A13D0E","type":"i","value":2,"nodeType":"Int"},{"uuid":"DA2C907D-DC41-45F3-B3D0-E69791B93BAD","type":"f","value":1,"nodeType":"Float"},{"uuid":"931ADA70-3A00-43C0-8A77-CE7590C3D47D","type":"i","value":0,"nodeType":"Int"},{"uuid":"D471FDE2-BA06-44C2-9B0B-78EE0F5B68AB","type":"f","value":30,"nodeType":"Float"},{"uuid":"B199EF9D-90F7-49FE-8255-0782ED05948A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"31D63810-2B3C-458C-BC55-A98A5F562318","type":"f","value":10,"nodeType":"Float"},{"uuid":"47318336-F800-4052-B331-EFFEA362EEFE","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F7C32DFC-AA8D-4CD7-978A-BF202A2A59E2","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"51FE92EB-820F-42C8-9E05-9FAC4612C647","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"5B1651C5-B861-4B5E-A809-066F9FCD86E1","type":"v2","x":0.5603407477520114,"y":1,"nodeType":"Vector2"},{"uuid":"3C580090-CD5E-4A17-A7B2-41936CAD7D32","type":"f","value":1,"nodeType":"Float"},{"uuid":"3A7BB33C-EFC6-4D76-AE3F-A2FD70C8DAB3","type":"i","value":0,"nodeType":"Int"},{"uuid":"7219C4F7-22C1-43D5-BD1D-28FD79967814","type":"f","value":50,"nodeType":"Float"},{"uuid":"55FD9C43-6AF0-4B62-ABA2-C33721E05B45","type":"f","value":105,"nodeType":"Float"},{"uuid":"23B42463-0F4F-40AE-B93B-9D11CC307BD9","type":"f","value":1,"nodeType":"Float"},{"uuid":"C0B880A8-22DD-44E0-B74A-5E73BFC41EF3","type":"f","value":0,"nodeType":"Float"},{"uuid":"1FAD900F-581D-4650-B5C9-68C40D5B7612","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"91EDDB1E-8D6F-4FCB-8323-3577F10CC5C5","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"067D6531-EB1B-4201-BB1F-FBCD2969A359","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"6101E624-24D8-4C6F-BBA2-FA56ECC22F4F","type":"f","value":1,"nodeType":"Float"},{"uuid":"45E524BB-90CC-4ABC-BC3E-2C79FB646ABB","type":"i","value":1,"nodeType":"Int"},{"uuid":"48143EE6-044E-405F-85C1-2D12C40924CA","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"6FAF0760-FC59-4454-8F6E-9C53C525A3E4","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"968CDBFC-624D-4EA9-BA47-F2A86B09F0B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A41A9A9-B94D-42C0-B7B6-5B52023C0E93","type":"f","value":2,"nodeType":"Float"},{"uuid":"1013C849-AC2F-470C-8DAF-4382D130A9E7","type":"f","value":1,"nodeType":"Float"},{"uuid":"AFE9D7BD-7D66-4164-A7C2-51ED25DEE09A","type":"f","value":1,"nodeType":"Float"},{"uuid":"924FD8BE-65BD-4997-B6C9-B4B2C7865446","type":"i","value":2,"nodeType":"Int"},{"uuid":"2D01189F-D61B-490B-8B85-4A1175159DA1","type":"f","value":1,"nodeType":"Float"},{"uuid":"44367F92-FF9C-44B3-8292-B060B13CE38B","type":"i","value":0,"nodeType":"Int"},{"uuid":"E17CBDE0-69FF-44CD-B932-CE7008203DB9","type":"f","value":30,"nodeType":"Float"},{"uuid":"A55F6C1B-331F-463B-AFF4-79373099A694","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"264A1EB0-5A13-4689-9C8D-56D78986371A","type":"f","value":10,"nodeType":"Float"},{"uuid":"B35A4597-B419-4A57-BD9E-3FBFB0E72D30","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"CFD9E468-A87A-440C-A8C0-CD3020EB06AC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8957C859-0C67-4573-B87B-4596045C3BE7","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"C2262E10-6ADC-4EC2-8554-0AD07D9DD7AD","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"24B0BF6F-E73C-42B1-846F-905CD44B3207","project":false,"nodeType":"Texture"},{"uuid":"24B0BF6F-E73C-42B1-846F-905CD44B3207","type":"v2","index":0,"nodeType":"UV"},{"uuid":"53E26472-8706-4636-A692-DB17DD553DCE","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"422A53F8-50F4-481E-AFAC-5F9E08D73604","project":false,"nodeType":"Texture"},{"uuid":"422A53F8-50F4-481E-AFAC-5F9E08D73604","type":"v2","index":0,"nodeType":"UV"},{"uuid":"16911111-A0B4-4645-9061-CDBC11316771","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"96642886-B5A8-4FAC-BAF0-05179689E970","type":"f","value":1,"nodeType":"Float"},{"uuid":"636E1E6D-7A78-4F55-B9CD-3BC5E7913C64","type":"i","value":0,"nodeType":"Int"},{"uuid":"E1DE21A6-AE68-4B25-879B-EB005F00010A","type":"f","value":50,"nodeType":"Float"},{"uuid":"15F80B00-AE56-465D-B687-E48607B8DEDF","type":"f","value":105,"nodeType":"Float"},{"uuid":"1CC2AD57-FA1D-4F75-ADAF-4CB51CA9054E","type":"f","value":1,"nodeType":"Float"},{"uuid":"FCB56A05-D7CF-4CA0-9EF7-964AEAFD141F","type":"f","value":0,"nodeType":"Float"},{"uuid":"176C635E-ADB4-4C17-8EF3-56AEA0E425E9","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AB435291-A95F-4FAD-9690-5A57C7EC2F9E","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"BB89ED14-68DB-4C3E-AD8B-02DDF35CF499","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"949EC30E-4092-42B7-A966-B18DD36ED153","type":"f","value":1,"nodeType":"Float"},{"uuid":"0B5C5CD8-398B-4B17-A52A-159CB66093D0","type":"i","value":1,"nodeType":"Int"},{"uuid":"02E2850E-C276-40D6-90D0-3FF0E466B254","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"646AF896-441D-4D60-9481-987CDAFEA871","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"A495FADF-A576-4FFD-9D2F-28AC8F271D99","type":"f","value":1,"nodeType":"Float"},{"uuid":"4BB1CE90-4874-412D-BB17-8C40B9B87930","type":"f","value":2,"nodeType":"Float"},{"uuid":"050C1D72-C1A6-4B22-8071-51B02D2E5F84","type":"f","value":1,"nodeType":"Float"},{"uuid":"8951F2F0-4B18-4751-BBF8-00DC51442EA4","type":"f","value":1,"nodeType":"Float"},{"uuid":"602E5348-FEB2-4B93-BE94-B2A440CFAE97","type":"i","value":2,"nodeType":"Int"},{"uuid":"10503716-FA03-4ECF-9671-8B72F623C746","type":"phong","color":"596DDE60-F4E7-4415-BF48-4F4A16458AD4","specular":"A55F6C1B-331F-463B-AFF4-79373099A694","shininess":"E17CBDE0-69FF-44CD-B932-CE7008203DB9","shadingAlpha":"2D01189F-D61B-490B-8B85-4A1175159DA1","shadingBlend":"44367F92-FF9C-44B3-8292-B060B13CE38B","afterColor":"01239780-4149-4929-9BAD-4C47F0C7EE96","alpha":"A089BF12-8954-4DE0-967B-AB799A6F8654","nodeType":"Phong"},{"uuid":"596DDE60-F4E7-4415-BF48-4F4A16458AD4","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"01239780-4149-4929-9BAD-4C47F0C7EE96","type":"v3","a":"EB2262B5-E1CE-40FE-8548-0008FFC98709","b":"ACC96AE5-6F32-4645-9692-DBCB6E180BB9","alpha":"FC69788C-A9C1-42E0-B860-0B50FA337F4D","mode":"602E5348-FEB2-4B93-BE94-B2A440CFAE97","nodeType":"Blend"},{"uuid":"EB2262B5-E1CE-40FE-8548-0008FFC98709","type":"v3","a":"A2778D71-1AE7-4882-949C-14F98202413A","b":"D0DCF6B9-D1EE-4498-90A5-C889AEE1EAC6","alpha":"6D07FCFB-1E49-44A4-8E45-0698E97CAF49","mode":"0B5C5CD8-398B-4B17-A52A-159CB66093D0","nodeType":"Blend"},{"uuid":"A2778D71-1AE7-4882-949C-14F98202413A","type":"v3","a":"34F5808A-BD7F-47A0-A849-1EDE019CE67E","b":"69DFDCD2-6CB1-4914-B0C0-A4BEB4BC7FF0","alpha":"757CCF75-1593-450F-ADCF-525ADEDE6A05","mode":"636E1E6D-7A78-4F55-B9CD-3BC5E7913C64","nodeType":"Blend"},{"uuid":"34F5808A-BD7F-47A0-A849-1EDE019CE67E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"69DFDCD2-6CB1-4914-B0C0-A4BEB4BC7FF0","type":"v3","thickness":"264A1EB0-5A13-4689-9C8D-56D78986371A","ior":"B35A4597-B419-4A57-BD9E-3FBFB0E72D30","roughness":"CFD9E468-A87A-440C-A8C0-CD3020EB06AC","alpha":"96642886-B5A8-4FAC-BAF0-05179689E970","calpha":"g69DFDCD26CB14914B0C0A4BEB4BC7FF0_calpha","nodeType":"Transmission"},{"uuid":"757CCF75-1593-450F-ADCF-525ADEDE6A05","type":"f","src":"g69DFDCD26CB14914B0C0A4BEB4BC7FF0_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D0DCF6B9-D1EE-4498-90A5-C889AEE1EAC6","type":"v3","near":"E1DE21A6-AE68-4B25-879B-EB005F00010A","far":"15F80B00-AE56-465D-B687-E48607B8DEDF","isVector":"1CC2AD57-FA1D-4F75-ADAF-4CB51CA9054E","isWorldSpace":"FCB56A05-D7CF-4CA0-9EF7-964AEAFD141F","origin":"176C635E-ADB4-4C17-8EF3-56AEA0E425E9","colorA":"AB435291-A95F-4FAD-9690-5A57C7EC2F9E","colorB":"BB89ED14-68DB-4C3E-AD8B-02DDF35CF499","alpha":"949EC30E-4092-42B7-A966-B18DD36ED153","nodeType":"Depth"},{"uuid":"6D07FCFB-1E49-44A4-8E45-0698E97CAF49","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"949EC30E-4092-42B7-A966-B18DD36ED153"},"nodeType":"Expression"},{"uuid":"ACC96AE5-6F32-4645-9692-DBCB6E180BB9","type":"v3","color":"02E2850E-C276-40D6-90D0-3FF0E466B254","bias":"646AF896-441D-4D60-9481-987CDAFEA871","scale":"A495FADF-A576-4FFD-9D2F-28AC8F271D99","intensity":"4BB1CE90-4874-412D-BB17-8C40B9B87930","factor":"050C1D72-C1A6-4B22-8071-51B02D2E5F84","alpha":"8951F2F0-4B18-4751-BBF8-00DC51442EA4","mode":"602E5348-FEB2-4B93-BE94-B2A440CFAE97","calpha":"gACC96AE56F3246459692DBCB6E180BB9_calpha","nodeType":"Fresnel"},{"uuid":"FC69788C-A9C1-42E0-B860-0B50FA337F4D","type":"f","src":"gACC96AE56F3246459692DBCB6E180BB9_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A089BF12-8954-4DE0-967B-AB799A6F8654","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[2113,1184],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/font_dark/index.html b/site/spline/design/font_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/font_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/font_dark/runtime.js b/site/spline/design/font_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/font_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw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VWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/font_dark/scene.json b/site/spline/design/font_dark/scene.json deleted file mode 100644 index 4049379bb..000000000 --- a/site/spline/design/font_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"D11A1401-2783-446E-8F0F-57A85E87B969","objectType":"EmptyObject","name":"Empty Object 2","matrix":[1,0,0,0,0,0.9396926207859078,-0.3420201433256687,0,0,0.3420201433256687,0.9396926207859078,0,-167.0000000000001,23.996523342699845,-8.308763260530334,1],"layers":1,"children":[{"uuid":"7AF8FD1F-BC80-4D37-BBEF-C5D6059B2263","objectType":"Mesh3D","name":"Cube copy 15","matrix":[1,0,0,0,0,0.9999999999999999,-5.551115123125783e-17,0,0,5.551115123125783e-17,0.9999999999999999,0,-167.00000000000009,23.996523342699845,-9.704327404526182,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,167.0000000000001,-23.996523342699845,8.308763260530334,1],"interaction":{"uuid":"11FE0FBD-07EA-42DA-A960-E1334B6285CF"},"geometry":"BBE0D3B1-9115-44D0-B327-31FB7CFD9595","material":"183AFA53-4732-4FE3-B0DB-7A082DB5FE7C"},{"uuid":"CD5BBAC0-CFAB-4575-A2BA-DBE4070BC412","objectType":"VectorObject","name":"Shape copy 3","matrix":[0.9999999999999999,0,0,0,0,1.0000000000000009,-1.2143841381447813e-16,0,0,1.2143841381447813e-16,1.0000000000000009,0,-123.2587229585908,-217.03909649452757,-159.26112468260712,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.1427840147035844,0,0,0,0,1.1427840147035842,0,0,0,0,1.1427840147035844,0,73.04201915318966,213.43386177443762,178.82651933032918,1],"interaction":{"uuid":"F8A2718A-8BCA-40DE-98D4-B5382CF8ADF0"},"geometry":"3F9FB91A-0F67-489D-85FE-927A10B8665D","material":"150E7E78-6711-4ED6-8D38-60A9D5502814"},{"uuid":"09CDABF8-9E0E-45D5-8AA8-895713095EEB","objectType":"VectorObject","name":"Shape copy 3","matrix":[0.9999999999999999,0,0,0,0,1.0000000000000009,-1.2143841381447813e-16,0,0,1.2143841381447813e-16,1.0000000000000009,0,-58.545409290764326,-216.83155346735938,-158.9279023867273,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.1427840147035844,0,0,0,0,1.1427840147035842,0,0,0,0,1.1427840147035844,0,73.04201915318966,213.43386177443762,178.82651933032918,1],"interaction":{"uuid":"33076125-CD5E-48A9-88E7-30487F2C53A1"},"geometry":"759446BC-A7C6-450B-9147-7F1FEC72CD62","material":"9828EFB5-0428-4B33-A0C6-2AF6082B4241"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D7DED7AD-ABB8-4F92-BA10-D602E2224AE1","selectedState":0,"states":["274385EE-94F2-4E5B-B7B9-E40E6720FB66","C49BDF8A-86ED-4E2F-AC93-1253180D5EF0"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D11A1401-2783-446E-8F0F-57A85E87B969","state":"C49BDF8A-86ED-4E2F-AC93-1253180D5EF0"}]}]},"enableHelper":true},{"uuid":"C7EF8605-4BCB-4C22-906F-1BEFDC62D0A3","objectType":"Mesh3D","name":"Cube copy 14","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-5.596745068776386,-185.5984449064932,83.90449870945913,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"interaction":{"uuid":"4D5F8AEB-AC67-4A9E-B1D9-8A8DBD3A7F4C","selectedState":0,"states":["5C9683A9-D4DC-43A5-96D9-09C7FDD3B89C","1B6C8C26-65A8-4B6E-B5FF-82935CF624D3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C7EF8605-4BCB-4C22-906F-1BEFDC62D0A3","state":"1B6C8C26-65A8-4B6E-B5FF-82935CF624D3"}]}]},"geometry":"D8B42F4C-89D6-432D-90ED-05E9F740B7B8","material":"58C753A4-59BE-4596-BFE7-2E8DBDEDB6C4"},{"uuid":"9484C79D-D9A0-4E71-994F-B060969FAFDA","objectType":"Mesh3D","name":"Cube copy 13","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,192.69534235511117,-144.12250620252024,-60.08034172670993,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"interaction":{"uuid":"1676B4B1-EDD9-4B9C-BB38-2730ED63DC5A","selectedState":0,"states":["8A11AB09-4F67-4162-B9E8-8036F48D03AE","20503FE1-3E52-4A9D-9029-14B457E9A782"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"9484C79D-D9A0-4E71-994F-B060969FAFDA","state":"20503FE1-3E52-4A9D-9029-14B457E9A782"}]}]},"geometry":"336DF3AE-439F-45A3-8D16-292B6EF17E3F","material":"F9FEC9AD-6B00-4282-B1AC-0216B42B8A4E"},{"uuid":"6DC94026-CAEA-4539-98B1-EDB3B190F1D3","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,360.1446709076129,-247.13774958036134,-119.86555037509562,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"interaction":{"uuid":"E574EEE6-9AA7-4E9B-9D7A-82532D0C38DF","selectedState":0,"states":["902FF276-7544-4C91-95D2-D1ADECC18ECA","C78E1C9F-CF2E-487C-ACD0-37B561D99A79"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6DC94026-CAEA-4539-98B1-EDB3B190F1D3","state":"C78E1C9F-CF2E-487C-ACD0-37B561D99A79"}]}]},"geometry":"663D8D47-61C8-4844-919E-194BD96C2462","material":"298869F0-3864-4CF0-9DA3-5ECFF7943911"},{"uuid":"D8811FF2-11F9-4F9B-8124-3829DA13D95F","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,77.64707881858095,10.251627470154062,-302.8586838226405,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"interaction":{"uuid":"C45EF014-6945-4BFE-8A44-0ACFE334D140","selectedState":0,"states":["12A6232F-B353-428E-8574-C9A22297CEBD","132540F2-699A-4A38-8617-DA6997FDC59A"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D8811FF2-11F9-4F9B-8124-3829DA13D95F","state":"132540F2-699A-4A38-8617-DA6997FDC59A"}]}]},"geometry":"BB0EBE1F-1FF0-47FE-B6A8-47DAE4449056","material":"A6865393-71CF-4EC4-A665-89E47A60981D"},{"uuid":"BA0875EE-47C8-4C63-B4CC-FFD72976F5A0","objectType":"CombinedCamera","name":"Camera","matrix":[0.911443640079891,6.938893903907227e-18,-0.41142495179305505,0,-0.11162903938175674,0.9624883617849055,-0.24729559437101528,0,0.3959917278487315,0.2713229688555829,0.8772538959997659,0,-196.48030449618443,305.2260716313182,1134.2095325830514,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"8F8109BF-0EFA-4118-AC08-B1D12D8C4CDE"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000018,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.7999096840045195,-2.7755575615628914e-17,-0.6001204024492001,0,-0.2717961677743277,0.8915599353950845,-0.36228127854127695,0,0.5350433072368809,0.452902728627586,0.7131674261929718,0,503.59174807543496,414.86924314906184,734.9575860928703,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":999.9999999999994,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1.10803324099723,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"477B45FB-0CEC-4418-9CD4-1AADCF7E9BDD","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-9.874986612800136,104.94933575476239,14.97687790345105,1],"visible":false,"layers":1,"children":[{"uuid":"D653BF28-DB4D-4214-93C1-D89624805F90","objectType":"VectorObject","name":"b","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-70.18832076348787,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"6EBBECB1-C172-4475-8721-B3658B125F56"},"geometry":"1A1B7E11-0B62-43C0-91FC-8498CF7591BF","material":"DDE050FB-D7AF-4964-815D-723FF52D7421"},{"uuid":"95C16058-3F8A-4D72-B1E3-1F63BA1C094C","objectType":"VectorObject","name":"B","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-124.60832076348785,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"D85793C3-3D03-4711-B90D-F06F1D0C8E71"},"geometry":"A483F1C7-A2C3-46A4-897A-7307D854FCCF","material":"60979C37-7BAB-42F1-A703-55559BDFFD69"},{"uuid":"9ADC19C8-FB88-4BD1-BC92-E7072FBAB0C1","objectType":"VectorObject","name":"A","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-241.96832076348784,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"155FBE4C-0C5C-4B8B-B394-269EF814C169"},"geometry":"E75C664D-36AD-41DC-A98F-70442833730C","material":"2BDBA13F-DCF7-4ECE-9677-5E3A80A404B4"},{"uuid":"893730E3-014F-4599-AD9C-8E0C638D2024","objectType":"VectorObject","name":"a","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-181.12832076348784,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"652D729A-1904-45B2-83C2-CE4AE05AE188"},"geometry":"395B32B7-DE93-4950-BFEE-F467B98918EA","material":"4C819118-BF8D-42FA-B94D-C57FCDDEE7E2"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"FE9DF28F-9A44-4C1F-825B-46715ABBC2C3"},"enableHelper":true},{"uuid":"51942A5E-47DB-494F-BAEF-4D8C2A8406D6","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,-32.15740815566272,10.73403219790113,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"E02F84AA-59C0-4450-8EC1-851D8D01C48A","selectedState":0,"states":["EE82309E-A200-42C9-9462-FF5D6473B526","E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"51942A5E-47DB-494F-BAEF-4D8C2A8406D6","state":"E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7"}]}]},"geometry":"7E4C85E4-83F0-4F2F-AF5C-0593EE86C0CB","material":"92E547A8-0637-4821-A5E8-5BBB5436DDB0"},{"uuid":"8DAA5FE6-9B7D-4345-ACB7-B735C113AC90","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,24.224149091491782,-9.787176401639002,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9675676E-5E9F-4351-B012-AC475395B1BC","selectedState":0,"states":["F4BDF665-5016-47C9-BA1A-52F1848C4F7A","78542D85-AC24-42D2-B2B4-474E43CA74BE"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"8DAA5FE6-9B7D-4345-ACB7-B735C113AC90","state":"78542D85-AC24-42D2-B2B4-474E43CA74BE"}]}]},"geometry":"426B95BD-CB3C-4ED6-B430-3071A84B7B73","material":"B7EDF099-C6B7-4517-BD0E-DBB10F291721"},{"uuid":"2A98E9C9-1C1C-472F-B8EE-EA9A68CB7B01","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,80.60570633864633,-30.308385001179136,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A8BDF44F-E095-4DBE-9D1F-817E3C61905E","selectedState":0,"states":["63E0609F-DDBF-490F-B465-574A2C4AAB53","8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"2A98E9C9-1C1C-472F-B8EE-EA9A68CB7B01","state":"8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B"}]}]},"geometry":"6443E63D-FEDC-4902-B80D-3F837CAB103F","material":"8B34B827-2EE3-47C7-9E4F-012F97EA0F04"}],"activeCamera":"BA0875EE-47C8-4C63-B4CC-FFD72976F5A0","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"BBE0D3B1-9115-44D0-B327-31FB7CFD9595","userData":{"parameters":{"width":180,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":180,"depth":32},"type":"CubeGeometry"}},{"uuid":"3F9FB91A-0F67-489D-85FE-927A10B8665D","userData":{"parameters":{"width":109,"subdivisions":40,"roundness":2,"extrudeDepth":18,"surfaceMaxCount":100,"extrudeBevelSize":0,"extrudeBevelSegments":3,"height":109,"depth":18},"shape":{"points":[45.12600000000001,11.706600000000002,45.12600000000001,11.706600000000002,45.12600000000001,11.706600000000002,2,21.058800000000005,11.706600000000002,21.058800000000005,11.706600000000002,21.058800000000005,11.706600000000002,2,17.069400000000005,0,17.069400000000005,0,17.069400000000005,0,2,0.7193999999999999,0,0.7193999999999999,0,0.7193999999999999,0,2,24.263399999999997,63.76500000000001,24.263399999999997,63.76500000000001,24.263399999999997,63.76500000000001,2,42.11760000000001,63.76500000000001,42.11760000000001,63.76500000000001,42.11760000000001,63.76500000000001,2,65.66159999999999,0,65.66159999999999,0,65.66159999999999,0,2,49.115400000000015,0,49.115400000000015,0,49.115400000000015,0,2],"shapeHoles":[{"points":[41.13660000000001,23.543999999999993,41.13660000000001,23.543999999999993,41.13660000000001,23.543999999999993,2,33.1578,47.153400000000005,33.1578,47.153400000000005,33.1578,47.153400000000005,2,25.04820000000001,23.543999999999993,25.04820000000001,23.543999999999993,25.04820000000001,23.543999999999993,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"759446BC-A7C6-450B-9147-7F1FEC72CD62","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":0,"extrudeBevelSegments":1,"height":100,"depth":16},"shape":{"points":[22.56,47.1,18.76,47.1,26.12,47.1,2,31.740000000000002,44.64,29.18,46.28,34.3,43.04,2,37.44,38.1,36.199999999999996,40.86,37.44,38.1,2,37.44,46.5,37.44,46.5,37.44,46.5,2,51.6,46.5,51.6,46.5,51.6,46.5,2,51.6,0,51.6,0,51.6,0,2,37.44,0,37.44,0,37.44,0,2,37.44,8.4,37.44,8.4,36.199999999999996,5.640000000000001,2,31.740000000000002,1.8599999999999999,34.3,3.4600000000000004,29.18,0.21999999999999992,2,22.56,-0.6,26.12,-0.6,18.76,-0.6,2,12.3,2.28,15.340000000000003,0.3599999999999999,9.260000000000002,4.2,2,5.1000000000000005,10.559999999999999,6.86,6.96,3.3800000000000003,14.2,2,2.52,23.28,2.52,18.44,2.52,28.16,2,5.1000000000000005,35.94,3.3800000000000003,32.379999999999995,6.86,39.54,2,12.3,44.22,9.260000000000002,42.300000000000004,15.340000000000003,46.14,2],"shapeHoles":[{"points":[27.18,34.56,30.18,34.56,24.1,34.56,2,19.8,31.560000000000002,21.64,33.56,17.92,29.560000000000002,2,16.98,23.28,16.98,26.800000000000004,16.98,19.72,2,19.8,14.94,17.92,16.939999999999998,21.64,12.940000000000001,2,27.18,11.940000000000001,24.1,11.940000000000001,30.18,11.940000000000001,2,34.56,15,32.64,12.96,36.48,17.04,2,37.44,23.28,37.44,19.8,37.44,26.76,2,34.56,31.560000000000002,36.48,29.520000000000003,32.64,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"D8B42F4C-89D6-432D-90ED-05E9F740B7B8","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"336DF3AE-439F-45A3-8D16-292B6EF17E3F","userData":{"parameters":{"width":150,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"663D8D47-61C8-4844-919E-194BD96C2462","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"BB0EBE1F-1FF0-47FE-B6A8-47DAE4449056","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"1A1B7E11-0B62-43C0-91FC-8498CF7591BF","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[33.900000000000006,47.1,30.340000000000003,47.1,37.74,47.1,2,44.22,44.22,41.18,46.14,47.260000000000005,42.300000000000004,2,51.36,35.94,49.64,39.54,53.12,32.379999999999995,2,54,23.28,54,28.16,54,18.44,2,51.36,10.559999999999999,53.12,14.2,49.64,6.96,2,44.22,2.28,47.260000000000005,4.2,41.18,0.3599999999999999,2,33.900000000000006,-0.6,37.74,-0.6,30.340000000000003,-0.6,2,24.78,1.8599999999999999,27.3,0.21999999999999992,22.220000000000002,3.4600000000000004,2,19.14,8.4,20.34,5.640000000000001,19.14,8.4,2,19.14,0,19.14,0,19.14,0,2,4.92,0,4.92,0,4.92,0,2,4.92,61.68,4.92,61.68,4.92,61.68,2,19.14,61.68,19.14,61.68,19.14,61.68,2,19.14,38.1,19.14,38.1,20.34,40.86,2,24.78,44.64,22.220000000000002,43.04,27.3,46.28,2],"shapeHoles":[{"points":[29.34,34.56,32.38,34.56,26.34,34.56,2,21.96,31.560000000000002,23.880000000000003,33.56,20.040000000000003,29.520000000000003,2,19.080000000000002,23.28,19.080000000000002,26.76,19.080000000000002,19.8,2,21.96,15,20.040000000000003,17.04,23.880000000000003,12.96,2,29.34,11.940000000000001,26.34,11.940000000000001,32.38,11.940000000000001,2,36.72,14.94,34.84,12.940000000000001,38.56,16.939999999999998,2,39.480000000000004,23.28,39.480000000000004,19.72,39.480000000000004,26.800000000000004,2,36.72,31.560000000000002,38.56,29.560000000000002,34.84,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"A483F1C7-A2C3-46A4-897A-7307D854FCCF","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":2593,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[40.260000000000005,30.36,43.3,31.080000000000002,43.82,29.52,2,48.720000000000006,25.14,46.64,27.779999999999998,50.8,22.54,2,51.839999999999996,16.080000000000002,51.839999999999996,19.52,51.839999999999996,11.040000000000001,2,46.800000000000004,4.260000000000001,50.16,7.1000000000000005,43.440000000000005,1.4200000000000002,2,32.34,0,38.620000000000005,0,32.34,0,2,4.92,0,4.92,0,4.92,0,2,4.92,58.92,4.92,58.92,4.92,58.92,2,31.68,58.92,31.68,58.92,37.68,58.92,2,45.6,55.02,42.32,57.620000000000005,48.879999999999995,52.38,2,50.519999999999996,43.86,50.519999999999996,48.66,50.519999999999996,40.3,2,47.64,34.98,49.559999999999995,37.339999999999996,45.760000000000005,32.62,2],"shapeHoles":[{"points":[19.14,34.86,19.14,34.86,19.14,34.86,2,28.500000000000004,34.86,28.500000000000004,34.86,33.46,34.86,2,35.94,41.160000000000004,35.94,36.96,35.94,45.400000000000006,2,28.32,47.52,33.4,47.52,28.32,47.52,2,19.14,47.52,19.14,47.52,19.14,47.52,2],"shapeHoles":[],"isClosed":true,"roundness":0},{"points":[29.34,11.58,29.34,11.58,34.62,11.58,0,37.26,18.06,37.26,13.74,37.26,20.18,0,35.16,23.04,36.559999999999995,21.84,33.76,24.240000000000002,0,29.28,24.840000000000003,31.8,24.840000000000003,29.28,24.840000000000003,0,19.14,24.840000000000003,19.14,24.840000000000003,19.14,24.840000000000003,0,19.14,11.58,19.14,11.58,19.14,11.58,0],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"E75C664D-36AD-41DC-A98F-70442833730C","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":100,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[41.400000000000006,10.74,41.400000000000006,10.74,41.400000000000006,10.74,2,19.32,10.74,19.32,10.74,19.32,10.74,2,15.66,0,15.66,0,15.66,0,2,0.6599999999999999,0,0.6599999999999999,0,0.6599999999999999,0,2,22.259999999999998,58.5,22.259999999999998,58.5,22.259999999999998,58.5,2,38.64,58.5,38.64,58.5,38.64,58.5,2,60.24,0,60.24,0,60.24,0,2,45.06,0,45.06,0,45.06,0,2],"shapeHoles":[{"points":[37.74,21.599999999999998,37.74,21.599999999999998,37.74,21.599999999999998,2,30.42,43.26,30.42,43.26,30.42,43.26,2,22.98,21.599999999999998,22.98,21.599999999999998,22.98,21.599999999999998,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"395B32B7-DE93-4950-BFEE-F467B98918EA","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[22.56,47.1,18.76,47.1,26.12,47.1,2,31.740000000000002,44.64,29.18,46.28,34.3,43.04,2,37.44,38.1,36.199999999999996,40.86,37.44,38.1,2,37.44,46.5,37.44,46.5,37.44,46.5,2,51.6,46.5,51.6,46.5,51.6,46.5,2,51.6,0,51.6,0,51.6,0,2,37.44,0,37.44,0,37.44,0,2,37.44,8.4,37.44,8.4,36.199999999999996,5.640000000000001,2,31.740000000000002,1.8599999999999999,34.3,3.4600000000000004,29.18,0.21999999999999992,2,22.56,-0.6,26.12,-0.6,18.76,-0.6,2,12.3,2.28,15.340000000000003,0.3599999999999999,9.260000000000002,4.2,2,5.1000000000000005,10.559999999999999,6.86,6.96,3.3800000000000003,14.2,2,2.52,23.28,2.52,18.44,2.52,28.16,2,5.1000000000000005,35.94,3.3800000000000003,32.379999999999995,6.86,39.54,2,12.3,44.22,9.260000000000002,42.300000000000004,15.340000000000003,46.14,2],"shapeHoles":[{"points":[27.18,34.56,30.18,34.56,24.1,34.56,2,19.8,31.560000000000002,21.64,33.56,17.92,29.560000000000002,2,16.98,23.28,16.98,26.800000000000004,16.98,19.72,2,19.8,14.94,17.92,16.939999999999998,21.64,12.940000000000001,2,27.18,11.940000000000001,24.1,11.940000000000001,30.18,11.940000000000001,2,34.56,15,32.64,12.96,36.48,17.04,2,37.44,23.28,37.44,19.8,37.44,26.76,2,34.56,31.560000000000002,36.48,29.520000000000003,32.64,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"7E4C85E4-83F0-4F2F-AF5C-0593EE86C0CB","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}},{"uuid":"426B95BD-CB3C-4ED6-B430-3071A84B7B73","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}},{"uuid":"6443E63D-FEDC-4902-B80D-3F837CAB103F","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"183AFA53-4732-4FE3-B0DB-7A082DB5FE7C","type":"ShaderMaterial","reflectivity":{"uuid":"0509D1BB-31F8-49F7-AAB6-3D19E6058D1D","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"6EC91AFA-CA1B-4D25-BCF0-1081967A6BEF","f0_alpha":"1217EEE7-4DFD-43AF-ACDB-BCFE93B0DA18","f0_mode":"B8DF150E-216D-40C9-ABEA-05F1EBB1BECD"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9F6AEEB9-3E46-4644-8D76-3AFA66B39B0D","f1_mode":"3F9E58E8-7590-40DE-9E64-025982AB5A4E","f1_roughness":"C3AFA940-F750-43A4-A7A9-B2702502ECC7","f1_metalness":"0B619F32-9B53-4638-8E46-AB6DFFDD2955","f1_reflectivity":"0509D1BB-31F8-49F7-AAB6-3D19E6058D1D"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A1136208-6028-4F13-B4F4-4D41F7BE9829","fragment":"A1136208-6028-4F13-B4F4-4D41F7BE9829"},{"uuid":"150E7E78-6711-4ED6-8D38-60A9D5502814","type":"ShaderMaterial","emissiveIntensity":{"uuid":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"44414A3E-18CF-4861-AC71-25A9ACC0269E","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"8F40CBD0-E09F-4F9F-978C-9A648A0AA0BE","f0_alpha":"2F413242-0FCB-477B-9F1F-43A9466A96F1","f0_mode":"148F9274-297A-4C7E-9A77-5CC70E89453E"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","f1_mode":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","f1_emissive":"F3F69A87-7E4E-4E23-AA33-0171E4A68A20"}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A","fragment":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A"},{"uuid":"9828EFB5-0428-4B33-A0C6-2AF6082B4241","type":"ShaderMaterial","emissiveIntensity":{"uuid":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"551C2DF8-4A52-4CEA-9831-F8FE5823A0B8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"E9AD9052-8703-4C9C-BD9B-E251D2F7B024","f0_alpha":"15C07F7E-5092-4E72-A60A-A33F8EB8AF0A","f0_mode":"0154A9D5-ADBA-433A-ADF3-3B79BC35029D"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","f1_mode":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","f1_emissive":"D4EE5AD2-0B58-4486-BA0C-C069E4C44A9D"}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7","fragment":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7"},{"uuid":"58C753A4-59BE-4596-BFE7-2E8DBDEDB6C4","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2DD1159D-F9E5-43A0-94D3-F1B77762AC2C","f1_mode":"0C677F1D-F950-464C-B64D-27AA828DF927","f1_shininess":"7167BA62-CA3F-404D-946D-2EC53D2FC716","f1_specular":"2D13F844-1951-40DF-8A06-939E5FE5AAF1"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"84A155AD-4115-44FD-A2FE-C621AE2B770B","f2_ior":"A8AC077E-9BA2-4738-82BF-61874BC0609A","f2_roughness":"A1E2154C-F814-4DAA-9232-BFEF484EAC61","f2_transmissionSamplerSize":"0C1D4708-D884-4305-8FEF-BBA50C321CA6","f2_transmissionSamplerMap":"860AE740-F34C-4D9F-A07C-5FAFCED5BDD7","f2_transmissionDepthMap":"FDA53F48-14C1-464F-8A0D-0582A40DB874","f2_aspectRatio":"AA35DAEB-09E3-4592-847D-CBDB00F82149","f2_alpha":"25EE2780-05CE-44CA-A68E-26791708B0B8","f2_mode":"9F8C63E5-36DD-4206-8A47-71269708026C"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"81C5311B-1F32-4AC9-858C-5AF1C3829759","f4_far":"B4257D72-12EE-4922-8006-8E10E623EFC1","f4_isVector":"41A76670-08AF-4635-9887-18E9760DB767","f4_isWorldSpace":"19124F82-1677-416E-A378-70BEA9BC2185","f4_origin":"53BF7D91-EBFE-4561-AF61-26673F9CB126","f4_colorA":"6ADD3BF4-2C47-4044-BC37-796E66B47619","f4_colorB":"379CDF6C-2333-47E7-A826-B9DF3C69047B","f4_alpha":"2E878167-CC61-4CFA-8F55-2E1A9A8BCB2D","f4_mode":"03DDB6B5-2E75-400F-A352-F5E8CFA6F38F"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"CB082EA9-79BF-4179-BB1D-076D4D68D033","f3_bias":"6581C8ED-FBCA-42A3-ADCA-08592AA3846F","f3_scale":"7E48B709-3006-457E-B601-C1EC5E41673D","f3_intensity":"5916D5FC-235C-49D3-9856-3E0364CD7662","f3_factor":"B0F63B39-B0C5-4483-B4B7-9C601BABB46D","f3_alpha":"9C37FEC3-0AAD-422B-81C6-9CA98AC9A147","f3_mode":"CA8B680B-5A6C-4161-A97D-349E1ED3EB70"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"5AE7E766-42F1-4E98-9F6C-1BCE565727FD","fragment":"5AE7E766-42F1-4E98-9F6C-1BCE565727FD"},{"uuid":"F9FEC9AD-6B00-4282-B1AC-0216B42B8A4E","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6D4BCF93-44A9-409F-B7A7-48B03C459DB1","f1_mode":"33F52298-8E8C-496E-837E-E5D4A868FCEE","f1_shininess":"58E45858-C36B-4EE7-A1C2-89CEB9957BF4","f1_specular":"358513A0-F8C9-42A8-BF94-F6373F313200"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DDEFAFD8-3B9B-4C45-9016-19F52F0BD227","f2_ior":"5C23A97C-FE9C-4224-BB77-92C66B017B57","f2_roughness":"30CCA389-9B77-4E13-84AD-823860DD639B","f2_transmissionSamplerSize":"662FF110-63FC-4FBA-9621-EC4168D5884F","f2_transmissionSamplerMap":"56DC5825-D96A-4806-B65E-2A78B1333BA7","f2_transmissionDepthMap":"69E7DDBF-4D66-4F7E-9A9E-DB8CD8E9E31E","f2_aspectRatio":"79F76553-E4F0-4B9A-B51E-67D251222C85","f2_alpha":"2773EB70-C843-4511-9047-F8C967207DEC","f2_mode":"DBC8ECC9-6377-44C2-94D2-7961D1A5124B"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"2CD0AB99-EC85-430F-AFDA-158ED30F4A68","f4_far":"AB460EB0-7A01-4C65-84E0-A6978094A9B2","f4_isVector":"6DBE0812-3517-403A-9B9C-3B6623F3C4CD","f4_isWorldSpace":"880F4E6F-77F2-4F99-B260-BE8F9B9FB6D8","f4_origin":"2BD0D542-A5DF-4549-8DBB-E9CC2FC8DD9D","f4_colorA":"F2BDF4A8-B3EF-4AEF-81AE-11075295BB41","f4_colorB":"AA30F813-A8B5-4686-9EE7-7F1ABDCA9EC3","f4_alpha":"E53E09AB-9F40-4227-AA1C-D5F9D9F2E7B3","f4_mode":"2811F2DE-0F5F-49E5-BE59-14A42387029B"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"86CE8FE0-60D9-4F40-B835-295CCE4B7BFB","f3_bias":"CCB70141-2AEF-4C2F-A602-843D60A85A22","f3_scale":"9AD970D2-2C54-4BE6-A7A0-0F67AABE2FD4","f3_intensity":"B6276B68-5740-4290-B405-9762FD841E8C","f3_factor":"FCABCF10-C46A-44FE-9879-38628F2C1CD4","f3_alpha":"A4DEECE4-C50D-42D3-994E-EF5B880845CC","f3_mode":"F88842EB-087A-4123-A56D-E65A4A880A5C"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"EC60BF51-B4DC-4CCA-87BF-8E5841427EB3","fragment":"EC60BF51-B4DC-4CCA-87BF-8E5841427EB3"},{"uuid":"298869F0-3864-4CF0-9DA3-5ECFF7943911","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3F487305-6580-4AE0-A90D-C8119AA35F3C","f1_mode":"A380977F-03AD-43C1-9EFE-C491AC980B06","f1_shininess":"E6A1F08D-198C-46F2-A663-6CEC8A6C125B","f1_specular":"39256C2A-7809-4ECD-8BFF-5C22464A53CC"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CC3E4B88-6FEF-42FC-BE90-824B8B491672","f2_ior":"0A12AC3C-3DF0-4251-B6BE-4C36DE168F08","f2_roughness":"82D6867F-E71A-4404-A485-F7C958D099E1","f2_transmissionSamplerSize":"35EA7633-23C9-4443-A0FE-E460AF3EDC7B","f2_transmissionSamplerMap":"723395A2-D6B2-48B2-80C5-DCD062C532D3","f2_transmissionDepthMap":"8CF9434C-C596-4027-BDB1-D1F450B7607B","f2_aspectRatio":"34DBCB9C-2758-4FF3-A327-52DD6C8A9518","f2_alpha":"5F3482F5-65B9-425F-A00D-C15A52F386AC","f2_mode":"75DE7037-EC25-442A-88FA-4839994C075E"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"F6ACB7E3-D049-476A-92AD-4F402383F7BB","f4_far":"908DC933-87FF-474B-B252-722140EA884A","f4_isVector":"9BB92CA6-209C-42FC-ACBA-100CAB2BB825","f4_isWorldSpace":"3BF199B7-C006-4AF2-862E-1246C5F77556","f4_origin":"67A8A423-119C-487C-AC7B-3D89B6F663AE","f4_colorA":"3E0C1E38-1227-4B1F-8530-F325FB2A0047","f4_colorB":"6DE3E1D5-C660-4FF1-AD63-88F3A357F0D0","f4_alpha":"0BE8A226-5022-4ADE-9B07-CD7586FAEAE8","f4_mode":"28DA6F89-A15B-46B0-88A0-A41DA9106BF8"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7DA17B94-3724-4D3E-B1CC-E4F3215253DC","f3_bias":"B73C9E73-0B4F-4D2A-8527-CDDA47A24BD3","f3_scale":"1A12C604-FBDE-45AA-8A56-FEABB149FAD8","f3_intensity":"1AA0957E-57A9-470D-87AF-22B7FC24A7C4","f3_factor":"EF974B84-BC2A-461E-BF79-85256F9FD483","f3_alpha":"5B7FD70B-C39A-46EA-B36B-511880697332","f3_mode":"CDFE9C4C-B7F5-44A2-9A06-A8A35BB74BAF"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"7EC4FC3C-9471-4A4A-8033-0FF696BC98F7","fragment":"7EC4FC3C-9471-4A4A-8033-0FF696BC98F7"},{"uuid":"A6865393-71CF-4EC4-A665-89E47A60981D","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4612AD7B-2800-45A7-AFD4-758BB63793F7","f1_mode":"8AB330B9-39FE-4F52-A6F2-A7F84E65680D","f1_shininess":"CAAE641B-3C01-4F8E-AD7A-8BA2D8D0E640","f1_specular":"1107846A-D31B-41C0-904C-19E2A3A153F0"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"D8B992FE-BA3A-4F53-8974-1AE8BC291865","f2_ior":"40EEB7AD-E8F1-423C-AEEF-0246F19F0A82","f2_roughness":"0C9B9142-1C4A-42CE-BFFF-DF33A90EE1A9","f2_transmissionSamplerSize":"FA48DEE7-2444-465C-894F-505F7962973F","f2_transmissionSamplerMap":"6830B554-59A1-47C6-9911-925F653643AB","f2_transmissionDepthMap":"75D0AEC9-A58A-47F1-BEA9-B5A7346BC9CC","f2_aspectRatio":"4C04B78E-BFB6-4FE4-A46B-BCB89BA30E92","f2_alpha":"D2E4F243-1872-45DD-99B8-51923C8FDED1","f2_mode":"1DD2849D-B282-49DB-9F60-22697AA50F22"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"A2786018-EAC6-4D2C-B7F6-D16850F01E6C","f4_far":"3A0F5399-5F77-4A5A-8A4D-BA26E38E110E","f4_isVector":"A9668A7D-D801-499F-B154-659A9107AFCD","f4_isWorldSpace":"0D27C4D0-E0E2-496D-92AE-8BD4B9335264","f4_origin":"E0D2B7C0-A5FB-4C77-A10B-FC07390F5AED","f4_colorA":"590291C7-C581-46C9-9217-D8A7958DADA4","f4_colorB":"7000543B-DDF0-45F0-9B56-8CC5E4502747","f4_alpha":"762DD639-0F78-4379-964F-57EB1183951A","f4_mode":"9EEBF53E-BD49-43FB-A3B6-AD97CC2AC80A"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"BB11845B-A65D-4767-AAE6-AD09693990DB","f3_bias":"D87A99BE-49A1-45C0-AEB7-2AE9916535E0","f3_scale":"8FCCC74E-EBA7-485B-BDD7-DE8AD66E5ABA","f3_intensity":"3F0DA090-F79E-4556-AD24-6CF1834AD9E5","f3_factor":"9E58385B-E5C6-4CCD-B0FA-14AEC2AED802","f3_alpha":"82AE3CED-B94F-4933-B670-B4858BB8C0F0","f3_mode":"A5286526-EB84-41A0-86B8-68851298532C"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"D3FB76D1-ED48-4D0C-A8E4-74C92C48C6D3","fragment":"D3FB76D1-ED48-4D0C-A8E4-74C92C48C6D3"},{"uuid":"DDE050FB-D7AF-4964-815D-723FF52D7421","type":"ShaderMaterial","emissiveIntensity":{"uuid":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"3DE9025A-F4A2-4255-8692-9A0C787AC465","f0_alpha":"FE99FC96-F065-460B-9736-EED15047D172","f0_mode":"C84A9DAB-06C9-4D09-97BD-7D2E5260C30E"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3119DB25-A452-486F-AE8C-2F1D54FA6458","f1_mode":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","f1_emissive":"00120391-5F87-4631-8249-D061FFF278D0"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"D97D625D-505D-4C25-8BB8-055E8A3589BE","f2_bias":"62B9E251-BA17-4132-B9D4-123F37917491","f2_scale":"0D3A21A9-E6A1-45CB-9016-7E2AC11B9D01","f2_intensity":"A333B9F9-7697-4043-BA64-13C7306E619C","f2_factor":"1CDDF7D5-4A7D-4AEC-9007-4FB10590955F","f2_alpha":"A8365ABA-D199-480D-B588-7FACFADC9FDC","f2_mode":"DB94751D-374B-4C5D-8C01-20E622A24FAA"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"4764F644-0523-437C-A906-6A4C6EA43507","fragment":"4764F644-0523-437C-A906-6A4C6EA43507"},{"uuid":"60979C37-7BAB-42F1-A703-55559BDFFD69","type":"ShaderMaterial","emissiveIntensity":{"uuid":"F304A8E1-0424-4CF8-922F-FEF048A0652C","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"A85E799E-1A58-4147-8BBE-89DF75C289A2","f0_alpha":"C5F2CC1F-7EED-4802-AA29-58E8982E28A6","f0_mode":"CB7A3BE3-5AD2-4A5C-99DA-32D2AE950E59"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8881BE93-8CA2-4F57-81D2-9EE56223B303","f1_mode":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","f1_emissive":"169F2E98-A4F4-4BB5-BC39-EBB3A42E0D54"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"667A02D4-E159-4B71-A38E-1C97022D2C67","f2_bias":"EA310805-34B6-4978-B1BE-7E05705FDE56","f2_scale":"F8FBA7DD-764F-4930-9B05-374049F95CD5","f2_intensity":"8141A755-18C4-498C-8309-2A78A7B7DA27","f2_factor":"6DA23769-CA9C-482B-B9F3-78BFDE7EA8FB","f2_alpha":"F70B9CB8-568E-4868-9529-CB3A54DAEF78","f2_mode":"79DAC97E-6EAC-4A31-9195-D0E69C59C819"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"A141BD81-5415-435E-9447-4B35842D83A9","fragment":"A141BD81-5415-435E-9447-4B35842D83A9"},{"uuid":"2BDBA13F-DCF7-4ECE-9677-5E3A80A404B4","type":"ShaderMaterial","emissiveIntensity":{"uuid":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D3D6ADC9-9E59-4E91-95F2-1912A5E01DD0","f0_alpha":"CED54D25-E4EB-4C07-8BF8-D307DCE508EE","f0_mode":"5938297F-1629-45E5-A2B3-4E2B03D614CC"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","f1_mode":"28318C5D-2966-4269-A1FB-4CE52FB1701B","f1_emissive":"D4685A39-A2BB-4D2C-916D-13DCFE5F400F"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"18E4D7DF-D907-403D-A080-F5D2B54BDE35","f2_bias":"124B676E-EC54-422D-8973-92867EB72914","f2_scale":"6B1865A7-7A63-490E-8528-91CBB70C8199","f2_intensity":"B79AF409-A5F2-4CC3-8331-A94823E6E899","f2_factor":"DA5623BC-F38C-425F-97CF-16281D8BD0F8","f2_alpha":"459F0072-00C9-4A0A-B252-906151EA7E61","f2_mode":"44CD23FF-91BD-4556-9CED-CA27D121BB99"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9","fragment":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9"},{"uuid":"4C819118-BF8D-42FA-B94D-C57FCDDEE7E2","type":"ShaderMaterial","emissiveIntensity":{"uuid":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"AB95BE10-A7F7-4F4D-A457-2EEF524EF18B","f0_alpha":"53F8CE4E-E285-4A34-BCEE-BE44911E99ED","f0_mode":"B6B3EC91-055E-4717-8F68-CAEE97DFB135"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","f1_mode":"968D04D9-56E9-40C6-90BD-CB97017364D0","f1_emissive":"BC5AA259-1C04-4E2C-805A-E9756F121961"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"E47AB666-AA6A-4952-A983-66817CD1CB6D","f2_bias":"F610D497-5C33-4854-9227-834A2A9F708B","f2_scale":"E752A7B5-96D7-4EF5-9BB1-CCEE1D2C5615","f2_intensity":"3CD42DE5-2700-44E4-9F46-F20EDB728484","f2_factor":"E39A75F8-0990-4878-90C0-ACE8DBA691FE","f2_alpha":"B126824E-8574-4FF3-B4BC-A1877E729E4B","f2_mode":"C9179628-BA27-4BBE-BF0D-E40934B3AB2D"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"4F33245C-5397-42B0-A855-0E78CCD99A46","fragment":"4F33245C-5397-42B0-A855-0E78CCD99A46"},{"uuid":"92E547A8-0637-4821-A5E8-5BBB5436DDB0","type":"ShaderMaterial","reflectivity":{"uuid":"4E1BEDFD-839D-4E49-802F-7A34568E9856","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"1E6FC46E-9F25-4D10-ADB4-A808EF6B7854","f0_alpha":"175E9E56-2DC0-4814-B24C-B33B89F4BF6A","f0_mode":"5AE13ADB-8773-40A4-A983-BECA5A1FA5C3"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"045DD1F7-FA16-449E-A371-2CBB62835D94","f1_mode":"977B51E3-7455-44CD-861C-D24D89910145","f1_roughness":"1EA8D444-06B3-4061-9E7A-814A69D0BD1F","f1_metalness":"AB8EC200-48DD-49BB-A965-DD2FC2E18175","f1_reflectivity":"4E1BEDFD-839D-4E49-802F-7A34568E9856"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"B596CBF4-47E7-421C-96DE-33A33D478021","fragment":"B596CBF4-47E7-421C-96DE-33A33D478021"},{"uuid":"B7EDF099-C6B7-4517-BD0E-DBB10F291721","type":"ShaderMaterial","reflectivity":{"uuid":"18A21C95-97FF-4B2C-85D6-FCBA3187F80E","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"ACBCDA34-C358-4039-B223-BED488CC85A9","f0_alpha":"7CCB88C3-9400-4C20-999C-8CCE6845C95A","f0_mode":"0E682B5F-40F4-44E5-8164-FBDBC2ABE0DF"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3C33CA56-64F4-4583-B345-616CB24E8DB6","f1_mode":"6A49786F-8CCB-401F-B44D-92AA4C228293","f1_roughness":"339CA49D-4641-49C2-A85C-762B67E6F6DD","f1_metalness":"DC41BF18-9CE7-4A0B-B0F5-DDEB25297D72","f1_reflectivity":"18A21C95-97FF-4B2C-85D6-FCBA3187F80E"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"92EC580A-350F-4E4F-B288-DD7C442F6F91","fragment":"92EC580A-350F-4E4F-B288-DD7C442F6F91"},{"uuid":"8B34B827-2EE3-47C7-9E4F-012F97EA0F04","type":"ShaderMaterial","reflectivity":{"uuid":"C66E4BEA-CDF0-4577-9246-B7D43BF0A2BD","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"5024DF11-917B-4884-8065-D37522F9F160","f0_alpha":"CC5C1C73-B573-47C8-A7EE-B4EFDE399AC8","f0_mode":"F3324909-40C2-4AEA-988B-B96F1BE96308"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7BF8E781-74D6-4FAB-96BE-D5412B149CFC","f1_mode":"DCE284D3-3CB0-4031-9689-8329EE17C8EF","f1_roughness":"329BC257-1FEF-48FD-AC4C-AC9C9A9DBEAC","f1_metalness":"4D4CB616-41FB-471A-BC3C-2D722517B5FB","f1_reflectivity":"C66E4BEA-CDF0-4577-9246-B7D43BF0A2BD"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"D393F0AC-F9F4-4B89-829B-BB848A78CC48","fragment":"D393F0AC-F9F4-4B89-829B-BB848A78CC48"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"274385EE-94F2-4E5B-B7B9-E40E6720FB66","name":"Base State","position":[-167.0000000000001,23.996523342699845,-8.308763260530334],"rotation":[-0.34906585039886606,0,0,"XYZ"],"scale":[1,0.9999999999999996,0.9999999999999996],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"C49BDF8A-86ED-4E2F-AC93-1253180D5EF0","name":"State 1","position":[-167.0000000000001,23.996523342699845,-8.308763260530334],"rotation":[-0.34906585039886634,0.26179938779914946,7.183671577107885e-18,"XYZ"],"scale":[0.9999999999999994,0.9999999999999991,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"5C9683A9-D4DC-43A5-96D9-09C7FDD3B89C","name":"Base State","position":[-5.596745068776386,-185.5984449064932,83.90449870945913],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6AE4CBE7-CDE7-4C33-8435-8076BE490A9A","f1_mode":"CD80868B-5247-49B8-AF27-BFAB5B16073E","f1_shininess":"D0B1157D-8942-4207-A680-9569B56CCF34","f1_specular":"62B4C66C-4DBF-43FF-9D72-AAFC47E18EA7"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"52747972-5D49-447A-83D9-B9CA03560DB2","f2_ior":"A05A8728-DA67-4E77-B967-AB838BDF8231","f2_roughness":"FD60DACC-8453-493F-9E90-2EBC3D35EE1D","f2_transmissionSamplerSize":"224FDF30-592A-4E01-8BF2-A95490C2151D","f2_aspectRatio":"F933A4B4-F793-4152-AE28-A39126839D50","f2_alpha":"84093003-55A4-4F78-9067-04B3F3D39E31","f2_mode":"11648B8B-2711-4229-BB0A-B6BFE1C604E7"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C5EE7A3A-69A6-4CE8-BC3E-D7ECF61CC77F","f4_far":"C81692F7-8B3D-484E-9FD2-34F6CF798D5F","f4_isVector":"91594261-AF90-4466-BA2F-08DA82F865FD","f4_isWorldSpace":"43AB7885-8836-4B3C-AD00-9E4469B262CC","f4_origin":"1DED4606-3BE0-42D4-BA7A-82EFFDADF6C4","f4_colorA":"3120E833-2229-4566-894A-28112427FCE5","f4_colorB":"A4FA7DA6-1F4B-4ACC-9937-1CC744884029","f4_alpha":"F2956417-2D14-4028-B4D0-C1250D82F40B","f4_mode":"9093ABE6-E681-4F1E-8E68-1D9F4E8BE726"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"2677712A-11B4-4B04-B364-B017DDC7B9FC","f3_bias":"6585EA59-B28C-4CFC-95D3-9A6F16357418","f3_scale":"2C6C8961-906D-49B1-A183-05405447C85B","f3_intensity":"C79BA6FF-AF7B-4773-A476-43DE55250A07","f3_factor":"BAC0EF84-FF91-4F83-ABAC-B93232AB3528","f3_alpha":"914A9C53-7000-4B43-AF4C-A807D46ACF2E","f3_mode":"F605F2D2-A7E0-4CA8-850C-3F380AA22495"}}]}},{"uuid":"1B6C8C26-65A8-4B6E-B5FF-82935CF624D3","name":"State 1","position":[-5.596745068776386,-185.5984449064932,83.90449870945913],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1EF79D22-6A89-4A02-9F28-870F2BEF0A9B","f1_mode":"801A0FD4-FCA8-4131-8FA9-616D02B49A5D","f1_shininess":"A7FFF2E4-7160-4480-AB80-645175A1206A","f1_specular":"E5C577C8-E5BF-4950-A91C-172A84AB64AF"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"43957027-FD36-48F7-840D-CD727881FE39","f2_ior":"EAEDF2BE-6B80-4FB1-96EE-93041B457438","f2_roughness":"0BD4EA3A-8ACF-46C7-A356-83EF197A6624","f2_transmissionSamplerSize":"87F31108-9F45-4CFC-9C2F-E85A50AD930E","f2_aspectRatio":"C6261E37-F21E-4240-9AED-D89ADCBC68B4","f2_alpha":"D20136C7-8C45-44B5-9DBB-9EBD96642543","f2_mode":"8A85313B-B310-4321-9C0C-B8348B5527D3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"805DBB27-4A3F-4751-883A-6A32059DD7E0","f4_far":"3CCDF74C-039B-492D-A361-789306D59F3D","f4_isVector":"7D493910-D652-4446-9EA1-87D93E0EE280","f4_isWorldSpace":"1BCD21D7-6650-4B64-93B5-533A63F0C66C","f4_origin":"6E72F761-6DAE-453B-997D-4CF7CB854F29","f4_colorA":"527D5177-8940-441A-8339-E7EFDB0A7A9B","f4_colorB":"FF1EE8F4-9F34-4E20-8AB0-77F168A6CDE5","f4_alpha":"9402855E-401E-4B9B-ACB1-3573BF16BD88","f4_mode":"A7689FAF-35CB-40BD-A2BE-8DB4ECA25D84"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"54BA9A1A-E77F-426D-BAB8-F06AFC34B479","f3_bias":"E42BA2E1-8A42-45DD-ABB6-E169BBCE7BEA","f3_scale":"6E59CA34-43D2-4CFC-963C-8F83391D63E2","f3_intensity":"DD75078F-84C5-48AF-BF46-FF408D9621A8","f3_factor":"8A1074AD-6B31-47B3-9E35-1C9110ABCFAA","f3_alpha":"08E0503F-6736-41A1-BD21-2560F5892A3B","f3_mode":"B6726F00-66F9-4788-9E31-F8671AD70C62"}}]}},{"uuid":"8A11AB09-4F67-4162-B9E8-8036F48D03AE","name":"Base State","position":[192.69534235511117,-144.12250620252024,-60.08034172670993],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"geometry":{"width":150,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DEA20FD9-F801-4FED-B94E-44689C497C4B","f1_mode":"D306E94A-A21E-4350-AAF5-34EFBBE7D962","f1_shininess":"9B62E4BA-35C5-4E7C-BAB6-A8BBA2734316","f1_specular":"300641B5-477D-4100-84E3-DD174ADC5C32"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F40D28DF-EB43-4918-9839-696B1F484D7C","f2_ior":"E77ED164-FDF1-4EE7-B9F0-DE9F1AE89875","f2_roughness":"499C59CF-B4BE-40E0-8FD4-23673844DC9B","f2_transmissionSamplerSize":"1956D8F1-D4FF-4480-903E-6C19AA806ACC","f2_aspectRatio":"D5D413BE-3181-4DEB-B9F1-19E8955533C8","f2_alpha":"F906DA5C-898C-48D1-84CD-6D2FCC720A98","f2_mode":"80E0CCF7-EE95-4B98-A920-BB7A905C7CAA"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"6D99D767-7649-4C76-9C4A-983FDA6B3BA4","f4_far":"5C80CFB5-6B67-47A7-A5A3-3CC19905C5AB","f4_isVector":"F4D6C210-CB99-455E-90C7-FEE69E097C77","f4_isWorldSpace":"8227F350-7D00-4B19-8776-736A8D46F535","f4_origin":"994A6D13-847D-4AE4-B711-C30CE780129B","f4_colorA":"E3F8B5E5-D118-4816-821A-0C92DD1402EB","f4_colorB":"D10FDE91-555F-4ED1-8195-11A1E76C5503","f4_alpha":"E0D8732A-6D05-41D9-96E5-C338D95CFD8C","f4_mode":"E3592646-BA0D-4617-864C-FA124672D526"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"AA7CAD61-61F9-4BF6-9672-40DCD14758C3","f3_bias":"CDA922F8-6C0B-418D-B9D0-F929302DE13C","f3_scale":"277CB306-FD43-4FC5-83B3-1F42B832BCDB","f3_intensity":"A5F0ECCA-EF89-4CE9-BE6C-E63C55C4A3FE","f3_factor":"4BE3FD67-53DC-4DB3-8FA1-0E33558FC52A","f3_alpha":"8CC8855F-F647-438E-BD7D-6E0F7AEE25BC","f3_mode":"496A5096-1AE3-4AA7-9AF6-227C6CEDB46D"}}]}},{"uuid":"20503FE1-3E52-4A9D-9029-14B457E9A782","name":"State 1","position":[192.69534235511117,-144.12250620252024,-60.08034172670993],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"geometry":{"width":150,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"47F582B5-601D-4868-8AA5-2618DF725C1F","f1_mode":"2CB0FF11-D94C-4962-9BCC-181E4FEC7254","f1_shininess":"70E985F2-4A4C-4383-8EB8-6D16AAF72640","f1_specular":"0FC2575E-63C8-492F-A430-F2038B7CD669"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"653F6CD9-FCE9-404E-B3BF-BF6EB47764FA","f2_ior":"829A70D5-C0A2-4C4F-8B70-D6BFDD413A1E","f2_roughness":"A61E6DF2-1D05-4C63-B10C-1BA82E45F35C","f2_transmissionSamplerSize":"B2653667-05B7-4743-8A9D-EFA19CE7DD2C","f2_aspectRatio":"F16005F4-C368-4DBA-9146-C567EC4448AB","f2_alpha":"37F58150-98EE-4EB7-B29C-03FEBEBFDC96","f2_mode":"44EC8B4A-E822-49A8-AC14-E5941C318FB2"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C7989A45-16E6-46FC-A134-1FE830E4CC0C","f4_far":"5D2A34CA-D014-45AE-BBFA-A8398F934950","f4_isVector":"889B53AD-859D-4A3F-A426-71A0B2930546","f4_isWorldSpace":"53C5514C-F978-4876-ADB0-7D0C33830BE3","f4_origin":"8065FB2F-A54B-4C1E-AA61-47E4B8211C26","f4_colorA":"2F499C55-4ED6-4354-B93E-4B7CEC841E5E","f4_colorB":"00A8D422-CC1C-4D1A-A63D-ADCB12D50A58","f4_alpha":"11FE959A-5EEC-43ED-AE9E-2D404A37BD08","f4_mode":"2614CF5B-6952-4367-B86B-F3C0602EDD97"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"AFF6EF00-93A4-46DD-A23F-E74CC0934771","f3_bias":"CFC8465A-D78B-49C7-B8AB-5201248E76D4","f3_scale":"F9DBCA29-A5EB-402F-B0BA-2E1EEADA1F44","f3_intensity":"C0F803A7-C582-4F08-ABCB-BE3A0B55ABB4","f3_factor":"991014C3-172E-417C-9D5B-A9314B667268","f3_alpha":"A2FAE408-4605-43C3-BDF3-5735871663B2","f3_mode":"2D46CF91-9A47-45EE-B1E6-312737C57455"}}]}},{"uuid":"902FF276-7544-4C91-95D2-D1ADECC18ECA","name":"Base State","position":[360.1446709076129,-247.13774958036134,-119.86555037509562],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"023ED60E-251A-49AC-BD66-9EDD85301033","f1_mode":"00EA104B-3CD7-4D92-B001-352180F4BAF3","f1_shininess":"B8EBF80E-5E16-41D2-9642-4997E472A937","f1_specular":"1898B8AC-439F-4139-B65F-C76E50FA737F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CC89C9F7-2E8C-4D9F-8FB0-1D0F8044B2D0","f2_ior":"7A090862-CB58-42D4-BDE8-DDE925C2F22F","f2_roughness":"93BEF98F-B2E4-4EF9-99CB-AD9A1E72B46C","f2_transmissionSamplerSize":"F8FE858A-FBA7-4D1B-9CAD-4A3F7257329D","f2_aspectRatio":"A29FF373-3F5C-43CE-8375-F17C31E235AB","f2_alpha":"4B64CCF1-DB62-4737-9023-6F0E43CD019B","f2_mode":"39DABA89-26EB-4881-BFB8-6257527B147F"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"ED64B85E-9F6C-416E-94AA-6B3A75A6376F","f4_far":"4ED7CAF2-A1A0-47CC-BCCA-5D20D2209085","f4_isVector":"9CE86CEB-594C-4642-99C8-188416B430CD","f4_isWorldSpace":"9E1FA986-D4A0-4A21-A569-6F74388EC349","f4_origin":"FA768F40-BA6D-44D4-B996-60E9488B3399","f4_colorA":"B7D2922B-2A6A-44A7-A157-105CEA4ABB8E","f4_colorB":"F22590EA-8A3A-4189-B969-D7BED76C6B5C","f4_alpha":"81335222-1355-42F4-B751-792A089AE0DA","f4_mode":"A1EF5C20-5907-4B56-845D-92F4B786A2FE"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"94EBACC0-65D1-438C-BFC9-8F93670ED22C","f3_bias":"940A21F5-7DCF-4067-A85E-D6C66FFA0C96","f3_scale":"4BD9C4F6-7CF8-4C5E-849A-40AA734CF8CE","f3_intensity":"3A5151F9-BCA4-4F69-BA74-CAED26364497","f3_factor":"BA3B16A7-E815-4BC4-A910-9F762CC65FA4","f3_alpha":"02415A53-4E3E-40D0-A7A2-3AD073747939","f3_mode":"C6E6D88A-67EA-4287-993A-8501B179F95E"}}]}},{"uuid":"C78E1C9F-CF2E-487C-ACD0-37B561D99A79","name":"State 1","position":[360.1446709076129,-247.13774958036134,-119.86555037509562],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BC193881-EB20-4BAA-A2ED-8B9A673BB284","f1_mode":"EF3CF469-5132-41C4-A687-BB3E47EFBE5E","f1_shininess":"49A3EAC4-938F-4050-A765-6467B40E1E6D","f1_specular":"F1CE4D73-AC35-47C8-8E74-169C74A27D6E"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6EC5E245-E778-485F-8F74-855D64F26A30","f2_ior":"4F11C2C5-C371-4B14-BAFB-9F0CBD66DD47","f2_roughness":"9D51D732-D543-4162-8EDE-7817650FACC6","f2_transmissionSamplerSize":"2D389BC6-3BA1-449E-B46C-F602A4795A4E","f2_aspectRatio":"F94A4530-3C31-44E0-A8EA-84E48907A5C1","f2_alpha":"75E8B51F-5CC8-45F0-9F50-DAE028425A04","f2_mode":"62A027D5-951C-469A-A952-927BC06D9501"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"739FFDC3-BB83-4D1F-A978-D38820A85887","f4_far":"D40B30E5-9929-48AF-8E7F-6E8D640E5610","f4_isVector":"9853A151-4A36-4464-BF56-6F2A20138CDE","f4_isWorldSpace":"68D64BC0-570B-4FB5-98C6-7A19918B5365","f4_origin":"89223839-66CA-4D6F-985B-D1FA82989BD4","f4_colorA":"C08E1A4E-EE57-466D-9DE0-732D086568C4","f4_colorB":"640DB05B-D80D-4873-BF68-03483E748724","f4_alpha":"E7D9A998-B1CE-45E5-BBB1-B0E31876F90A","f4_mode":"8D6F862F-73D8-4D1C-8C07-D7B5A62CE6FA"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8F04CA08-51B1-4F5B-81CE-F612317C7A51","f3_bias":"077199C7-7273-4D2F-BA5F-E0357904AD26","f3_scale":"974E317B-D4F6-4F39-841D-9C8094591173","f3_intensity":"85CE56B1-6BB5-4477-B998-EF9B2A9B0779","f3_factor":"E13F0112-7368-4952-BE58-D27FC012454D","f3_alpha":"E09304C2-EA4C-4EFA-AF5C-314FB0066EED","f3_mode":"F98AA7DE-C2CF-44D2-95C0-C746773BA42F"}}]}},{"uuid":"12A6232F-B353-428E-8574-C9A22297CEBD","name":"Base State","position":[77.64707881858095,10.251627470154062,-302.8586838226405],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"304B2599-0095-488A-860D-7990C9B3D9FF","f1_mode":"9ACB3FA2-6269-49EC-872B-608A6112FE56","f1_shininess":"F5B487A7-C028-4291-915B-2EDF98E1BE82","f1_specular":"1C0954D3-34B8-4D4B-893E-FCBD8C9F6C30"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8DD5544B-835E-433A-97BB-ACDD66FCB7D4","f2_ior":"75FF32B2-A1A6-4A36-8DD2-32C3B46D5E2F","f2_roughness":"142F0166-5883-47E5-9A79-F42E7007BE73","f2_transmissionSamplerSize":"FFB8F722-3518-494B-8DCB-728E95B33A0F","f2_aspectRatio":"85CCA3C3-388D-4950-8946-84D6B5EA72DC","f2_alpha":"5D043224-5D6D-4C56-B41D-3D88C7BA8CBA","f2_mode":"76537189-FC4A-464D-B51D-203E9B84033E"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"9039BFC8-73F2-43CC-B29D-97BD3B60456F","f4_far":"43D4F7F0-9851-4853-B161-C25B5D3914A7","f4_isVector":"FF61DEFC-05D2-4E59-BD20-D9BA0538E6E0","f4_isWorldSpace":"D6CC6531-E520-43A2-937E-D099D933AEA8","f4_origin":"9BA431F5-EB16-422B-8D79-14587DDF76CD","f4_colorA":"DA26B7F8-E6DA-4446-8800-E2FAE40093CE","f4_colorB":"97847D78-DEF0-45D9-BFD2-30E1CD687F5F","f4_alpha":"13F7E037-5996-4D45-A09E-3E220FD9F1EF","f4_mode":"A865B219-280A-47E2-83BE-7D993E5E0E64"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"9FB8AEB2-2C5C-42C0-8290-B953580608BF","f3_bias":"D1F50204-E1E5-4B4B-8A62-D40AA18A9911","f3_scale":"BD0E4444-7011-4EED-A8C3-6C7D15C2DE9A","f3_intensity":"B4EA03BD-535E-4F0E-A1E1-E163A85943B9","f3_factor":"D9BFB837-340C-4094-A3E9-2872AB825EB0","f3_alpha":"FC83F13C-FDE8-4FF3-A33F-C51E2AAD7578","f3_mode":"4D587140-4DEA-411F-8C35-95F9E7BC9C92"}}]}},{"uuid":"132540F2-699A-4A38-8617-DA6997FDC59A","name":"State 1","position":[77.64707881858095,10.251627470154062,-302.8586838226405],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9D120524-98A5-497A-AE0B-55E939030F0F","f1_mode":"0E322CE1-9B6A-4DA3-B0C4-705A3F854E66","f1_shininess":"0FA76AB4-AB74-4787-A4B0-C1015847472A","f1_specular":"CB4DAECD-860B-4024-A55D-EB5BF37A7B40"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4DFE764F-54D7-43A5-8D60-F1CD280780FC","f2_ior":"26BFA1A2-A329-488C-9A83-27E30B713DE9","f2_roughness":"71DFF4B2-7631-44E0-B446-8C2831973350","f2_transmissionSamplerSize":"BA3906A5-AC0D-4F23-9319-946F0288F04D","f2_aspectRatio":"2639EFB1-48AA-48D8-8C1E-B50FCA2CA0B2","f2_alpha":"ED8BC04B-657F-494B-A1BF-5CB1CC5DDD1C","f2_mode":"F3EEB8D7-A85E-419F-97A2-25037F35155C"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"34098EC5-1E95-4916-B57C-3888A8F51E4A","f4_far":"7FEBE97D-C824-4053-8741-628DF6D7B825","f4_isVector":"FBA93055-6532-4B42-AA25-12C218E6EC8C","f4_isWorldSpace":"82075D8F-744A-4939-B9C6-8E8AFD48B5CC","f4_origin":"43A31AE4-748D-4892-9EBF-D29990608D43","f4_colorA":"547FE970-AA29-4FE6-A221-150704D816E3","f4_colorB":"37CBED7F-7A10-44A1-B039-8F467CDC05D9","f4_alpha":"42B5A43E-4FAD-4740-91E1-DFB749355253","f4_mode":"D1C67A8C-112D-4B56-93C9-9613C99AE43D"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3556E4F2-F6B4-41B4-908E-4E4EF2609B83","f3_bias":"AE46B59A-ABD0-4C4C-8E1F-3D71B0ECA965","f3_scale":"A5F05746-BEB9-40FC-8BB9-935F9BD1976D","f3_intensity":"38F58FAE-43BF-4562-99B6-45E10264CA82","f3_factor":"33767F7A-8A64-41BD-B50C-B1BDDFB8576F","f3_alpha":"E8978A26-5C77-4EE7-BBE7-0B5C3B1A85A6","f3_mode":"2AC83CEF-AB4D-4A9C-8045-97B3890B8EEA"}}]}},{"uuid":"EE82309E-A200-42C9-9462-FF5D6473B526","name":"Base State","position":[14.943446944406745,-32.15740815566272,10.73403219790113],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"1417E43A-9F14-466F-ACA5-ACC389AB8169","f0_alpha":"A133C448-3BE4-4B4F-BC59-8699447ABEF4","f0_mode":"940D82A7-0CB2-4055-A943-230701B03652"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E63F86A6-BA59-4F29-B678-8ED4D8471F11","f1_mode":"AA5CDD90-A344-42D3-BF4E-5663025266B1","f1_roughness":"B2952A0B-050D-4439-B656-F329AFE383C8","f1_metalness":"551DB44B-7ACF-4D3E-BACE-5D4887D30FB2","f1_reflectivity":"01285CFB-3CFC-4F57-BA92-92D148678022"}}]}},{"uuid":"E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7","name":"State 1","position":[14.943446944406745,-32.15740815566272,10.73403219790113],"rotation":[-0.3490658503988662,-0.17453292519943306,0,"XYZ"],"scale":[0.9999999999999997,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"3F9623D3-F790-4E8A-B835-D185962CEC44","f0_alpha":"00722992-4051-493E-8643-1C6F3637C3CA","f0_mode":"0E6066A2-FDB4-4C16-BC73-022AEF445B44"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D6740005-BF55-449E-8CF0-3D9DA715C9D7","f1_mode":"BE757B95-88F1-4886-AD27-ACC433625558","f1_roughness":"F4A47EE6-278C-4CAA-BA94-EB516DE7FD4C","f1_metalness":"0E2A281A-1735-43DA-B548-A8FBA039EFF1","f1_reflectivity":"88020E4E-34B4-48A5-B3BC-B792DDCE5859"}}]}},{"uuid":"F4BDF665-5016-47C9-BA1A-52F1848C4F7A","name":"Base State","position":[14.943446944406745,24.224149091491782,-9.787176401639002],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"CD1798CE-DDD3-4D5B-809D-C515A9BE7E1A","f0_alpha":"451D63C5-C515-4202-A7E0-88942EB7B301","f0_mode":"592C76B8-54D4-4A93-9962-5647D3F2DCBE"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"72AA4BC0-270D-47EA-93B0-5923117E94C0","f1_mode":"1D20ABEC-189E-4B20-9D63-D622D863AFEE","f1_roughness":"44EEDBEE-7C40-443E-83DB-571181759EEF","f1_metalness":"85EC2ABC-2995-4BC7-9BD6-9160C1C543B0","f1_reflectivity":"EA455B25-FA03-4668-9768-2546333D9AB4"}}]}},{"uuid":"78542D85-AC24-42D2-B2B4-474E43CA74BE","name":"State 1","position":[14.943446944406745,24.224149091491782,-9.787176401639002],"rotation":[-0.3490658503988662,-0.17453292519943303,0,"XYZ"],"scale":[0.9999999999999998,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"CFB6F49A-732C-4617-A670-31BE4546478B","f0_alpha":"BDB5B109-48F2-41E2-A517-2F5987158878","f0_mode":"3153A8B8-FF61-41C0-B0BF-7BE0180F94AC"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F8FA8C30-4572-4DBF-80D2-5FAFBEC5A5CF","f1_mode":"87430EA3-FFE0-4213-AA8B-31053F94FA09","f1_roughness":"900374C4-1949-4241-AEA3-0612DEE0773C","f1_metalness":"52510887-4A84-449E-8648-695A87479907","f1_reflectivity":"688F22E9-E80B-451A-BC9B-A10D65934AA4"}}]}},{"uuid":"63E0609F-DDBF-490F-B465-574A2C4AAB53","name":"Base State","position":[14.943446944406745,80.60570633864633,-30.308385001179136],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"007464D7-373E-434A-BD37-C923F6935592","f0_alpha":"3C72490D-DE47-484C-B20F-F2F80494A2B6","f0_mode":"B26E6517-9847-486D-B9F6-73464FD2070C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"CB2CD82F-5669-4F88-948F-1D4D58A6A9E9","f1_mode":"CB8F6541-57E3-4003-8398-B923172BE8AC","f1_roughness":"B7F209D3-0207-4AFE-A14F-70BC506B9BEA","f1_metalness":"11C3B2DF-DFDC-4D5A-B297-7F7CC25E9B47","f1_reflectivity":"C2477DDA-B0DB-4E45-9035-4737BC3D96AC"}}]}},{"uuid":"8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B","name":"State 1","position":[14.943446944406745,80.60570633864633,-30.308385001179136],"rotation":[-0.3490658503988661,-0.17453292519943303,3.522968763539584e-18,"XYZ"],"scale":[0.9999999999999997,0.9999999999999999,0.9999999999999993],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"F3452C62-ED3F-4638-A771-098E53A5C71F","f0_alpha":"1A0CB83A-DF65-4119-94BD-72C904DFBC52","f0_mode":"DF96C0EB-2409-442B-9D38-D1CF736F935E"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"93EE6DDB-FEA9-4D7A-A018-9BB15F921E17","f1_mode":"E8DF9EDB-94A2-4A86-A02C-2F6D196B7167","f1_roughness":"7693D1B1-C2E4-49B7-A3C9-5AF4FF695DBC","f1_metalness":"A6FC7B1B-D117-464E-9798-5539CEE04410","f1_reflectivity":"56DB8E82-3ABD-440F-B0B3-1655A19A690A"}}]}}],"nodes":[{"uuid":"6EC91AFA-CA1B-4D25-BCF0-1081967A6BEF","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"1217EEE7-4DFD-43AF-ACDB-BCFE93B0DA18","nodeType":"Color"},{"uuid":"1217EEE7-4DFD-43AF-ACDB-BCFE93B0DA18","type":"f","value":1,"nodeType":"Float"},{"uuid":"B8DF150E-216D-40C9-ABEA-05F1EBB1BECD","type":"i","value":0,"nodeType":"Int"},{"uuid":"9F6AEEB9-3E46-4644-8D76-3AFA66B39B0D","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F9E58E8-7590-40DE-9E64-025982AB5A4E","type":"i","value":0,"nodeType":"Int"},{"uuid":"C3AFA940-F750-43A4-A7A9-B2702502ECC7","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"0B619F32-9B53-4638-8E46-AB6DFFDD2955","type":"f","value":0,"nodeType":"Float"},{"uuid":"0509D1BB-31F8-49F7-AAB6-3D19E6058D1D","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A1136208-6028-4F13-B4F4-4D41F7BE9829","type":"standard","color":"6EC91AFA-CA1B-4D25-BCF0-1081967A6BEF","roughness":"C3AFA940-F750-43A4-A7A9-B2702502ECC7","metalness":"0B619F32-9B53-4638-8E46-AB6DFFDD2955","alpha":"FC549B66-C32F-40E6-A658-BD935B701858","reflectivity":"0509D1BB-31F8-49F7-AAB6-3D19E6058D1D","shadingAlpha":"9F6AEEB9-3E46-4644-8D76-3AFA66B39B0D","shadingBlend":"3F9E58E8-7590-40DE-9E64-025982AB5A4E","nodeType":"Standard"},{"uuid":"FC549B66-C32F-40E6-A658-BD935B701858","type":"f","value":1,"nodeType":"Float"},{"uuid":"8F40CBD0-E09F-4F9F-978C-9A648A0AA0BE","type":"c","r":0,"g":0,"b":0,"value":0,"alpha":"2F413242-0FCB-477B-9F1F-43A9466A96F1","nodeType":"Color"},{"uuid":"2F413242-0FCB-477B-9F1F-43A9466A96F1","type":"f","value":1,"nodeType":"Float"},{"uuid":"148F9274-297A-4C7E-9A77-5CC70E89453E","type":"i","value":0,"nodeType":"Int"},{"uuid":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","type":"f","value":1,"nodeType":"Float"},{"uuid":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","type":"i","value":0,"nodeType":"Int"},{"uuid":"F3F69A87-7E4E-4E23-AA33-0171E4A68A20","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A","type":"lambert","color":"8F40CBD0-E09F-4F9F-978C-9A648A0AA0BE","emissiveIntensity":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","shadingAlpha":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","shadingBlend":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","alpha":"9F36CED9-7E48-493D-8A5A-7FA182BED9DD","emissive":"F3F69A87-7E4E-4E23-AA33-0171E4A68A20","nodeType":"Lambert"},{"uuid":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F36CED9-7E48-493D-8A5A-7FA182BED9DD","type":"f","value":1,"nodeType":"Float"},{"uuid":"E9AD9052-8703-4C9C-BD9B-E251D2F7B024","type":"c","r":0,"g":0,"b":0,"value":0,"alpha":"15C07F7E-5092-4E72-A60A-A33F8EB8AF0A","nodeType":"Color"},{"uuid":"15C07F7E-5092-4E72-A60A-A33F8EB8AF0A","type":"f","value":1,"nodeType":"Float"},{"uuid":"0154A9D5-ADBA-433A-ADF3-3B79BC35029D","type":"i","value":0,"nodeType":"Int"},{"uuid":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","type":"f","value":1,"nodeType":"Float"},{"uuid":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","type":"i","value":0,"nodeType":"Int"},{"uuid":"D4EE5AD2-0B58-4486-BA0C-C069E4C44A9D","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7","type":"lambert","color":"E9AD9052-8703-4C9C-BD9B-E251D2F7B024","emissiveIntensity":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","shadingAlpha":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","shadingBlend":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","alpha":"6DD4C88E-9E92-4E61-AB58-75B972F7FA61","emissive":"D4EE5AD2-0B58-4486-BA0C-C069E4C44A9D","nodeType":"Lambert"},{"uuid":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","type":"f","value":1,"nodeType":"Float"},{"uuid":"6DD4C88E-9E92-4E61-AB58-75B972F7FA61","type":"f","value":1,"nodeType":"Float"},{"uuid":"6AE4CBE7-CDE7-4C33-8435-8076BE490A9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD80868B-5247-49B8-AF27-BFAB5B16073E","type":"i","value":0,"nodeType":"Int"},{"uuid":"D0B1157D-8942-4207-A680-9569B56CCF34","type":"f","value":30,"nodeType":"Float"},{"uuid":"62B4C66C-4DBF-43FF-9D72-AAFC47E18EA7","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"52747972-5D49-447A-83D9-B9CA03560DB2","type":"f","value":10,"nodeType":"Float"},{"uuid":"A05A8728-DA67-4E77-B967-AB838BDF8231","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"FD60DACC-8453-493F-9E90-2EBC3D35EE1D","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"224FDF30-592A-4E01-8BF2-A95490C2151D","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F933A4B4-F793-4152-AE28-A39126839D50","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"84093003-55A4-4F78-9067-04B3F3D39E31","type":"f","value":1,"nodeType":"Float"},{"uuid":"11648B8B-2711-4229-BB0A-B6BFE1C604E7","type":"i","value":0,"nodeType":"Int"},{"uuid":"C5EE7A3A-69A6-4CE8-BC3E-D7ECF61CC77F","type":"f","value":50,"nodeType":"Float"},{"uuid":"C81692F7-8B3D-484E-9FD2-34F6CF798D5F","type":"f","value":118,"nodeType":"Float"},{"uuid":"91594261-AF90-4466-BA2F-08DA82F865FD","type":"f","value":1,"nodeType":"Float"},{"uuid":"43AB7885-8836-4B3C-AD00-9E4469B262CC","type":"f","value":0,"nodeType":"Float"},{"uuid":"1DED4606-3BE0-42D4-BA7A-82EFFDADF6C4","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3120E833-2229-4566-894A-28112427FCE5","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A4FA7DA6-1F4B-4ACC-9937-1CC744884029","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"F2956417-2D14-4028-B4D0-C1250D82F40B","type":"f","value":1,"nodeType":"Float"},{"uuid":"9093ABE6-E681-4F1E-8E68-1D9F4E8BE726","type":"i","value":2,"nodeType":"Int"},{"uuid":"2677712A-11B4-4B04-B364-B017DDC7B9FC","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6585EA59-B28C-4CFC-95D3-9A6F16357418","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2C6C8961-906D-49B1-A183-05405447C85B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C79BA6FF-AF7B-4773-A476-43DE55250A07","type":"f","value":2,"nodeType":"Float"},{"uuid":"BAC0EF84-FF91-4F83-ABAC-B93232AB3528","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"914A9C53-7000-4B43-AF4C-A807D46ACF2E","type":"f","value":1,"nodeType":"Float"},{"uuid":"F605F2D2-A7E0-4CA8-850C-3F380AA22495","type":"i","value":2,"nodeType":"Int"},{"uuid":"1EF79D22-6A89-4A02-9F28-870F2BEF0A9B","type":"f","value":1,"nodeType":"Float"},{"uuid":"801A0FD4-FCA8-4131-8FA9-616D02B49A5D","type":"i","value":0,"nodeType":"Int"},{"uuid":"A7FFF2E4-7160-4480-AB80-645175A1206A","type":"f","value":30,"nodeType":"Float"},{"uuid":"E5C577C8-E5BF-4950-A91C-172A84AB64AF","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"43957027-FD36-48F7-840D-CD727881FE39","type":"f","value":10,"nodeType":"Float"},{"uuid":"EAEDF2BE-6B80-4FB1-96EE-93041B457438","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0BD4EA3A-8ACF-46C7-A356-83EF197A6624","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"87F31108-9F45-4CFC-9C2F-E85A50AD930E","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"C6261E37-F21E-4240-9AED-D89ADCBC68B4","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"D20136C7-8C45-44B5-9DBB-9EBD96642543","type":"f","value":1,"nodeType":"Float"},{"uuid":"8A85313B-B310-4321-9C0C-B8348B5527D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"805DBB27-4A3F-4751-883A-6A32059DD7E0","type":"f","value":50,"nodeType":"Float"},{"uuid":"3CCDF74C-039B-492D-A361-789306D59F3D","type":"f","value":118,"nodeType":"Float"},{"uuid":"7D493910-D652-4446-9EA1-87D93E0EE280","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BCD21D7-6650-4B64-93B5-533A63F0C66C","type":"f","value":0,"nodeType":"Float"},{"uuid":"6E72F761-6DAE-453B-997D-4CF7CB854F29","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"527D5177-8940-441A-8339-E7EFDB0A7A9B","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"FF1EE8F4-9F34-4E20-8AB0-77F168A6CDE5","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"9402855E-401E-4B9B-ACB1-3573BF16BD88","type":"f","value":1,"nodeType":"Float"},{"uuid":"A7689FAF-35CB-40BD-A2BE-8DB4ECA25D84","type":"i","value":2,"nodeType":"Int"},{"uuid":"54BA9A1A-E77F-426D-BAB8-F06AFC34B479","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"E42BA2E1-8A42-45DD-ABB6-E169BBCE7BEA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6E59CA34-43D2-4CFC-963C-8F83391D63E2","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD75078F-84C5-48AF-BF46-FF408D9621A8","type":"f","value":2,"nodeType":"Float"},{"uuid":"8A1074AD-6B31-47B3-9E35-1C9110ABCFAA","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"08E0503F-6736-41A1-BD21-2560F5892A3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6726F00-66F9-4788-9E31-F8671AD70C62","type":"i","value":2,"nodeType":"Int"},{"uuid":"2DD1159D-F9E5-43A0-94D3-F1B77762AC2C","type":"f","value":1,"nodeType":"Float"},{"uuid":"0C677F1D-F950-464C-B64D-27AA828DF927","type":"i","value":0,"nodeType":"Int"},{"uuid":"7167BA62-CA3F-404D-946D-2EC53D2FC716","type":"f","value":30,"nodeType":"Float"},{"uuid":"2D13F844-1951-40DF-8A06-939E5FE5AAF1","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"84A155AD-4115-44FD-A2FE-C621AE2B770B","type":"f","value":10,"nodeType":"Float"},{"uuid":"A8AC077E-9BA2-4738-82BF-61874BC0609A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A1E2154C-F814-4DAA-9232-BFEF484EAC61","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0C1D4708-D884-4305-8FEF-BBA50C321CA6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"860AE740-F34C-4D9F-A07C-5FAFCED5BDD7","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"CE1D809F-F954-4E34-A2C5-363A0681188D","project":false,"nodeType":"Texture"},{"uuid":"CE1D809F-F954-4E34-A2C5-363A0681188D","type":"v2","index":0,"nodeType":"UV"},{"uuid":"FDA53F48-14C1-464F-8A0D-0582A40DB874","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"91A45FB3-12C3-4D4E-BE1E-40C2E0185CFC","project":false,"nodeType":"Texture"},{"uuid":"91A45FB3-12C3-4D4E-BE1E-40C2E0185CFC","type":"v2","index":0,"nodeType":"UV"},{"uuid":"AA35DAEB-09E3-4592-847D-CBDB00F82149","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"25EE2780-05CE-44CA-A68E-26791708B0B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F8C63E5-36DD-4206-8A47-71269708026C","type":"i","value":0,"nodeType":"Int"},{"uuid":"81C5311B-1F32-4AC9-858C-5AF1C3829759","type":"f","value":50,"nodeType":"Float"},{"uuid":"B4257D72-12EE-4922-8006-8E10E623EFC1","type":"f","value":118,"nodeType":"Float"},{"uuid":"41A76670-08AF-4635-9887-18E9760DB767","type":"f","value":1,"nodeType":"Float"},{"uuid":"19124F82-1677-416E-A378-70BEA9BC2185","type":"f","value":0,"nodeType":"Float"},{"uuid":"53BF7D91-EBFE-4561-AF61-26673F9CB126","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"6ADD3BF4-2C47-4044-BC37-796E66B47619","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"379CDF6C-2333-47E7-A826-B9DF3C69047B","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"2E878167-CC61-4CFA-8F55-2E1A9A8BCB2D","type":"f","value":1,"nodeType":"Float"},{"uuid":"03DDB6B5-2E75-400F-A352-F5E8CFA6F38F","type":"i","value":2,"nodeType":"Int"},{"uuid":"CB082EA9-79BF-4179-BB1D-076D4D68D033","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6581C8ED-FBCA-42A3-ADCA-08592AA3846F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"7E48B709-3006-457E-B601-C1EC5E41673D","type":"f","value":1,"nodeType":"Float"},{"uuid":"5916D5FC-235C-49D3-9856-3E0364CD7662","type":"f","value":2,"nodeType":"Float"},{"uuid":"B0F63B39-B0C5-4483-B4B7-9C601BABB46D","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"9C37FEC3-0AAD-422B-81C6-9CA98AC9A147","type":"f","value":1,"nodeType":"Float"},{"uuid":"CA8B680B-5A6C-4161-A97D-349E1ED3EB70","type":"i","value":2,"nodeType":"Int"},{"uuid":"5AE7E766-42F1-4E98-9F6C-1BCE565727FD","type":"phong","color":"3E94C926-F7D5-4CC4-8C15-3164724AE199","specular":"2D13F844-1951-40DF-8A06-939E5FE5AAF1","shininess":"7167BA62-CA3F-404D-946D-2EC53D2FC716","shadingAlpha":"2DD1159D-F9E5-43A0-94D3-F1B77762AC2C","shadingBlend":"0C677F1D-F950-464C-B64D-27AA828DF927","afterColor":"EEA8347A-BE22-49DD-8D81-15618BED3279","alpha":"3DB0D698-6DB8-48F7-8537-C68D54CDF1D0","nodeType":"Phong"},{"uuid":"3E94C926-F7D5-4CC4-8C15-3164724AE199","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"EEA8347A-BE22-49DD-8D81-15618BED3279","type":"v3","a":"4EE84707-BFDB-4350-833D-DFF5B9206CF8","b":"9690BCA5-FA0D-4F28-863C-CE8E3EE9895B","alpha":"2BF48651-F3D1-48F0-960B-E72AD24E3DB3","mode":"CA8B680B-5A6C-4161-A97D-349E1ED3EB70","nodeType":"Blend"},{"uuid":"4EE84707-BFDB-4350-833D-DFF5B9206CF8","type":"v3","a":"C6BD9D4E-BF78-4207-8217-7CA84D7C5688","b":"8ABF1B09-2D76-4BC0-AFCC-C291539A1C7B","alpha":"47D3EAC4-DAA6-4F26-A02D-C412D35BF8DE","mode":"03DDB6B5-2E75-400F-A352-F5E8CFA6F38F","nodeType":"Blend"},{"uuid":"C6BD9D4E-BF78-4207-8217-7CA84D7C5688","type":"v3","a":"183DACEB-617D-4115-8A52-2CBB71A71316","b":"1358CFCB-408E-4353-91BB-5D10CFDB7AAB","alpha":"1596F9B1-273C-4E09-AAB6-2ACD783B4E78","mode":"9F8C63E5-36DD-4206-8A47-71269708026C","nodeType":"Blend"},{"uuid":"183DACEB-617D-4115-8A52-2CBB71A71316","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1358CFCB-408E-4353-91BB-5D10CFDB7AAB","type":"v3","thickness":"84A155AD-4115-44FD-A2FE-C621AE2B770B","ior":"A8AC077E-9BA2-4738-82BF-61874BC0609A","roughness":"A1E2154C-F814-4DAA-9232-BFEF484EAC61","alpha":"25EE2780-05CE-44CA-A68E-26791708B0B8","calpha":"g1358CFCB408E435391BB5D10CFDB7AAB_calpha","nodeType":"Transmission"},{"uuid":"1596F9B1-273C-4E09-AAB6-2ACD783B4E78","type":"f","src":"g1358CFCB408E435391BB5D10CFDB7AAB_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8ABF1B09-2D76-4BC0-AFCC-C291539A1C7B","type":"v3","near":"81C5311B-1F32-4AC9-858C-5AF1C3829759","far":"B4257D72-12EE-4922-8006-8E10E623EFC1","isVector":"41A76670-08AF-4635-9887-18E9760DB767","isWorldSpace":"19124F82-1677-416E-A378-70BEA9BC2185","origin":"53BF7D91-EBFE-4561-AF61-26673F9CB126","colorA":"6ADD3BF4-2C47-4044-BC37-796E66B47619","colorB":"379CDF6C-2333-47E7-A826-B9DF3C69047B","alpha":"2E878167-CC61-4CFA-8F55-2E1A9A8BCB2D","nodeType":"Depth"},{"uuid":"47D3EAC4-DAA6-4F26-A02D-C412D35BF8DE","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"2E878167-CC61-4CFA-8F55-2E1A9A8BCB2D"},"nodeType":"Expression"},{"uuid":"9690BCA5-FA0D-4F28-863C-CE8E3EE9895B","type":"v3","color":"CB082EA9-79BF-4179-BB1D-076D4D68D033","bias":"6581C8ED-FBCA-42A3-ADCA-08592AA3846F","scale":"7E48B709-3006-457E-B601-C1EC5E41673D","intensity":"5916D5FC-235C-49D3-9856-3E0364CD7662","factor":"B0F63B39-B0C5-4483-B4B7-9C601BABB46D","alpha":"9C37FEC3-0AAD-422B-81C6-9CA98AC9A147","mode":"CA8B680B-5A6C-4161-A97D-349E1ED3EB70","calpha":"g9690BCA5FA0D4F28863CCE8E3EE9895B_calpha","nodeType":"Fresnel"},{"uuid":"2BF48651-F3D1-48F0-960B-E72AD24E3DB3","type":"f","src":"g9690BCA5FA0D4F28863CCE8E3EE9895B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3DB0D698-6DB8-48F7-8537-C68D54CDF1D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"DEA20FD9-F801-4FED-B94E-44689C497C4B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D306E94A-A21E-4350-AAF5-34EFBBE7D962","type":"i","value":0,"nodeType":"Int"},{"uuid":"9B62E4BA-35C5-4E7C-BAB6-A8BBA2734316","type":"f","value":30,"nodeType":"Float"},{"uuid":"300641B5-477D-4100-84E3-DD174ADC5C32","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"F40D28DF-EB43-4918-9839-696B1F484D7C","type":"f","value":10,"nodeType":"Float"},{"uuid":"E77ED164-FDF1-4EE7-B9F0-DE9F1AE89875","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"499C59CF-B4BE-40E0-8FD4-23673844DC9B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1956D8F1-D4FF-4480-903E-6C19AA806ACC","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D5D413BE-3181-4DEB-B9F1-19E8955533C8","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"F906DA5C-898C-48D1-84CD-6D2FCC720A98","type":"f","value":1,"nodeType":"Float"},{"uuid":"80E0CCF7-EE95-4B98-A920-BB7A905C7CAA","type":"i","value":0,"nodeType":"Int"},{"uuid":"6D99D767-7649-4C76-9C4A-983FDA6B3BA4","type":"f","value":50,"nodeType":"Float"},{"uuid":"5C80CFB5-6B67-47A7-A5A3-3CC19905C5AB","type":"f","value":168,"nodeType":"Float"},{"uuid":"F4D6C210-CB99-455E-90C7-FEE69E097C77","type":"f","value":1,"nodeType":"Float"},{"uuid":"8227F350-7D00-4B19-8776-736A8D46F535","type":"f","value":0,"nodeType":"Float"},{"uuid":"994A6D13-847D-4AE4-B711-C30CE780129B","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"E3F8B5E5-D118-4816-821A-0C92DD1402EB","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"D10FDE91-555F-4ED1-8195-11A1E76C5503","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E0D8732A-6D05-41D9-96E5-C338D95CFD8C","type":"f","value":1,"nodeType":"Float"},{"uuid":"E3592646-BA0D-4617-864C-FA124672D526","type":"i","value":2,"nodeType":"Int"},{"uuid":"AA7CAD61-61F9-4BF6-9672-40DCD14758C3","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"CDA922F8-6C0B-418D-B9D0-F929302DE13C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"277CB306-FD43-4FC5-83B3-1F42B832BCDB","type":"f","value":1,"nodeType":"Float"},{"uuid":"A5F0ECCA-EF89-4CE9-BE6C-E63C55C4A3FE","type":"f","value":2,"nodeType":"Float"},{"uuid":"4BE3FD67-53DC-4DB3-8FA1-0E33558FC52A","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"8CC8855F-F647-438E-BD7D-6E0F7AEE25BC","type":"f","value":1,"nodeType":"Float"},{"uuid":"496A5096-1AE3-4AA7-9AF6-227C6CEDB46D","type":"i","value":2,"nodeType":"Int"},{"uuid":"47F582B5-601D-4868-8AA5-2618DF725C1F","type":"f","value":1,"nodeType":"Float"},{"uuid":"2CB0FF11-D94C-4962-9BCC-181E4FEC7254","type":"i","value":0,"nodeType":"Int"},{"uuid":"70E985F2-4A4C-4383-8EB8-6D16AAF72640","type":"f","value":30,"nodeType":"Float"},{"uuid":"0FC2575E-63C8-492F-A430-F2038B7CD669","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"653F6CD9-FCE9-404E-B3BF-BF6EB47764FA","type":"f","value":10,"nodeType":"Float"},{"uuid":"829A70D5-C0A2-4C4F-8B70-D6BFDD413A1E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A61E6DF2-1D05-4C63-B10C-1BA82E45F35C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B2653667-05B7-4743-8A9D-EFA19CE7DD2C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F16005F4-C368-4DBA-9146-C567EC4448AB","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"37F58150-98EE-4EB7-B29C-03FEBEBFDC96","type":"f","value":1,"nodeType":"Float"},{"uuid":"44EC8B4A-E822-49A8-AC14-E5941C318FB2","type":"i","value":0,"nodeType":"Int"},{"uuid":"C7989A45-16E6-46FC-A134-1FE830E4CC0C","type":"f","value":50,"nodeType":"Float"},{"uuid":"5D2A34CA-D014-45AE-BBFA-A8398F934950","type":"f","value":168,"nodeType":"Float"},{"uuid":"889B53AD-859D-4A3F-A426-71A0B2930546","type":"f","value":1,"nodeType":"Float"},{"uuid":"53C5514C-F978-4876-ADB0-7D0C33830BE3","type":"f","value":0,"nodeType":"Float"},{"uuid":"8065FB2F-A54B-4C1E-AA61-47E4B8211C26","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"2F499C55-4ED6-4354-B93E-4B7CEC841E5E","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"00A8D422-CC1C-4D1A-A63D-ADCB12D50A58","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"11FE959A-5EEC-43ED-AE9E-2D404A37BD08","type":"f","value":1,"nodeType":"Float"},{"uuid":"2614CF5B-6952-4367-B86B-F3C0602EDD97","type":"i","value":2,"nodeType":"Int"},{"uuid":"AFF6EF00-93A4-46DD-A23F-E74CC0934771","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"CFC8465A-D78B-49C7-B8AB-5201248E76D4","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F9DBCA29-A5EB-402F-B0BA-2E1EEADA1F44","type":"f","value":1,"nodeType":"Float"},{"uuid":"C0F803A7-C582-4F08-ABCB-BE3A0B55ABB4","type":"f","value":2,"nodeType":"Float"},{"uuid":"991014C3-172E-417C-9D5B-A9314B667268","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"A2FAE408-4605-43C3-BDF3-5735871663B2","type":"f","value":1,"nodeType":"Float"},{"uuid":"2D46CF91-9A47-45EE-B1E6-312737C57455","type":"i","value":2,"nodeType":"Int"},{"uuid":"6D4BCF93-44A9-409F-B7A7-48B03C459DB1","type":"f","value":1,"nodeType":"Float"},{"uuid":"33F52298-8E8C-496E-837E-E5D4A868FCEE","type":"i","value":0,"nodeType":"Int"},{"uuid":"58E45858-C36B-4EE7-A1C2-89CEB9957BF4","type":"f","value":30,"nodeType":"Float"},{"uuid":"358513A0-F8C9-42A8-BF94-F6373F313200","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"DDEFAFD8-3B9B-4C45-9016-19F52F0BD227","type":"f","value":10,"nodeType":"Float"},{"uuid":"5C23A97C-FE9C-4224-BB77-92C66B017B57","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"30CCA389-9B77-4E13-84AD-823860DD639B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"662FF110-63FC-4FBA-9621-EC4168D5884F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"56DC5825-D96A-4806-B65E-2A78B1333BA7","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"F2CC9FA6-1D5E-400F-8A26-5DEC0AE0A6E6","project":false,"nodeType":"Texture"},{"uuid":"F2CC9FA6-1D5E-400F-8A26-5DEC0AE0A6E6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"69E7DDBF-4D66-4F7E-9A9E-DB8CD8E9E31E","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"18C28F9E-B273-4C59-A579-66546BE3BBBB","project":false,"nodeType":"Texture"},{"uuid":"18C28F9E-B273-4C59-A579-66546BE3BBBB","type":"v2","index":0,"nodeType":"UV"},{"uuid":"79F76553-E4F0-4B9A-B51E-67D251222C85","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"2773EB70-C843-4511-9047-F8C967207DEC","type":"f","value":1,"nodeType":"Float"},{"uuid":"DBC8ECC9-6377-44C2-94D2-7961D1A5124B","type":"i","value":0,"nodeType":"Int"},{"uuid":"2CD0AB99-EC85-430F-AFDA-158ED30F4A68","type":"f","value":50,"nodeType":"Float"},{"uuid":"AB460EB0-7A01-4C65-84E0-A6978094A9B2","type":"f","value":168,"nodeType":"Float"},{"uuid":"6DBE0812-3517-403A-9B9C-3B6623F3C4CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"880F4E6F-77F2-4F99-B260-BE8F9B9FB6D8","type":"f","value":0,"nodeType":"Float"},{"uuid":"2BD0D542-A5DF-4549-8DBB-E9CC2FC8DD9D","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F2BDF4A8-B3EF-4AEF-81AE-11075295BB41","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"AA30F813-A8B5-4686-9EE7-7F1ABDCA9EC3","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E53E09AB-9F40-4227-AA1C-D5F9D9F2E7B3","type":"f","value":1,"nodeType":"Float"},{"uuid":"2811F2DE-0F5F-49E5-BE59-14A42387029B","type":"i","value":2,"nodeType":"Int"},{"uuid":"86CE8FE0-60D9-4F40-B835-295CCE4B7BFB","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"CCB70141-2AEF-4C2F-A602-843D60A85A22","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9AD970D2-2C54-4BE6-A7A0-0F67AABE2FD4","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6276B68-5740-4290-B405-9762FD841E8C","type":"f","value":2,"nodeType":"Float"},{"uuid":"FCABCF10-C46A-44FE-9879-38628F2C1CD4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"A4DEECE4-C50D-42D3-994E-EF5B880845CC","type":"f","value":1,"nodeType":"Float"},{"uuid":"F88842EB-087A-4123-A56D-E65A4A880A5C","type":"i","value":2,"nodeType":"Int"},{"uuid":"EC60BF51-B4DC-4CCA-87BF-8E5841427EB3","type":"phong","color":"E4125DEC-8955-45DD-8A02-8C5464B1603B","specular":"358513A0-F8C9-42A8-BF94-F6373F313200","shininess":"58E45858-C36B-4EE7-A1C2-89CEB9957BF4","shadingAlpha":"6D4BCF93-44A9-409F-B7A7-48B03C459DB1","shadingBlend":"33F52298-8E8C-496E-837E-E5D4A868FCEE","afterColor":"8FFF63E3-312A-4DCD-8E6B-55E9EBD588D2","alpha":"5927C32C-B6AB-4DFB-91BA-D2FE370E771E","nodeType":"Phong"},{"uuid":"E4125DEC-8955-45DD-8A02-8C5464B1603B","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"8FFF63E3-312A-4DCD-8E6B-55E9EBD588D2","type":"v3","a":"7295379A-DDC7-44AB-9A6A-B91C014DEB37","b":"7FECE546-40D6-423A-AD92-5C6B33F708C8","alpha":"67064D97-7CE0-4061-A2C9-6707DA6C5F0B","mode":"F88842EB-087A-4123-A56D-E65A4A880A5C","nodeType":"Blend"},{"uuid":"7295379A-DDC7-44AB-9A6A-B91C014DEB37","type":"v3","a":"705C9DB7-902E-4ED6-B719-D7FDE983BBDE","b":"323A27EF-DA20-4FA3-BB78-DF71D136C6BB","alpha":"2BF18E96-E335-41FF-BB2F-42D711A2D321","mode":"2811F2DE-0F5F-49E5-BE59-14A42387029B","nodeType":"Blend"},{"uuid":"705C9DB7-902E-4ED6-B719-D7FDE983BBDE","type":"v3","a":"C84301A8-1665-46CE-80FF-FDA682FA1229","b":"1F6E1A2A-2360-4AD4-822C-A4FFFC392AD5","alpha":"8D19C9ED-6268-4609-B531-9F1E5BD512B9","mode":"DBC8ECC9-6377-44C2-94D2-7961D1A5124B","nodeType":"Blend"},{"uuid":"C84301A8-1665-46CE-80FF-FDA682FA1229","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1F6E1A2A-2360-4AD4-822C-A4FFFC392AD5","type":"v3","thickness":"DDEFAFD8-3B9B-4C45-9016-19F52F0BD227","ior":"5C23A97C-FE9C-4224-BB77-92C66B017B57","roughness":"30CCA389-9B77-4E13-84AD-823860DD639B","alpha":"2773EB70-C843-4511-9047-F8C967207DEC","calpha":"g1F6E1A2A23604AD4822CA4FFFC392AD5_calpha","nodeType":"Transmission"},{"uuid":"8D19C9ED-6268-4609-B531-9F1E5BD512B9","type":"f","src":"g1F6E1A2A23604AD4822CA4FFFC392AD5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"323A27EF-DA20-4FA3-BB78-DF71D136C6BB","type":"v3","near":"2CD0AB99-EC85-430F-AFDA-158ED30F4A68","far":"AB460EB0-7A01-4C65-84E0-A6978094A9B2","isVector":"6DBE0812-3517-403A-9B9C-3B6623F3C4CD","isWorldSpace":"880F4E6F-77F2-4F99-B260-BE8F9B9FB6D8","origin":"2BD0D542-A5DF-4549-8DBB-E9CC2FC8DD9D","colorA":"F2BDF4A8-B3EF-4AEF-81AE-11075295BB41","colorB":"AA30F813-A8B5-4686-9EE7-7F1ABDCA9EC3","alpha":"E53E09AB-9F40-4227-AA1C-D5F9D9F2E7B3","nodeType":"Depth"},{"uuid":"2BF18E96-E335-41FF-BB2F-42D711A2D321","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"E53E09AB-9F40-4227-AA1C-D5F9D9F2E7B3"},"nodeType":"Expression"},{"uuid":"7FECE546-40D6-423A-AD92-5C6B33F708C8","type":"v3","color":"86CE8FE0-60D9-4F40-B835-295CCE4B7BFB","bias":"CCB70141-2AEF-4C2F-A602-843D60A85A22","scale":"9AD970D2-2C54-4BE6-A7A0-0F67AABE2FD4","intensity":"B6276B68-5740-4290-B405-9762FD841E8C","factor":"FCABCF10-C46A-44FE-9879-38628F2C1CD4","alpha":"A4DEECE4-C50D-42D3-994E-EF5B880845CC","mode":"F88842EB-087A-4123-A56D-E65A4A880A5C","calpha":"g7FECE54640D6423AAD925C6B33F708C8_calpha","nodeType":"Fresnel"},{"uuid":"67064D97-7CE0-4061-A2C9-6707DA6C5F0B","type":"f","src":"g7FECE54640D6423AAD925C6B33F708C8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5927C32C-B6AB-4DFB-91BA-D2FE370E771E","type":"f","value":1,"nodeType":"Float"},{"uuid":"023ED60E-251A-49AC-BD66-9EDD85301033","type":"f","value":1,"nodeType":"Float"},{"uuid":"00EA104B-3CD7-4D92-B001-352180F4BAF3","type":"i","value":0,"nodeType":"Int"},{"uuid":"B8EBF80E-5E16-41D2-9642-4997E472A937","type":"f","value":30,"nodeType":"Float"},{"uuid":"1898B8AC-439F-4139-B65F-C76E50FA737F","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"CC89C9F7-2E8C-4D9F-8FB0-1D0F8044B2D0","type":"f","value":10,"nodeType":"Float"},{"uuid":"7A090862-CB58-42D4-BDE8-DDE925C2F22F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"93BEF98F-B2E4-4EF9-99CB-AD9A1E72B46C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F8FE858A-FBA7-4D1B-9CAD-4A3F7257329D","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A29FF373-3F5C-43CE-8375-F17C31E235AB","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4B64CCF1-DB62-4737-9023-6F0E43CD019B","type":"f","value":1,"nodeType":"Float"},{"uuid":"39DABA89-26EB-4881-BFB8-6257527B147F","type":"i","value":0,"nodeType":"Int"},{"uuid":"ED64B85E-9F6C-416E-94AA-6B3A75A6376F","type":"f","value":50,"nodeType":"Float"},{"uuid":"4ED7CAF2-A1A0-47CC-BCCA-5D20D2209085","type":"f","value":118,"nodeType":"Float"},{"uuid":"9CE86CEB-594C-4642-99C8-188416B430CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"9E1FA986-D4A0-4A21-A569-6F74388EC349","type":"f","value":0,"nodeType":"Float"},{"uuid":"FA768F40-BA6D-44D4-B996-60E9488B3399","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"B7D2922B-2A6A-44A7-A157-105CEA4ABB8E","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"F22590EA-8A3A-4189-B969-D7BED76C6B5C","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"81335222-1355-42F4-B751-792A089AE0DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"A1EF5C20-5907-4B56-845D-92F4B786A2FE","type":"i","value":2,"nodeType":"Int"},{"uuid":"94EBACC0-65D1-438C-BFC9-8F93670ED22C","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"940A21F5-7DCF-4067-A85E-D6C66FFA0C96","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4BD9C4F6-7CF8-4C5E-849A-40AA734CF8CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"3A5151F9-BCA4-4F69-BA74-CAED26364497","type":"f","value":2,"nodeType":"Float"},{"uuid":"BA3B16A7-E815-4BC4-A910-9F762CC65FA4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"02415A53-4E3E-40D0-A7A2-3AD073747939","type":"f","value":1,"nodeType":"Float"},{"uuid":"C6E6D88A-67EA-4287-993A-8501B179F95E","type":"i","value":2,"nodeType":"Int"},{"uuid":"BC193881-EB20-4BAA-A2ED-8B9A673BB284","type":"f","value":1,"nodeType":"Float"},{"uuid":"EF3CF469-5132-41C4-A687-BB3E47EFBE5E","type":"i","value":0,"nodeType":"Int"},{"uuid":"49A3EAC4-938F-4050-A765-6467B40E1E6D","type":"f","value":30,"nodeType":"Float"},{"uuid":"F1CE4D73-AC35-47C8-8E74-169C74A27D6E","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"6EC5E245-E778-485F-8F74-855D64F26A30","type":"f","value":10,"nodeType":"Float"},{"uuid":"4F11C2C5-C371-4B14-BAFB-9F0CBD66DD47","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"9D51D732-D543-4162-8EDE-7817650FACC6","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"2D389BC6-3BA1-449E-B46C-F602A4795A4E","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F94A4530-3C31-44E0-A8EA-84E48907A5C1","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"75E8B51F-5CC8-45F0-9F50-DAE028425A04","type":"f","value":1,"nodeType":"Float"},{"uuid":"62A027D5-951C-469A-A952-927BC06D9501","type":"i","value":0,"nodeType":"Int"},{"uuid":"739FFDC3-BB83-4D1F-A978-D38820A85887","type":"f","value":50,"nodeType":"Float"},{"uuid":"D40B30E5-9929-48AF-8E7F-6E8D640E5610","type":"f","value":118,"nodeType":"Float"},{"uuid":"9853A151-4A36-4464-BF56-6F2A20138CDE","type":"f","value":1,"nodeType":"Float"},{"uuid":"68D64BC0-570B-4FB5-98C6-7A19918B5365","type":"f","value":0,"nodeType":"Float"},{"uuid":"89223839-66CA-4D6F-985B-D1FA82989BD4","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C08E1A4E-EE57-466D-9DE0-732D086568C4","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"640DB05B-D80D-4873-BF68-03483E748724","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E7D9A998-B1CE-45E5-BBB1-B0E31876F90A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8D6F862F-73D8-4D1C-8C07-D7B5A62CE6FA","type":"i","value":2,"nodeType":"Int"},{"uuid":"8F04CA08-51B1-4F5B-81CE-F612317C7A51","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"077199C7-7273-4D2F-BA5F-E0357904AD26","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"974E317B-D4F6-4F39-841D-9C8094591173","type":"f","value":1,"nodeType":"Float"},{"uuid":"85CE56B1-6BB5-4477-B998-EF9B2A9B0779","type":"f","value":2,"nodeType":"Float"},{"uuid":"E13F0112-7368-4952-BE58-D27FC012454D","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"E09304C2-EA4C-4EFA-AF5C-314FB0066EED","type":"f","value":1,"nodeType":"Float"},{"uuid":"F98AA7DE-C2CF-44D2-95C0-C746773BA42F","type":"i","value":2,"nodeType":"Int"},{"uuid":"3F487305-6580-4AE0-A90D-C8119AA35F3C","type":"f","value":1,"nodeType":"Float"},{"uuid":"A380977F-03AD-43C1-9EFE-C491AC980B06","type":"i","value":0,"nodeType":"Int"},{"uuid":"E6A1F08D-198C-46F2-A663-6CEC8A6C125B","type":"f","value":30,"nodeType":"Float"},{"uuid":"39256C2A-7809-4ECD-8BFF-5C22464A53CC","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"CC3E4B88-6FEF-42FC-BE90-824B8B491672","type":"f","value":10,"nodeType":"Float"},{"uuid":"0A12AC3C-3DF0-4251-B6BE-4C36DE168F08","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"82D6867F-E71A-4404-A485-F7C958D099E1","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"35EA7633-23C9-4443-A0FE-E460AF3EDC7B","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"723395A2-D6B2-48B2-80C5-DCD062C532D3","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"80DEB643-C3F8-4CF2-A3EA-3D83F1782A09","project":false,"nodeType":"Texture"},{"uuid":"80DEB643-C3F8-4CF2-A3EA-3D83F1782A09","type":"v2","index":0,"nodeType":"UV"},{"uuid":"8CF9434C-C596-4027-BDB1-D1F450B7607B","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"EB6FA979-F352-4678-B87E-DC7DFCCE7E7B","project":false,"nodeType":"Texture"},{"uuid":"EB6FA979-F352-4678-B87E-DC7DFCCE7E7B","type":"v2","index":0,"nodeType":"UV"},{"uuid":"34DBCB9C-2758-4FF3-A327-52DD6C8A9518","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"5F3482F5-65B9-425F-A00D-C15A52F386AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"75DE7037-EC25-442A-88FA-4839994C075E","type":"i","value":0,"nodeType":"Int"},{"uuid":"F6ACB7E3-D049-476A-92AD-4F402383F7BB","type":"f","value":50,"nodeType":"Float"},{"uuid":"908DC933-87FF-474B-B252-722140EA884A","type":"f","value":118,"nodeType":"Float"},{"uuid":"9BB92CA6-209C-42FC-ACBA-100CAB2BB825","type":"f","value":1,"nodeType":"Float"},{"uuid":"3BF199B7-C006-4AF2-862E-1246C5F77556","type":"f","value":0,"nodeType":"Float"},{"uuid":"67A8A423-119C-487C-AC7B-3D89B6F663AE","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3E0C1E38-1227-4B1F-8530-F325FB2A0047","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"6DE3E1D5-C660-4FF1-AD63-88F3A357F0D0","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"0BE8A226-5022-4ADE-9B07-CD7586FAEAE8","type":"f","value":1,"nodeType":"Float"},{"uuid":"28DA6F89-A15B-46B0-88A0-A41DA9106BF8","type":"i","value":2,"nodeType":"Int"},{"uuid":"7DA17B94-3724-4D3E-B1CC-E4F3215253DC","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"B73C9E73-0B4F-4D2A-8527-CDDA47A24BD3","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1A12C604-FBDE-45AA-8A56-FEABB149FAD8","type":"f","value":1,"nodeType":"Float"},{"uuid":"1AA0957E-57A9-470D-87AF-22B7FC24A7C4","type":"f","value":2,"nodeType":"Float"},{"uuid":"EF974B84-BC2A-461E-BF79-85256F9FD483","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"5B7FD70B-C39A-46EA-B36B-511880697332","type":"f","value":1,"nodeType":"Float"},{"uuid":"CDFE9C4C-B7F5-44A2-9A06-A8A35BB74BAF","type":"i","value":2,"nodeType":"Int"},{"uuid":"7EC4FC3C-9471-4A4A-8033-0FF696BC98F7","type":"phong","color":"A6BE65DB-493D-446D-B381-CE0FCB821A07","specular":"39256C2A-7809-4ECD-8BFF-5C22464A53CC","shininess":"E6A1F08D-198C-46F2-A663-6CEC8A6C125B","shadingAlpha":"3F487305-6580-4AE0-A90D-C8119AA35F3C","shadingBlend":"A380977F-03AD-43C1-9EFE-C491AC980B06","afterColor":"5A97597E-1DE3-4442-BD03-E9829E62EE8F","alpha":"A7BA2301-B3CD-4C53-B4F2-3748C63DD1F8","nodeType":"Phong"},{"uuid":"A6BE65DB-493D-446D-B381-CE0FCB821A07","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"5A97597E-1DE3-4442-BD03-E9829E62EE8F","type":"v3","a":"7120826A-CBFD-4FFD-AC89-C1615DBAD4B2","b":"14D8E806-ED6D-455F-8743-85FD26A5A031","alpha":"75881DF7-1261-4C4F-BA85-034519B5DD86","mode":"CDFE9C4C-B7F5-44A2-9A06-A8A35BB74BAF","nodeType":"Blend"},{"uuid":"7120826A-CBFD-4FFD-AC89-C1615DBAD4B2","type":"v3","a":"965A76ED-AC3F-49F7-B230-522349310E71","b":"B418BBE3-F6F2-4560-B176-CBFA60FDD618","alpha":"1D2EADEA-A438-4940-972B-FC41F2C5AFF8","mode":"28DA6F89-A15B-46B0-88A0-A41DA9106BF8","nodeType":"Blend"},{"uuid":"965A76ED-AC3F-49F7-B230-522349310E71","type":"v3","a":"E7AD92CC-F3CD-4679-BEC3-BB6ABDCFB5CC","b":"F965D10A-E22C-40D7-BF82-46BDDF0D95EB","alpha":"B60BC9B5-9FE8-4911-84C0-D0E637505FEB","mode":"75DE7037-EC25-442A-88FA-4839994C075E","nodeType":"Blend"},{"uuid":"E7AD92CC-F3CD-4679-BEC3-BB6ABDCFB5CC","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F965D10A-E22C-40D7-BF82-46BDDF0D95EB","type":"v3","thickness":"CC3E4B88-6FEF-42FC-BE90-824B8B491672","ior":"0A12AC3C-3DF0-4251-B6BE-4C36DE168F08","roughness":"82D6867F-E71A-4404-A485-F7C958D099E1","alpha":"5F3482F5-65B9-425F-A00D-C15A52F386AC","calpha":"gF965D10AE22C40D7BF8246BDDF0D95EB_calpha","nodeType":"Transmission"},{"uuid":"B60BC9B5-9FE8-4911-84C0-D0E637505FEB","type":"f","src":"gF965D10AE22C40D7BF8246BDDF0D95EB_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B418BBE3-F6F2-4560-B176-CBFA60FDD618","type":"v3","near":"F6ACB7E3-D049-476A-92AD-4F402383F7BB","far":"908DC933-87FF-474B-B252-722140EA884A","isVector":"9BB92CA6-209C-42FC-ACBA-100CAB2BB825","isWorldSpace":"3BF199B7-C006-4AF2-862E-1246C5F77556","origin":"67A8A423-119C-487C-AC7B-3D89B6F663AE","colorA":"3E0C1E38-1227-4B1F-8530-F325FB2A0047","colorB":"6DE3E1D5-C660-4FF1-AD63-88F3A357F0D0","alpha":"0BE8A226-5022-4ADE-9B07-CD7586FAEAE8","nodeType":"Depth"},{"uuid":"1D2EADEA-A438-4940-972B-FC41F2C5AFF8","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"0BE8A226-5022-4ADE-9B07-CD7586FAEAE8"},"nodeType":"Expression"},{"uuid":"14D8E806-ED6D-455F-8743-85FD26A5A031","type":"v3","color":"7DA17B94-3724-4D3E-B1CC-E4F3215253DC","bias":"B73C9E73-0B4F-4D2A-8527-CDDA47A24BD3","scale":"1A12C604-FBDE-45AA-8A56-FEABB149FAD8","intensity":"1AA0957E-57A9-470D-87AF-22B7FC24A7C4","factor":"EF974B84-BC2A-461E-BF79-85256F9FD483","alpha":"5B7FD70B-C39A-46EA-B36B-511880697332","mode":"CDFE9C4C-B7F5-44A2-9A06-A8A35BB74BAF","calpha":"g14D8E806ED6D455F874385FD26A5A031_calpha","nodeType":"Fresnel"},{"uuid":"75881DF7-1261-4C4F-BA85-034519B5DD86","type":"f","src":"g14D8E806ED6D455F874385FD26A5A031_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A7BA2301-B3CD-4C53-B4F2-3748C63DD1F8","type":"f","value":1,"nodeType":"Float"},{"uuid":"304B2599-0095-488A-860D-7990C9B3D9FF","type":"f","value":1,"nodeType":"Float"},{"uuid":"9ACB3FA2-6269-49EC-872B-608A6112FE56","type":"i","value":0,"nodeType":"Int"},{"uuid":"F5B487A7-C028-4291-915B-2EDF98E1BE82","type":"f","value":30,"nodeType":"Float"},{"uuid":"1C0954D3-34B8-4D4B-893E-FCBD8C9F6C30","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"8DD5544B-835E-433A-97BB-ACDD66FCB7D4","type":"f","value":10,"nodeType":"Float"},{"uuid":"75FF32B2-A1A6-4A36-8DD2-32C3B46D5E2F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"142F0166-5883-47E5-9A79-F42E7007BE73","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FFB8F722-3518-494B-8DCB-728E95B33A0F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"85CCA3C3-388D-4950-8946-84D6B5EA72DC","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"5D043224-5D6D-4C56-B41D-3D88C7BA8CBA","type":"f","value":1,"nodeType":"Float"},{"uuid":"76537189-FC4A-464D-B51D-203E9B84033E","type":"i","value":0,"nodeType":"Int"},{"uuid":"9039BFC8-73F2-43CC-B29D-97BD3B60456F","type":"f","value":50,"nodeType":"Float"},{"uuid":"43D4F7F0-9851-4853-B161-C25B5D3914A7","type":"f","value":168,"nodeType":"Float"},{"uuid":"FF61DEFC-05D2-4E59-BD20-D9BA0538E6E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6CC6531-E520-43A2-937E-D099D933AEA8","type":"f","value":0,"nodeType":"Float"},{"uuid":"9BA431F5-EB16-422B-8D79-14587DDF76CD","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"DA26B7F8-E6DA-4446-8800-E2FAE40093CE","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"97847D78-DEF0-45D9-BFD2-30E1CD687F5F","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"13F7E037-5996-4D45-A09E-3E220FD9F1EF","type":"f","value":1,"nodeType":"Float"},{"uuid":"A865B219-280A-47E2-83BE-7D993E5E0E64","type":"i","value":2,"nodeType":"Int"},{"uuid":"9FB8AEB2-2C5C-42C0-8290-B953580608BF","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"D1F50204-E1E5-4B4B-8A62-D40AA18A9911","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BD0E4444-7011-4EED-A8C3-6C7D15C2DE9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4EA03BD-535E-4F0E-A1E1-E163A85943B9","type":"f","value":2,"nodeType":"Float"},{"uuid":"D9BFB837-340C-4094-A3E9-2872AB825EB0","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"FC83F13C-FDE8-4FF3-A33F-C51E2AAD7578","type":"f","value":1,"nodeType":"Float"},{"uuid":"4D587140-4DEA-411F-8C35-95F9E7BC9C92","type":"i","value":2,"nodeType":"Int"},{"uuid":"9D120524-98A5-497A-AE0B-55E939030F0F","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E322CE1-9B6A-4DA3-B0C4-705A3F854E66","type":"i","value":0,"nodeType":"Int"},{"uuid":"0FA76AB4-AB74-4787-A4B0-C1015847472A","type":"f","value":30,"nodeType":"Float"},{"uuid":"CB4DAECD-860B-4024-A55D-EB5BF37A7B40","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"4DFE764F-54D7-43A5-8D60-F1CD280780FC","type":"f","value":10,"nodeType":"Float"},{"uuid":"26BFA1A2-A329-488C-9A83-27E30B713DE9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"71DFF4B2-7631-44E0-B446-8C2831973350","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"BA3906A5-AC0D-4F23-9319-946F0288F04D","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2639EFB1-48AA-48D8-8C1E-B50FCA2CA0B2","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"ED8BC04B-657F-494B-A1BF-5CB1CC5DDD1C","type":"f","value":1,"nodeType":"Float"},{"uuid":"F3EEB8D7-A85E-419F-97A2-25037F35155C","type":"i","value":0,"nodeType":"Int"},{"uuid":"34098EC5-1E95-4916-B57C-3888A8F51E4A","type":"f","value":50,"nodeType":"Float"},{"uuid":"7FEBE97D-C824-4053-8741-628DF6D7B825","type":"f","value":168,"nodeType":"Float"},{"uuid":"FBA93055-6532-4B42-AA25-12C218E6EC8C","type":"f","value":1,"nodeType":"Float"},{"uuid":"82075D8F-744A-4939-B9C6-8E8AFD48B5CC","type":"f","value":0,"nodeType":"Float"},{"uuid":"43A31AE4-748D-4892-9EBF-D29990608D43","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"547FE970-AA29-4FE6-A221-150704D816E3","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"37CBED7F-7A10-44A1-B039-8F467CDC05D9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"42B5A43E-4FAD-4740-91E1-DFB749355253","type":"f","value":1,"nodeType":"Float"},{"uuid":"D1C67A8C-112D-4B56-93C9-9613C99AE43D","type":"i","value":2,"nodeType":"Int"},{"uuid":"3556E4F2-F6B4-41B4-908E-4E4EF2609B83","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"AE46B59A-ABD0-4C4C-8E1F-3D71B0ECA965","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"A5F05746-BEB9-40FC-8BB9-935F9BD1976D","type":"f","value":1,"nodeType":"Float"},{"uuid":"38F58FAE-43BF-4562-99B6-45E10264CA82","type":"f","value":2,"nodeType":"Float"},{"uuid":"33767F7A-8A64-41BD-B50C-B1BDDFB8576F","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"E8978A26-5C77-4EE7-BBE7-0B5C3B1A85A6","type":"f","value":1,"nodeType":"Float"},{"uuid":"2AC83CEF-AB4D-4A9C-8045-97B3890B8EEA","type":"i","value":2,"nodeType":"Int"},{"uuid":"4612AD7B-2800-45A7-AFD4-758BB63793F7","type":"f","value":1,"nodeType":"Float"},{"uuid":"8AB330B9-39FE-4F52-A6F2-A7F84E65680D","type":"i","value":0,"nodeType":"Int"},{"uuid":"CAAE641B-3C01-4F8E-AD7A-8BA2D8D0E640","type":"f","value":30,"nodeType":"Float"},{"uuid":"1107846A-D31B-41C0-904C-19E2A3A153F0","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"D8B992FE-BA3A-4F53-8974-1AE8BC291865","type":"f","value":10,"nodeType":"Float"},{"uuid":"40EEB7AD-E8F1-423C-AEEF-0246F19F0A82","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0C9B9142-1C4A-42CE-BFFF-DF33A90EE1A9","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FA48DEE7-2444-465C-894F-505F7962973F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"6830B554-59A1-47C6-9911-925F653643AB","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"AC575F22-5D5C-40A6-BA06-AE99A9DC486B","project":false,"nodeType":"Texture"},{"uuid":"AC575F22-5D5C-40A6-BA06-AE99A9DC486B","type":"v2","index":0,"nodeType":"UV"},{"uuid":"75D0AEC9-A58A-47F1-BEA9-B5A7346BC9CC","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"5A37B6C6-D324-4363-B052-1C9D95D7DB35","project":false,"nodeType":"Texture"},{"uuid":"5A37B6C6-D324-4363-B052-1C9D95D7DB35","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4C04B78E-BFB6-4FE4-A46B-BCB89BA30E92","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"D2E4F243-1872-45DD-99B8-51923C8FDED1","type":"f","value":1,"nodeType":"Float"},{"uuid":"1DD2849D-B282-49DB-9F60-22697AA50F22","type":"i","value":0,"nodeType":"Int"},{"uuid":"A2786018-EAC6-4D2C-B7F6-D16850F01E6C","type":"f","value":50,"nodeType":"Float"},{"uuid":"3A0F5399-5F77-4A5A-8A4D-BA26E38E110E","type":"f","value":168,"nodeType":"Float"},{"uuid":"A9668A7D-D801-499F-B154-659A9107AFCD","type":"f","value":1,"nodeType":"Float"},{"uuid":"0D27C4D0-E0E2-496D-92AE-8BD4B9335264","type":"f","value":0,"nodeType":"Float"},{"uuid":"E0D2B7C0-A5FB-4C77-A10B-FC07390F5AED","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"590291C7-C581-46C9-9217-D8A7958DADA4","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"7000543B-DDF0-45F0-9B56-8CC5E4502747","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"762DD639-0F78-4379-964F-57EB1183951A","type":"f","value":1,"nodeType":"Float"},{"uuid":"9EEBF53E-BD49-43FB-A3B6-AD97CC2AC80A","type":"i","value":2,"nodeType":"Int"},{"uuid":"BB11845B-A65D-4767-AAE6-AD09693990DB","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"D87A99BE-49A1-45C0-AEB7-2AE9916535E0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"8FCCC74E-EBA7-485B-BDD7-DE8AD66E5ABA","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F0DA090-F79E-4556-AD24-6CF1834AD9E5","type":"f","value":2,"nodeType":"Float"},{"uuid":"9E58385B-E5C6-4CCD-B0FA-14AEC2AED802","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"82AE3CED-B94F-4933-B670-B4858BB8C0F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"A5286526-EB84-41A0-86B8-68851298532C","type":"i","value":2,"nodeType":"Int"},{"uuid":"D3FB76D1-ED48-4D0C-A8E4-74C92C48C6D3","type":"phong","color":"57AFCBAC-1110-4ACD-AA53-DAF46730CD0A","specular":"1107846A-D31B-41C0-904C-19E2A3A153F0","shininess":"CAAE641B-3C01-4F8E-AD7A-8BA2D8D0E640","shadingAlpha":"4612AD7B-2800-45A7-AFD4-758BB63793F7","shadingBlend":"8AB330B9-39FE-4F52-A6F2-A7F84E65680D","afterColor":"BC3D52A3-9B7C-43F5-8191-D7F71A44180F","alpha":"8CAF1653-8085-44C4-A1A8-2EE6A92E0677","nodeType":"Phong"},{"uuid":"57AFCBAC-1110-4ACD-AA53-DAF46730CD0A","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"BC3D52A3-9B7C-43F5-8191-D7F71A44180F","type":"v3","a":"62CA85AF-01C5-4ECE-88D0-82656609B818","b":"0A0657AC-6036-41B0-8643-3C9F6D927E19","alpha":"871E54C2-B54E-4381-BDCE-341D311ADF85","mode":"A5286526-EB84-41A0-86B8-68851298532C","nodeType":"Blend"},{"uuid":"62CA85AF-01C5-4ECE-88D0-82656609B818","type":"v3","a":"0CA4EA8F-A675-4644-AAB3-C47EB3ADF0E0","b":"D25AF852-EC55-4049-A644-18683FC96D81","alpha":"6BB426AB-9842-4DED-A0A5-7DD6ACBBEDED","mode":"9EEBF53E-BD49-43FB-A3B6-AD97CC2AC80A","nodeType":"Blend"},{"uuid":"0CA4EA8F-A675-4644-AAB3-C47EB3ADF0E0","type":"v3","a":"3AE991F1-B257-487B-B7AE-6C91E59FE618","b":"F331A8B9-6EFE-445F-835A-6CC449872C3F","alpha":"961036B0-7E53-4A30-9954-938D44153C1F","mode":"1DD2849D-B282-49DB-9F60-22697AA50F22","nodeType":"Blend"},{"uuid":"3AE991F1-B257-487B-B7AE-6C91E59FE618","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F331A8B9-6EFE-445F-835A-6CC449872C3F","type":"v3","thickness":"D8B992FE-BA3A-4F53-8974-1AE8BC291865","ior":"40EEB7AD-E8F1-423C-AEEF-0246F19F0A82","roughness":"0C9B9142-1C4A-42CE-BFFF-DF33A90EE1A9","alpha":"D2E4F243-1872-45DD-99B8-51923C8FDED1","calpha":"gF331A8B96EFE445F835A6CC449872C3F_calpha","nodeType":"Transmission"},{"uuid":"961036B0-7E53-4A30-9954-938D44153C1F","type":"f","src":"gF331A8B96EFE445F835A6CC449872C3F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D25AF852-EC55-4049-A644-18683FC96D81","type":"v3","near":"A2786018-EAC6-4D2C-B7F6-D16850F01E6C","far":"3A0F5399-5F77-4A5A-8A4D-BA26E38E110E","isVector":"A9668A7D-D801-499F-B154-659A9107AFCD","isWorldSpace":"0D27C4D0-E0E2-496D-92AE-8BD4B9335264","origin":"E0D2B7C0-A5FB-4C77-A10B-FC07390F5AED","colorA":"590291C7-C581-46C9-9217-D8A7958DADA4","colorB":"7000543B-DDF0-45F0-9B56-8CC5E4502747","alpha":"762DD639-0F78-4379-964F-57EB1183951A","nodeType":"Depth"},{"uuid":"6BB426AB-9842-4DED-A0A5-7DD6ACBBEDED","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"762DD639-0F78-4379-964F-57EB1183951A"},"nodeType":"Expression"},{"uuid":"0A0657AC-6036-41B0-8643-3C9F6D927E19","type":"v3","color":"BB11845B-A65D-4767-AAE6-AD09693990DB","bias":"D87A99BE-49A1-45C0-AEB7-2AE9916535E0","scale":"8FCCC74E-EBA7-485B-BDD7-DE8AD66E5ABA","intensity":"3F0DA090-F79E-4556-AD24-6CF1834AD9E5","factor":"9E58385B-E5C6-4CCD-B0FA-14AEC2AED802","alpha":"82AE3CED-B94F-4933-B670-B4858BB8C0F0","mode":"A5286526-EB84-41A0-86B8-68851298532C","calpha":"g0A0657AC603641B086433C9F6D927E19_calpha","nodeType":"Fresnel"},{"uuid":"871E54C2-B54E-4381-BDCE-341D311ADF85","type":"f","src":"g0A0657AC603641B086433C9F6D927E19_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8CAF1653-8085-44C4-A1A8-2EE6A92E0677","type":"f","value":1,"nodeType":"Float"},{"uuid":"3DE9025A-F4A2-4255-8692-9A0C787AC465","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"FE99FC96-F065-460B-9736-EED15047D172","nodeType":"Color"},{"uuid":"FE99FC96-F065-460B-9736-EED15047D172","type":"f","value":1,"nodeType":"Float"},{"uuid":"C84A9DAB-06C9-4D09-97BD-7D2E5260C30E","type":"i","value":0,"nodeType":"Int"},{"uuid":"3119DB25-A452-486F-AE8C-2F1D54FA6458","type":"f","value":1,"nodeType":"Float"},{"uuid":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","type":"i","value":0,"nodeType":"Int"},{"uuid":"00120391-5F87-4631-8249-D061FFF278D0","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"D97D625D-505D-4C25-8BB8-055E8A3589BE","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"62B9E251-BA17-4132-B9D4-123F37917491","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"0D3A21A9-E6A1-45CB-9016-7E2AC11B9D01","type":"f","value":1,"nodeType":"Float"},{"uuid":"A333B9F9-7697-4043-BA64-13C7306E619C","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"1CDDF7D5-4A7D-4AEC-9007-4FB10590955F","type":"f","value":1,"nodeType":"Float"},{"uuid":"A8365ABA-D199-480D-B588-7FACFADC9FDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB94751D-374B-4C5D-8C01-20E622A24FAA","type":"i","value":0,"nodeType":"Int"},{"uuid":"4764F644-0523-437C-A906-6A4C6EA43507","type":"lambert","color":"3DE9025A-F4A2-4255-8692-9A0C787AC465","emissiveIntensity":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","shadingAlpha":"3119DB25-A452-486F-AE8C-2F1D54FA6458","shadingBlend":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","afterColor":"0273032C-FE95-4788-AE4B-F153D165FB30","alpha":"DA913C1D-F4FB-45BC-9988-70CCD0657598","emissive":"00120391-5F87-4631-8249-D061FFF278D0","nodeType":"Lambert"},{"uuid":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"0273032C-FE95-4788-AE4B-F153D165FB30","type":"v3","a":"60D36234-387E-4EFC-BB4C-35F6A2641C5B","b":"8226700D-F50A-4CDC-810E-2DB0308CC674","alpha":"F063D03C-93CB-4481-B3D8-C2C428766151","mode":"DB94751D-374B-4C5D-8C01-20E622A24FAA","nodeType":"Blend"},{"uuid":"60D36234-387E-4EFC-BB4C-35F6A2641C5B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8226700D-F50A-4CDC-810E-2DB0308CC674","type":"v3","color":"D97D625D-505D-4C25-8BB8-055E8A3589BE","bias":"62B9E251-BA17-4132-B9D4-123F37917491","scale":"0D3A21A9-E6A1-45CB-9016-7E2AC11B9D01","intensity":"A333B9F9-7697-4043-BA64-13C7306E619C","factor":"1CDDF7D5-4A7D-4AEC-9007-4FB10590955F","alpha":"A8365ABA-D199-480D-B588-7FACFADC9FDC","mode":"DB94751D-374B-4C5D-8C01-20E622A24FAA","calpha":"g8226700DF50A4CDC810E2DB0308CC674_calpha","nodeType":"Fresnel"},{"uuid":"F063D03C-93CB-4481-B3D8-C2C428766151","type":"f","src":"g8226700DF50A4CDC810E2DB0308CC674_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DA913C1D-F4FB-45BC-9988-70CCD0657598","type":"f","value":1,"nodeType":"Float"},{"uuid":"A85E799E-1A58-4147-8BBE-89DF75C289A2","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"C5F2CC1F-7EED-4802-AA29-58E8982E28A6","nodeType":"Color"},{"uuid":"C5F2CC1F-7EED-4802-AA29-58E8982E28A6","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB7A3BE3-5AD2-4A5C-99DA-32D2AE950E59","type":"i","value":0,"nodeType":"Int"},{"uuid":"8881BE93-8CA2-4F57-81D2-9EE56223B303","type":"f","value":1,"nodeType":"Float"},{"uuid":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","type":"i","value":0,"nodeType":"Int"},{"uuid":"169F2E98-A4F4-4BB5-BC39-EBB3A42E0D54","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"667A02D4-E159-4B71-A38E-1C97022D2C67","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"EA310805-34B6-4978-B1BE-7E05705FDE56","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F8FBA7DD-764F-4930-9B05-374049F95CD5","type":"f","value":1,"nodeType":"Float"},{"uuid":"8141A755-18C4-498C-8309-2A78A7B7DA27","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"6DA23769-CA9C-482B-B9F3-78BFDE7EA8FB","type":"f","value":1,"nodeType":"Float"},{"uuid":"F70B9CB8-568E-4868-9529-CB3A54DAEF78","type":"f","value":1,"nodeType":"Float"},{"uuid":"79DAC97E-6EAC-4A31-9195-D0E69C59C819","type":"i","value":0,"nodeType":"Int"},{"uuid":"A141BD81-5415-435E-9447-4B35842D83A9","type":"lambert","color":"A85E799E-1A58-4147-8BBE-89DF75C289A2","emissiveIntensity":"F304A8E1-0424-4CF8-922F-FEF048A0652C","shadingAlpha":"8881BE93-8CA2-4F57-81D2-9EE56223B303","shadingBlend":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","afterColor":"C55FBD8D-F320-4F6E-B74A-1BBF32A42AC8","alpha":"BE52C837-0A04-4C9D-86C1-872943DAACCC","emissive":"169F2E98-A4F4-4BB5-BC39-EBB3A42E0D54","nodeType":"Lambert"},{"uuid":"F304A8E1-0424-4CF8-922F-FEF048A0652C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C55FBD8D-F320-4F6E-B74A-1BBF32A42AC8","type":"v3","a":"95828208-5905-4714-94D3-51F6F6563F99","b":"A026CFAF-291B-4723-8C89-4B4A865C2E2A","alpha":"B26A0C39-3B6D-4B8E-B8BC-24EB725769DC","mode":"79DAC97E-6EAC-4A31-9195-D0E69C59C819","nodeType":"Blend"},{"uuid":"95828208-5905-4714-94D3-51F6F6563F99","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A026CFAF-291B-4723-8C89-4B4A865C2E2A","type":"v3","color":"667A02D4-E159-4B71-A38E-1C97022D2C67","bias":"EA310805-34B6-4978-B1BE-7E05705FDE56","scale":"F8FBA7DD-764F-4930-9B05-374049F95CD5","intensity":"8141A755-18C4-498C-8309-2A78A7B7DA27","factor":"6DA23769-CA9C-482B-B9F3-78BFDE7EA8FB","alpha":"F70B9CB8-568E-4868-9529-CB3A54DAEF78","mode":"79DAC97E-6EAC-4A31-9195-D0E69C59C819","calpha":"gA026CFAF291B47238C894B4A865C2E2A_calpha","nodeType":"Fresnel"},{"uuid":"B26A0C39-3B6D-4B8E-B8BC-24EB725769DC","type":"f","src":"gA026CFAF291B47238C894B4A865C2E2A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BE52C837-0A04-4C9D-86C1-872943DAACCC","type":"f","value":1,"nodeType":"Float"},{"uuid":"D3D6ADC9-9E59-4E91-95F2-1912A5E01DD0","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"CED54D25-E4EB-4C07-8BF8-D307DCE508EE","nodeType":"Color"},{"uuid":"CED54D25-E4EB-4C07-8BF8-D307DCE508EE","type":"f","value":1,"nodeType":"Float"},{"uuid":"5938297F-1629-45E5-A2B3-4E2B03D614CC","type":"i","value":0,"nodeType":"Int"},{"uuid":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","type":"f","value":1,"nodeType":"Float"},{"uuid":"28318C5D-2966-4269-A1FB-4CE52FB1701B","type":"i","value":0,"nodeType":"Int"},{"uuid":"D4685A39-A2BB-4D2C-916D-13DCFE5F400F","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"18E4D7DF-D907-403D-A080-F5D2B54BDE35","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"124B676E-EC54-422D-8973-92867EB72914","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6B1865A7-7A63-490E-8528-91CBB70C8199","type":"f","value":1,"nodeType":"Float"},{"uuid":"B79AF409-A5F2-4CC3-8331-A94823E6E899","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"DA5623BC-F38C-425F-97CF-16281D8BD0F8","type":"f","value":1,"nodeType":"Float"},{"uuid":"459F0072-00C9-4A0A-B252-906151EA7E61","type":"f","value":1,"nodeType":"Float"},{"uuid":"44CD23FF-91BD-4556-9CED-CA27D121BB99","type":"i","value":0,"nodeType":"Int"},{"uuid":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9","type":"lambert","color":"D3D6ADC9-9E59-4E91-95F2-1912A5E01DD0","emissiveIntensity":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","shadingAlpha":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","shadingBlend":"28318C5D-2966-4269-A1FB-4CE52FB1701B","afterColor":"1D8C3583-8170-4236-9606-9EBE1A0DCF05","alpha":"B7DE09B2-19AF-448B-B4C2-F9439E93C607","emissive":"D4685A39-A2BB-4D2C-916D-13DCFE5F400F","nodeType":"Lambert"},{"uuid":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D8C3583-8170-4236-9606-9EBE1A0DCF05","type":"v3","a":"C83069A3-D40E-4016-992F-9979372B53F4","b":"EFC35046-14BD-4655-B9C6-DD6E83C94EF9","alpha":"F5A1956C-3D7D-440B-821C-F2669B89DDA3","mode":"44CD23FF-91BD-4556-9CED-CA27D121BB99","nodeType":"Blend"},{"uuid":"C83069A3-D40E-4016-992F-9979372B53F4","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"EFC35046-14BD-4655-B9C6-DD6E83C94EF9","type":"v3","color":"18E4D7DF-D907-403D-A080-F5D2B54BDE35","bias":"124B676E-EC54-422D-8973-92867EB72914","scale":"6B1865A7-7A63-490E-8528-91CBB70C8199","intensity":"B79AF409-A5F2-4CC3-8331-A94823E6E899","factor":"DA5623BC-F38C-425F-97CF-16281D8BD0F8","alpha":"459F0072-00C9-4A0A-B252-906151EA7E61","mode":"44CD23FF-91BD-4556-9CED-CA27D121BB99","calpha":"gEFC3504614BD4655B9C6DD6E83C94EF9_calpha","nodeType":"Fresnel"},{"uuid":"F5A1956C-3D7D-440B-821C-F2669B89DDA3","type":"f","src":"gEFC3504614BD4655B9C6DD6E83C94EF9_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B7DE09B2-19AF-448B-B4C2-F9439E93C607","type":"f","value":1,"nodeType":"Float"},{"uuid":"AB95BE10-A7F7-4F4D-A457-2EEF524EF18B","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"53F8CE4E-E285-4A34-BCEE-BE44911E99ED","nodeType":"Color"},{"uuid":"53F8CE4E-E285-4A34-BCEE-BE44911E99ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6B3EC91-055E-4717-8F68-CAEE97DFB135","type":"i","value":0,"nodeType":"Int"},{"uuid":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"968D04D9-56E9-40C6-90BD-CB97017364D0","type":"i","value":0,"nodeType":"Int"},{"uuid":"BC5AA259-1C04-4E2C-805A-E9756F121961","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"E47AB666-AA6A-4952-A983-66817CD1CB6D","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"F610D497-5C33-4854-9227-834A2A9F708B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E752A7B5-96D7-4EF5-9BB1-CCEE1D2C5615","type":"f","value":1,"nodeType":"Float"},{"uuid":"3CD42DE5-2700-44E4-9F46-F20EDB728484","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"E39A75F8-0990-4878-90C0-ACE8DBA691FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"B126824E-8574-4FF3-B4BC-A1877E729E4B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9179628-BA27-4BBE-BF0D-E40934B3AB2D","type":"i","value":0,"nodeType":"Int"},{"uuid":"4F33245C-5397-42B0-A855-0E78CCD99A46","type":"lambert","color":"AB95BE10-A7F7-4F4D-A457-2EEF524EF18B","emissiveIntensity":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","shadingAlpha":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","shadingBlend":"968D04D9-56E9-40C6-90BD-CB97017364D0","afterColor":"9C9DB692-4A7C-4805-B77A-0EAC78310F15","alpha":"D96F9E4C-4F5C-4FE5-AD89-C05EB8B3DB67","emissive":"BC5AA259-1C04-4E2C-805A-E9756F121961","nodeType":"Lambert"},{"uuid":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"9C9DB692-4A7C-4805-B77A-0EAC78310F15","type":"v3","a":"C936537B-7C49-4F60-AA17-D5EE77A0C9B2","b":"9827D4E8-3C71-435B-B9A7-FA4F0B910B92","alpha":"6AC56268-1133-4A73-B980-2A666BDE9220","mode":"C9179628-BA27-4BBE-BF0D-E40934B3AB2D","nodeType":"Blend"},{"uuid":"C936537B-7C49-4F60-AA17-D5EE77A0C9B2","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9827D4E8-3C71-435B-B9A7-FA4F0B910B92","type":"v3","color":"E47AB666-AA6A-4952-A983-66817CD1CB6D","bias":"F610D497-5C33-4854-9227-834A2A9F708B","scale":"E752A7B5-96D7-4EF5-9BB1-CCEE1D2C5615","intensity":"3CD42DE5-2700-44E4-9F46-F20EDB728484","factor":"E39A75F8-0990-4878-90C0-ACE8DBA691FE","alpha":"B126824E-8574-4FF3-B4BC-A1877E729E4B","mode":"C9179628-BA27-4BBE-BF0D-E40934B3AB2D","calpha":"g9827D4E83C71435BB9A7FA4F0B910B92_calpha","nodeType":"Fresnel"},{"uuid":"6AC56268-1133-4A73-B980-2A666BDE9220","type":"f","src":"g9827D4E83C71435BB9A7FA4F0B910B92_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D96F9E4C-4F5C-4FE5-AD89-C05EB8B3DB67","type":"f","value":1,"nodeType":"Float"},{"uuid":"1417E43A-9F14-466F-ACA5-ACC389AB8169","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"4A04628F-276B-4375-93C7-60501BB167AB","nodeType":"Color"},{"uuid":"4A04628F-276B-4375-93C7-60501BB167AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"A133C448-3BE4-4B4F-BC59-8699447ABEF4","type":"f","value":1,"nodeType":"Float"},{"uuid":"940D82A7-0CB2-4055-A943-230701B03652","type":"i","value":0,"nodeType":"Int"},{"uuid":"E63F86A6-BA59-4F29-B678-8ED4D8471F11","type":"f","value":1,"nodeType":"Float"},{"uuid":"AA5CDD90-A344-42D3-BF4E-5663025266B1","type":"i","value":0,"nodeType":"Int"},{"uuid":"B2952A0B-050D-4439-B656-F329AFE383C8","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"551DB44B-7ACF-4D3E-BACE-5D4887D30FB2","type":"f","value":0,"nodeType":"Float"},{"uuid":"01285CFB-3CFC-4F57-BA92-92D148678022","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"3F9623D3-F790-4E8A-B835-D185962CEC44","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"9805630D-D62D-4CA2-A308-629E619E050C","nodeType":"Color"},{"uuid":"9805630D-D62D-4CA2-A308-629E619E050C","type":"f","value":1,"nodeType":"Float"},{"uuid":"00722992-4051-493E-8643-1C6F3637C3CA","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E6066A2-FDB4-4C16-BC73-022AEF445B44","type":"i","value":0,"nodeType":"Int"},{"uuid":"D6740005-BF55-449E-8CF0-3D9DA715C9D7","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE757B95-88F1-4886-AD27-ACC433625558","type":"i","value":0,"nodeType":"Int"},{"uuid":"F4A47EE6-278C-4CAA-BA94-EB516DE7FD4C","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"0E2A281A-1735-43DA-B548-A8FBA039EFF1","type":"f","value":0,"nodeType":"Float"},{"uuid":"88020E4E-34B4-48A5-B3BC-B792DDCE5859","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1E6FC46E-9F25-4D10-ADB4-A808EF6B7854","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"175E9E56-2DC0-4814-B24C-B33B89F4BF6A","nodeType":"Color"},{"uuid":"175E9E56-2DC0-4814-B24C-B33B89F4BF6A","type":"f","value":1,"nodeType":"Float"},{"uuid":"5AE13ADB-8773-40A4-A983-BECA5A1FA5C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"045DD1F7-FA16-449E-A371-2CBB62835D94","type":"f","value":1,"nodeType":"Float"},{"uuid":"977B51E3-7455-44CD-861C-D24D89910145","type":"i","value":0,"nodeType":"Int"},{"uuid":"1EA8D444-06B3-4061-9E7A-814A69D0BD1F","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"AB8EC200-48DD-49BB-A965-DD2FC2E18175","type":"f","value":0,"nodeType":"Float"},{"uuid":"4E1BEDFD-839D-4E49-802F-7A34568E9856","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B596CBF4-47E7-421C-96DE-33A33D478021","type":"standard","color":"1E6FC46E-9F25-4D10-ADB4-A808EF6B7854","roughness":"1EA8D444-06B3-4061-9E7A-814A69D0BD1F","metalness":"AB8EC200-48DD-49BB-A965-DD2FC2E18175","alpha":"D6E5FF86-133C-4292-A486-B446553F957E","reflectivity":"4E1BEDFD-839D-4E49-802F-7A34568E9856","shadingAlpha":"045DD1F7-FA16-449E-A371-2CBB62835D94","shadingBlend":"977B51E3-7455-44CD-861C-D24D89910145","nodeType":"Standard"},{"uuid":"D6E5FF86-133C-4292-A486-B446553F957E","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD1798CE-DDD3-4D5B-809D-C515A9BE7E1A","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"CEEBC5E8-DD49-4E1D-AE51-5342F4A4DA25","nodeType":"Color"},{"uuid":"CEEBC5E8-DD49-4E1D-AE51-5342F4A4DA25","type":"f","value":1,"nodeType":"Float"},{"uuid":"451D63C5-C515-4202-A7E0-88942EB7B301","type":"f","value":1,"nodeType":"Float"},{"uuid":"592C76B8-54D4-4A93-9962-5647D3F2DCBE","type":"i","value":0,"nodeType":"Int"},{"uuid":"72AA4BC0-270D-47EA-93B0-5923117E94C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D20ABEC-189E-4B20-9D63-D622D863AFEE","type":"i","value":0,"nodeType":"Int"},{"uuid":"44EEDBEE-7C40-443E-83DB-571181759EEF","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"85EC2ABC-2995-4BC7-9BD6-9160C1C543B0","type":"f","value":0,"nodeType":"Float"},{"uuid":"EA455B25-FA03-4668-9768-2546333D9AB4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CFB6F49A-732C-4617-A670-31BE4546478B","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"0708A936-9EB5-4272-B828-52184AE975CF","nodeType":"Color"},{"uuid":"0708A936-9EB5-4272-B828-52184AE975CF","type":"f","value":1,"nodeType":"Float"},{"uuid":"BDB5B109-48F2-41E2-A517-2F5987158878","type":"f","value":1,"nodeType":"Float"},{"uuid":"3153A8B8-FF61-41C0-B0BF-7BE0180F94AC","type":"i","value":0,"nodeType":"Int"},{"uuid":"F8FA8C30-4572-4DBF-80D2-5FAFBEC5A5CF","type":"f","value":1,"nodeType":"Float"},{"uuid":"87430EA3-FFE0-4213-AA8B-31053F94FA09","type":"i","value":0,"nodeType":"Int"},{"uuid":"900374C4-1949-4241-AEA3-0612DEE0773C","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"52510887-4A84-449E-8648-695A87479907","type":"f","value":0,"nodeType":"Float"},{"uuid":"688F22E9-E80B-451A-BC9B-A10D65934AA4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"ACBCDA34-C358-4039-B223-BED488CC85A9","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"7CCB88C3-9400-4C20-999C-8CCE6845C95A","nodeType":"Color"},{"uuid":"7CCB88C3-9400-4C20-999C-8CCE6845C95A","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E682B5F-40F4-44E5-8164-FBDBC2ABE0DF","type":"i","value":0,"nodeType":"Int"},{"uuid":"3C33CA56-64F4-4583-B345-616CB24E8DB6","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A49786F-8CCB-401F-B44D-92AA4C228293","type":"i","value":0,"nodeType":"Int"},{"uuid":"339CA49D-4641-49C2-A85C-762B67E6F6DD","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"DC41BF18-9CE7-4A0B-B0F5-DDEB25297D72","type":"f","value":0,"nodeType":"Float"},{"uuid":"18A21C95-97FF-4B2C-85D6-FCBA3187F80E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"92EC580A-350F-4E4F-B288-DD7C442F6F91","type":"standard","color":"ACBCDA34-C358-4039-B223-BED488CC85A9","roughness":"339CA49D-4641-49C2-A85C-762B67E6F6DD","metalness":"DC41BF18-9CE7-4A0B-B0F5-DDEB25297D72","alpha":"9FA3EBAA-0BA4-4832-8770-C4BBD288A7E0","reflectivity":"18A21C95-97FF-4B2C-85D6-FCBA3187F80E","shadingAlpha":"3C33CA56-64F4-4583-B345-616CB24E8DB6","shadingBlend":"6A49786F-8CCB-401F-B44D-92AA4C228293","nodeType":"Standard"},{"uuid":"9FA3EBAA-0BA4-4832-8770-C4BBD288A7E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"007464D7-373E-434A-BD37-C923F6935592","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"860BC172-3199-4978-AE9F-C9BDD644ECAE","nodeType":"Color"},{"uuid":"860BC172-3199-4978-AE9F-C9BDD644ECAE","type":"f","value":1,"nodeType":"Float"},{"uuid":"3C72490D-DE47-484C-B20F-F2F80494A2B6","type":"f","value":1,"nodeType":"Float"},{"uuid":"B26E6517-9847-486D-B9F6-73464FD2070C","type":"i","value":0,"nodeType":"Int"},{"uuid":"CB2CD82F-5669-4F88-948F-1D4D58A6A9E9","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB8F6541-57E3-4003-8398-B923172BE8AC","type":"i","value":0,"nodeType":"Int"},{"uuid":"B7F209D3-0207-4AFE-A14F-70BC506B9BEA","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"11C3B2DF-DFDC-4D5A-B297-7F7CC25E9B47","type":"f","value":0,"nodeType":"Float"},{"uuid":"C2477DDA-B0DB-4E45-9035-4737BC3D96AC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F3452C62-ED3F-4638-A771-098E53A5C71F","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"F338FEEB-3C14-4AEA-B321-21FBBBE50BCC","nodeType":"Color"},{"uuid":"F338FEEB-3C14-4AEA-B321-21FBBBE50BCC","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A0CB83A-DF65-4119-94BD-72C904DFBC52","type":"f","value":1,"nodeType":"Float"},{"uuid":"DF96C0EB-2409-442B-9D38-D1CF736F935E","type":"i","value":0,"nodeType":"Int"},{"uuid":"93EE6DDB-FEA9-4D7A-A018-9BB15F921E17","type":"f","value":1,"nodeType":"Float"},{"uuid":"E8DF9EDB-94A2-4A86-A02C-2F6D196B7167","type":"i","value":0,"nodeType":"Int"},{"uuid":"7693D1B1-C2E4-49B7-A3C9-5AF4FF695DBC","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"A6FC7B1B-D117-464E-9798-5539CEE04410","type":"f","value":0,"nodeType":"Float"},{"uuid":"56DB8E82-3ABD-440F-B0B3-1655A19A690A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"5024DF11-917B-4884-8065-D37522F9F160","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"CC5C1C73-B573-47C8-A7EE-B4EFDE399AC8","nodeType":"Color"},{"uuid":"CC5C1C73-B573-47C8-A7EE-B4EFDE399AC8","type":"f","value":1,"nodeType":"Float"},{"uuid":"F3324909-40C2-4AEA-988B-B96F1BE96308","type":"i","value":0,"nodeType":"Int"},{"uuid":"7BF8E781-74D6-4FAB-96BE-D5412B149CFC","type":"f","value":1,"nodeType":"Float"},{"uuid":"DCE284D3-3CB0-4031-9689-8329EE17C8EF","type":"i","value":0,"nodeType":"Int"},{"uuid":"329BC257-1FEF-48FD-AC4C-AC9C9A9DBEAC","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"4D4CB616-41FB-471A-BC3C-2D722517B5FB","type":"f","value":0,"nodeType":"Float"},{"uuid":"C66E4BEA-CDF0-4577-9246-B7D43BF0A2BD","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"D393F0AC-F9F4-4B89-829B-BB848A78CC48","type":"standard","color":"5024DF11-917B-4884-8065-D37522F9F160","roughness":"329BC257-1FEF-48FD-AC4C-AC9C9A9DBEAC","metalness":"4D4CB616-41FB-471A-BC3C-2D722517B5FB","alpha":"45A4D459-9564-4DC0-A5A6-BBAA92E47E23","reflectivity":"C66E4BEA-CDF0-4577-9246-B7D43BF0A2BD","shadingAlpha":"7BF8E781-74D6-4FAB-96BE-D5412B149CFC","shadingBlend":"DCE284D3-3CB0-4031-9689-8329EE17C8EF","nodeType":"Standard"},{"uuid":"45A4D459-9564-4DC0-A5A6-BBAA92E47E23","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1456,1210],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/font_light/index.html b/site/spline/design/font_light/index.html deleted file mode 100644 index 19a8a91aa..000000000 --- a/site/spline/design/font_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/font_light/runtime.js b/site/spline/design/font_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/font_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxg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Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/font_light/scene.json b/site/spline/design/font_light/scene.json deleted file mode 100644 index ccee344d3..000000000 --- a/site/spline/design/font_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"D11A1401-2783-446E-8F0F-57A85E87B969","objectType":"EmptyObject","name":"Empty Object 2","matrix":[1,0,0,0,0,0.9396926207859078,-0.3420201433256687,0,0,0.3420201433256687,0.9396926207859078,0,-167.0000000000001,23.996523342699845,-8.308763260530334,1],"layers":1,"children":[{"uuid":"7AF8FD1F-BC80-4D37-BBEF-C5D6059B2263","objectType":"Mesh3D","name":"Cube copy 15","matrix":[1,0,0,0,0,0.9999999999999999,-5.551115123125783e-17,0,0,5.551115123125783e-17,0.9999999999999999,0,-167.00000000000009,23.996523342699845,-9.704327404526182,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,167.0000000000001,-23.996523342699845,8.308763260530334,1],"interaction":{"uuid":"11FE0FBD-07EA-42DA-A960-E1334B6285CF"},"geometry":"BBE0D3B1-9115-44D0-B327-31FB7CFD9595","material":"6B51F35F-1CDB-4EF0-AAD1-6E1AEE134B1D"},{"uuid":"CD5BBAC0-CFAB-4575-A2BA-DBE4070BC412","objectType":"VectorObject","name":"Shape copy 3","matrix":[0.9999999999999999,0,0,0,0,1.0000000000000009,-1.2143841381447813e-16,0,0,1.2143841381447813e-16,1.0000000000000009,0,-123.2587229585908,-217.03909649452757,-159.26112468260712,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.1427840147035844,0,0,0,0,1.1427840147035842,0,0,0,0,1.1427840147035844,0,73.04201915318966,213.43386177443762,178.82651933032918,1],"interaction":{"uuid":"F8A2718A-8BCA-40DE-98D4-B5382CF8ADF0"},"geometry":"3F9FB91A-0F67-489D-85FE-927A10B8665D","material":"81AD46BB-1493-4B55-9759-3D253DA0326E"},{"uuid":"09CDABF8-9E0E-45D5-8AA8-895713095EEB","objectType":"VectorObject","name":"Shape copy 3","matrix":[0.9999999999999999,0,0,0,0,1.0000000000000009,-1.2143841381447813e-16,0,0,1.2143841381447813e-16,1.0000000000000009,0,-58.545409290764326,-216.83155346735938,-158.9279023867273,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.1427840147035844,0,0,0,0,1.1427840147035842,0,0,0,0,1.1427840147035844,0,73.04201915318966,213.43386177443762,178.82651933032918,1],"interaction":{"uuid":"33076125-CD5E-48A9-88E7-30487F2C53A1"},"geometry":"759446BC-A7C6-450B-9147-7F1FEC72CD62","material":"5F3DA08B-F52F-4E49-B4B1-3E38C40CEA13"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D7DED7AD-ABB8-4F92-BA10-D602E2224AE1","selectedState":0,"states":["274385EE-94F2-4E5B-B7B9-E40E6720FB66","C49BDF8A-86ED-4E2F-AC93-1253180D5EF0"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D11A1401-2783-446E-8F0F-57A85E87B969","state":"C49BDF8A-86ED-4E2F-AC93-1253180D5EF0"}]}]},"enableHelper":true},{"uuid":"C7EF8605-4BCB-4C22-906F-1BEFDC62D0A3","objectType":"Mesh3D","name":"Cube copy 14","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-5.596745068776386,-185.5984449064932,83.90449870945913,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"interaction":{"uuid":"4D5F8AEB-AC67-4A9E-B1D9-8A8DBD3A7F4C","selectedState":0,"states":["5C9683A9-D4DC-43A5-96D9-09C7FDD3B89C","1B6C8C26-65A8-4B6E-B5FF-82935CF624D3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C7EF8605-4BCB-4C22-906F-1BEFDC62D0A3","state":"1B6C8C26-65A8-4B6E-B5FF-82935CF624D3"}]}]},"geometry":"D8B42F4C-89D6-432D-90ED-05E9F740B7B8","material":"56491EC7-E97C-4BDD-B62A-E801226AE0CD"},{"uuid":"9484C79D-D9A0-4E71-994F-B060969FAFDA","objectType":"Mesh3D","name":"Cube copy 13","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,192.69534235511117,-144.12250620252024,-60.08034172670993,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"interaction":{"uuid":"1676B4B1-EDD9-4B9C-BB38-2730ED63DC5A","selectedState":0,"states":["8A11AB09-4F67-4162-B9E8-8036F48D03AE","20503FE1-3E52-4A9D-9029-14B457E9A782"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"9484C79D-D9A0-4E71-994F-B060969FAFDA","state":"20503FE1-3E52-4A9D-9029-14B457E9A782"}]}]},"geometry":"336DF3AE-439F-45A3-8D16-292B6EF17E3F","material":"8E22E05B-E635-44EB-AB44-D6A5583A6B62"},{"uuid":"6DC94026-CAEA-4539-98B1-EDB3B190F1D3","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,360.1446709076129,-247.13774958036134,-119.86555037509562,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"interaction":{"uuid":"E574EEE6-9AA7-4E9B-9D7A-82532D0C38DF","selectedState":0,"states":["902FF276-7544-4C91-95D2-D1ADECC18ECA","C78E1C9F-CF2E-487C-ACD0-37B561D99A79"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6DC94026-CAEA-4539-98B1-EDB3B190F1D3","state":"C78E1C9F-CF2E-487C-ACD0-37B561D99A79"}]}]},"geometry":"663D8D47-61C8-4844-919E-194BD96C2462","material":"D7FF7C3D-9D2C-4201-BAD9-BDE12A910475"},{"uuid":"D8811FF2-11F9-4F9B-8124-3829DA13D95F","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,77.64707881858095,10.251627470154062,-302.8586838226405,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"interaction":{"uuid":"C45EF014-6945-4BFE-8A44-0ACFE334D140","selectedState":0,"states":["12A6232F-B353-428E-8574-C9A22297CEBD","132540F2-699A-4A38-8617-DA6997FDC59A"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D8811FF2-11F9-4F9B-8124-3829DA13D95F","state":"132540F2-699A-4A38-8617-DA6997FDC59A"}]}]},"geometry":"BB0EBE1F-1FF0-47FE-B6A8-47DAE4449056","material":"79F992FF-4AA2-4283-8041-91DC12D02D56"},{"uuid":"BA0875EE-47C8-4C63-B4CC-FFD72976F5A0","objectType":"CombinedCamera","name":"Camera","matrix":[0.911443640079891,-6.938893903907227e-18,-0.41142495179305505,0,-0.11162903938175676,0.9624883617849055,-0.24729559437101523,0,0.3959917278487315,0.2713229688555828,0.8772538959997659,0,-196.73234098518066,305.03135101541534,1134.3835261567003,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"8F8109BF-0EFA-4118-AC08-B1D12D8C4CDE"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000025,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.7999096840045195,-2.7755575615628914e-17,-0.6001204024492001,0,-0.2717961677743277,0.8915599353950845,-0.36228127854127695,0,0.5350433072368809,0.452902728627586,0.7131674261929718,0,503.59174807543496,414.86924314906184,734.9575860928703,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":999.9999999999994,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1.10803324099723,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"477B45FB-0CEC-4418-9CD4-1AADCF7E9BDD","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-9.874986612800136,104.94933575476239,14.97687790345105,1],"visible":false,"layers":1,"children":[{"uuid":"D653BF28-DB4D-4214-93C1-D89624805F90","objectType":"VectorObject","name":"b","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-70.18832076348787,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"6EBBECB1-C172-4475-8721-B3658B125F56"},"geometry":"1A1B7E11-0B62-43C0-91FC-8498CF7591BF","material":"86FB4F14-8863-4DD5-96ED-7C2A38332463"},{"uuid":"95C16058-3F8A-4D72-B1E3-1F63BA1C094C","objectType":"VectorObject","name":"B","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-124.60832076348785,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"D85793C3-3D03-4711-B90D-F06F1D0C8E71"},"geometry":"A483F1C7-A2C3-46A4-897A-7307D854FCCF","material":"782F065F-6424-4F97-9386-A78123ED1E87"},{"uuid":"9ADC19C8-FB88-4BD1-BC92-E7072FBAB0C1","objectType":"VectorObject","name":"A","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-241.96832076348784,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"155FBE4C-0C5C-4B8B-B394-269EF814C169"},"geometry":"E75C664D-36AD-41DC-A98F-70442833730C","material":"189E7DE7-554F-4586-A8C2-0A75A6EF7F20"},{"uuid":"893730E3-014F-4599-AD9C-8E0C638D2024","objectType":"VectorObject","name":"a","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-181.12832076348784,-319.64433371410087,-198.8040574457009,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[0.9360803740853351,0,0,0,0,0.9360803740853351,0,0,0,0,0.9360803740853351,0,120.23548653010755,270.6248927211115,178.60793347077146,1],"interaction":{"uuid":"652D729A-1904-45B2-83C2-CE4AE05AE188"},"geometry":"395B32B7-DE93-4950-BFEE-F467B98918EA","material":"573A77EE-69E6-466D-A463-8811B4821D26"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"FE9DF28F-9A44-4C1F-825B-46715ABBC2C3"},"enableHelper":true},{"uuid":"51942A5E-47DB-494F-BAEF-4D8C2A8406D6","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,-32.15740815566272,10.73403219790113,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"E02F84AA-59C0-4450-8EC1-851D8D01C48A","selectedState":0,"states":["EE82309E-A200-42C9-9462-FF5D6473B526","E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"51942A5E-47DB-494F-BAEF-4D8C2A8406D6","state":"E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7"}]}]},"geometry":"7E4C85E4-83F0-4F2F-AF5C-0593EE86C0CB","material":"8219290D-5466-451F-B53F-87E9B670F0AD"},{"uuid":"8DAA5FE6-9B7D-4345-ACB7-B735C113AC90","objectType":"Mesh3D","name":"Cube","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,24.224149091491782,-9.787176401639002,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9675676E-5E9F-4351-B012-AC475395B1BC","selectedState":0,"states":["F4BDF665-5016-47C9-BA1A-52F1848C4F7A","78542D85-AC24-42D2-B2B4-474E43CA74BE"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"8DAA5FE6-9B7D-4345-ACB7-B735C113AC90","state":"78542D85-AC24-42D2-B2B4-474E43CA74BE"}]}]},"geometry":"426B95BD-CB3C-4ED6-B430-3071A84B7B73","material":"C512B1E2-7E3A-45BC-A205-8FCF8BAD3EB6"},{"uuid":"2A98E9C9-1C1C-472F-B8EE-EA9A68CB7B01","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,14.943446944406745,80.60570633864633,-30.308385001179136,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A8BDF44F-E095-4DBE-9D1F-817E3C61905E","selectedState":0,"states":["63E0609F-DDBF-490F-B465-574A2C4AAB53","8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"2A98E9C9-1C1C-472F-B8EE-EA9A68CB7B01","state":"8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B"}]}]},"geometry":"6443E63D-FEDC-4902-B80D-3F837CAB103F","material":"16642A27-0B81-4DF1-A566-8DA4B1FFFB8C"}],"activeCamera":"BA0875EE-47C8-4C63-B4CC-FFD72976F5A0","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"BBE0D3B1-9115-44D0-B327-31FB7CFD9595","userData":{"parameters":{"width":180,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":180,"depth":32},"type":"CubeGeometry"}},{"uuid":"3F9FB91A-0F67-489D-85FE-927A10B8665D","userData":{"parameters":{"width":109,"subdivisions":40,"roundness":2,"extrudeDepth":18,"surfaceMaxCount":100,"extrudeBevelSize":0,"extrudeBevelSegments":3,"height":109,"depth":18},"shape":{"points":[45.12600000000001,11.706600000000002,45.12600000000001,11.706600000000002,45.12600000000001,11.706600000000002,2,21.058800000000005,11.706600000000002,21.058800000000005,11.706600000000002,21.058800000000005,11.706600000000002,2,17.069400000000005,0,17.069400000000005,0,17.069400000000005,0,2,0.7193999999999999,0,0.7193999999999999,0,0.7193999999999999,0,2,24.263399999999997,63.76500000000001,24.263399999999997,63.76500000000001,24.263399999999997,63.76500000000001,2,42.11760000000001,63.76500000000001,42.11760000000001,63.76500000000001,42.11760000000001,63.76500000000001,2,65.66159999999999,0,65.66159999999999,0,65.66159999999999,0,2,49.115400000000015,0,49.115400000000015,0,49.115400000000015,0,2],"shapeHoles":[{"points":[41.13660000000001,23.543999999999993,41.13660000000001,23.543999999999993,41.13660000000001,23.543999999999993,2,33.1578,47.153400000000005,33.1578,47.153400000000005,33.1578,47.153400000000005,2,25.04820000000001,23.543999999999993,25.04820000000001,23.543999999999993,25.04820000000001,23.543999999999993,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"759446BC-A7C6-450B-9147-7F1FEC72CD62","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":0,"extrudeBevelSegments":1,"height":100,"depth":16},"shape":{"points":[22.56,47.1,18.76,47.1,26.12,47.1,2,31.740000000000002,44.64,29.18,46.28,34.3,43.04,2,37.44,38.1,36.199999999999996,40.86,37.44,38.1,2,37.44,46.5,37.44,46.5,37.44,46.5,2,51.6,46.5,51.6,46.5,51.6,46.5,2,51.6,0,51.6,0,51.6,0,2,37.44,0,37.44,0,37.44,0,2,37.44,8.4,37.44,8.4,36.199999999999996,5.640000000000001,2,31.740000000000002,1.8599999999999999,34.3,3.4600000000000004,29.18,0.21999999999999992,2,22.56,-0.6,26.12,-0.6,18.76,-0.6,2,12.3,2.28,15.340000000000003,0.3599999999999999,9.260000000000002,4.2,2,5.1000000000000005,10.559999999999999,6.86,6.96,3.3800000000000003,14.2,2,2.52,23.28,2.52,18.44,2.52,28.16,2,5.1000000000000005,35.94,3.3800000000000003,32.379999999999995,6.86,39.54,2,12.3,44.22,9.260000000000002,42.300000000000004,15.340000000000003,46.14,2],"shapeHoles":[{"points":[27.18,34.56,30.18,34.56,24.1,34.56,2,19.8,31.560000000000002,21.64,33.56,17.92,29.560000000000002,2,16.98,23.28,16.98,26.800000000000004,16.98,19.72,2,19.8,14.94,17.92,16.939999999999998,21.64,12.940000000000001,2,27.18,11.940000000000001,24.1,11.940000000000001,30.18,11.940000000000001,2,34.56,15,32.64,12.96,36.48,17.04,2,37.44,23.28,37.44,19.8,37.44,26.76,2,34.56,31.560000000000002,36.48,29.520000000000003,32.64,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"D8B42F4C-89D6-432D-90ED-05E9F740B7B8","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"336DF3AE-439F-45A3-8D16-292B6EF17E3F","userData":{"parameters":{"width":150,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"663D8D47-61C8-4844-919E-194BD96C2462","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"BB0EBE1F-1FF0-47FE-B6A8-47DAE4449056","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"1A1B7E11-0B62-43C0-91FC-8498CF7591BF","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[33.900000000000006,47.1,30.340000000000003,47.1,37.74,47.1,2,44.22,44.22,41.18,46.14,47.260000000000005,42.300000000000004,2,51.36,35.94,49.64,39.54,53.12,32.379999999999995,2,54,23.28,54,28.16,54,18.44,2,51.36,10.559999999999999,53.12,14.2,49.64,6.96,2,44.22,2.28,47.260000000000005,4.2,41.18,0.3599999999999999,2,33.900000000000006,-0.6,37.74,-0.6,30.340000000000003,-0.6,2,24.78,1.8599999999999999,27.3,0.21999999999999992,22.220000000000002,3.4600000000000004,2,19.14,8.4,20.34,5.640000000000001,19.14,8.4,2,19.14,0,19.14,0,19.14,0,2,4.92,0,4.92,0,4.92,0,2,4.92,61.68,4.92,61.68,4.92,61.68,2,19.14,61.68,19.14,61.68,19.14,61.68,2,19.14,38.1,19.14,38.1,20.34,40.86,2,24.78,44.64,22.220000000000002,43.04,27.3,46.28,2],"shapeHoles":[{"points":[29.34,34.56,32.38,34.56,26.34,34.56,2,21.96,31.560000000000002,23.880000000000003,33.56,20.040000000000003,29.520000000000003,2,19.080000000000002,23.28,19.080000000000002,26.76,19.080000000000002,19.8,2,21.96,15,20.040000000000003,17.04,23.880000000000003,12.96,2,29.34,11.940000000000001,26.34,11.940000000000001,32.38,11.940000000000001,2,36.72,14.94,34.84,12.940000000000001,38.56,16.939999999999998,2,39.480000000000004,23.28,39.480000000000004,19.72,39.480000000000004,26.800000000000004,2,36.72,31.560000000000002,38.56,29.560000000000002,34.84,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"A483F1C7-A2C3-46A4-897A-7307D854FCCF","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":2593,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[40.260000000000005,30.36,43.3,31.080000000000002,43.82,29.52,2,48.720000000000006,25.14,46.64,27.779999999999998,50.8,22.54,2,51.839999999999996,16.080000000000002,51.839999999999996,19.52,51.839999999999996,11.040000000000001,2,46.800000000000004,4.260000000000001,50.16,7.1000000000000005,43.440000000000005,1.4200000000000002,2,32.34,0,38.620000000000005,0,32.34,0,2,4.92,0,4.92,0,4.92,0,2,4.92,58.92,4.92,58.92,4.92,58.92,2,31.68,58.92,31.68,58.92,37.68,58.92,2,45.6,55.02,42.32,57.620000000000005,48.879999999999995,52.38,2,50.519999999999996,43.86,50.519999999999996,48.66,50.519999999999996,40.3,2,47.64,34.98,49.559999999999995,37.339999999999996,45.760000000000005,32.62,2],"shapeHoles":[{"points":[19.14,34.86,19.14,34.86,19.14,34.86,2,28.500000000000004,34.86,28.500000000000004,34.86,33.46,34.86,2,35.94,41.160000000000004,35.94,36.96,35.94,45.400000000000006,2,28.32,47.52,33.4,47.52,28.32,47.52,2,19.14,47.52,19.14,47.52,19.14,47.52,2],"shapeHoles":[],"isClosed":true,"roundness":0},{"points":[29.34,11.58,29.34,11.58,34.62,11.58,0,37.26,18.06,37.26,13.74,37.26,20.18,0,35.16,23.04,36.559999999999995,21.84,33.76,24.240000000000002,0,29.28,24.840000000000003,31.8,24.840000000000003,29.28,24.840000000000003,0,19.14,24.840000000000003,19.14,24.840000000000003,19.14,24.840000000000003,0,19.14,11.58,19.14,11.58,19.14,11.58,0],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"E75C664D-36AD-41DC-A98F-70442833730C","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":100,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[41.400000000000006,10.74,41.400000000000006,10.74,41.400000000000006,10.74,2,19.32,10.74,19.32,10.74,19.32,10.74,2,15.66,0,15.66,0,15.66,0,2,0.6599999999999999,0,0.6599999999999999,0,0.6599999999999999,0,2,22.259999999999998,58.5,22.259999999999998,58.5,22.259999999999998,58.5,2,38.64,58.5,38.64,58.5,38.64,58.5,2,60.24,0,60.24,0,60.24,0,2,45.06,0,45.06,0,45.06,0,2],"shapeHoles":[{"points":[37.74,21.599999999999998,37.74,21.599999999999998,37.74,21.599999999999998,2,30.42,43.26,30.42,43.26,30.42,43.26,2,22.98,21.599999999999998,22.98,21.599999999999998,22.98,21.599999999999998,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"395B32B7-DE93-4950-BFEE-F467B98918EA","userData":{"parameters":{"width":100,"subdivisions":40,"roundness":2,"extrudeDepth":16,"surfaceMaxCount":3175,"extrudeBevelSize":4,"extrudeBevelSegments":3,"height":100,"depth":16},"shape":{"points":[22.56,47.1,18.76,47.1,26.12,47.1,2,31.740000000000002,44.64,29.18,46.28,34.3,43.04,2,37.44,38.1,36.199999999999996,40.86,37.44,38.1,2,37.44,46.5,37.44,46.5,37.44,46.5,2,51.6,46.5,51.6,46.5,51.6,46.5,2,51.6,0,51.6,0,51.6,0,2,37.44,0,37.44,0,37.44,0,2,37.44,8.4,37.44,8.4,36.199999999999996,5.640000000000001,2,31.740000000000002,1.8599999999999999,34.3,3.4600000000000004,29.18,0.21999999999999992,2,22.56,-0.6,26.12,-0.6,18.76,-0.6,2,12.3,2.28,15.340000000000003,0.3599999999999999,9.260000000000002,4.2,2,5.1000000000000005,10.559999999999999,6.86,6.96,3.3800000000000003,14.2,2,2.52,23.28,2.52,18.44,2.52,28.16,2,5.1000000000000005,35.94,3.3800000000000003,32.379999999999995,6.86,39.54,2,12.3,44.22,9.260000000000002,42.300000000000004,15.340000000000003,46.14,2],"shapeHoles":[{"points":[27.18,34.56,30.18,34.56,24.1,34.56,2,19.8,31.560000000000002,21.64,33.56,17.92,29.560000000000002,2,16.98,23.28,16.98,26.800000000000004,16.98,19.72,2,19.8,14.94,17.92,16.939999999999998,21.64,12.940000000000001,2,27.18,11.940000000000001,24.1,11.940000000000001,30.18,11.940000000000001,2,34.56,15,32.64,12.96,36.48,17.04,2,37.44,23.28,37.44,19.8,37.44,26.76,2,34.56,31.560000000000002,36.48,29.520000000000003,32.64,33.56,2],"shapeHoles":[],"isClosed":true,"roundness":0}],"isClosed":true,"roundness":2},"type":"VectorGeometry"}},{"uuid":"7E4C85E4-83F0-4F2F-AF5C-0593EE86C0CB","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}},{"uuid":"426B95BD-CB3C-4ED6-B430-3071A84B7B73","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}},{"uuid":"6443E63D-FEDC-4902-B80D-3F837CAB103F","userData":{"parameters":{"width":190,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":60,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"6B51F35F-1CDB-4EF0-AAD1-6E1AEE134B1D","type":"ShaderMaterial","emissiveIntensity":{"uuid":"B11C4A62-B337-4A9B-BBBE-ECE710A84674","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"9BF73D96-FD40-4A37-B8B2-A4BD4769E229","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"A41DE68A-71A7-4BB2-94E1-1B921ECE312F","f0_alpha":"8CA287FB-5604-4EFF-9817-5AC88D24FC71","f0_mode":"8498961C-ABB5-45F7-B50B-D4107ABA39DA"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B651EB71-FD50-481B-87D5-BCEE30E024ED","f1_mode":"6A2513B6-D079-4DB3-9D7B-33CAC451FD9B","f1_emissive":"BBD76A44-90B5-4343-BEC7-57B88C6F393D"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"0BD3B700-8151-4CFC-8050-9A9C0079F0E0","f2_bias":"860FD2BF-F5C6-4E25-8906-17BFF4CF9760","f2_scale":"10C6F0D7-5370-439D-BFB7-58B54E27888F","f2_intensity":"C527E2D9-FF92-4ED6-88BC-B34BD7BEE3F1","f2_factor":"9B29B377-30C3-49E5-B5F3-8353BDEFD369","f2_alpha":"2820272E-EF74-4E3F-8A27-2ED4C7AAF58F","f2_mode":"6701E5EF-D5B2-420A-B0D8-869D40AE9EB7"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"7110D950-C882-4569-8DC2-9D1FA1F11CA7","fragment":"7110D950-C882-4569-8DC2-9D1FA1F11CA7"},{"uuid":"81AD46BB-1493-4B55-9759-3D253DA0326E","type":"ShaderMaterial","emissiveIntensity":{"uuid":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"52D054BB-A270-4A79-B02E-88FA4AFC4FA6","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"F719137C-BF52-4EA4-B825-512CC6A831EB","f0_alpha":"2E48C9D0-6B61-4D8E-B3D5-C58476E6A431","f0_mode":"C8FCF898-8E62-4841-B145-5701F598B13A"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","f1_mode":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","f1_emissive":"CD252BD4-F2C5-4F3E-A95B-B93E8B6E6C45"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"4F8DFDD3-F285-4D6F-BF38-93FC6E366AA4","f2_bias":"71E6F361-747A-4AFF-BD8B-0620C8F49EBB","f2_scale":"300BFC03-97C3-4873-A895-DEA453814A7D","f2_intensity":"C2BBB738-AAC9-4890-8B6F-956E6CB676C8","f2_factor":"7752D19A-D288-4F3B-9AE8-DDEC332BEA4E","f2_alpha":"BE3D897D-D7EF-4EDF-9F5D-CA52D9BA7CE1","f2_mode":"DECF1B5C-E445-414F-9205-4E9AFDC71A2B"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A","fragment":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A"},{"uuid":"5F3DA08B-F52F-4E49-B4B1-3E38C40CEA13","type":"ShaderMaterial","emissiveIntensity":{"uuid":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"76DD1A8B-4961-4534-A10D-B16FC43F56B9","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"B2070508-F739-4757-B074-1607BEE9968F","f0_alpha":"DF76C6F8-0FFB-4FFF-94C3-64ED5E01A9BD","f0_mode":"75518605-8F9C-4099-B3C7-7C055F718333"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","f1_mode":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","f1_emissive":"8B8DA941-89B0-4209-B96F-05B4D5A3A157"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"DFE7530C-13D1-46D1-93A7-C017BFADA319","f2_bias":"30F85C16-241D-4F9D-8A8B-AC4E4DC52B74","f2_scale":"915C8773-4181-4FA7-B9F4-88E9FD0C6430","f2_intensity":"FC57D027-8A73-49D2-8AB5-E910EBDADBB4","f2_factor":"7C54559A-909B-48E6-AA31-9FE9119D7787","f2_alpha":"B2C37AB7-1FD4-433F-8E1E-79EF6D315D66","f2_mode":"93592C43-6F04-4B12-9C50-EF5F72743774"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7","fragment":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7"},{"uuid":"56491EC7-E97C-4BDD-B62A-E801226AE0CD","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4D135037-5761-46B2-8FAA-4ACDD5AE8215","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D4ABAC86-1ECB-41D0-8DC8-90514C760EA7","f1_mode":"B2743DAF-405F-42A8-924E-B20E2E229DB1","f1_shininess":"5BDB981F-D98D-4C7D-9D72-266C6CA3E5A7","f1_specular":"0E6FEB4C-6DA6-40DC-A555-472255A93255"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"7F847337-ECF4-4514-AF0C-E954EF687837","f2_ior":"3234FB7A-FF31-419C-B10E-3FF30790006B","f2_roughness":"04CA929A-A440-49A3-B415-1BC350BC2548","f2_transmissionSamplerSize":"2F4BED1C-5F4D-45E4-97BE-78F4087CF114","f2_transmissionSamplerMap":"CD0AA887-7593-4E29-9466-7DC48A37B928","f2_transmissionDepthMap":"C74486FF-4694-49FF-B5C1-59FB08332B80","f2_aspectRatio":"07D8AC7E-AABA-4C1E-976A-736BAE3790A2","f2_alpha":"91422881-5B7A-420E-AB48-37B9C9837652","f2_mode":"C9F5F553-EB92-4ECC-9EFD-6970A7465AE8"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"7FBD432E-0D22-4A61-AA39-70DA29B2CDAE","f4_far":"4DEF9DD3-05E3-4B58-9A17-743E446AFB44","f4_isVector":"0E94197D-4C40-421F-919D-EECB9F7C5684","f4_isWorldSpace":"7FB9A18F-EDBD-4EFC-BFDD-E5CC6F7FA887","f4_origin":"F5CA8D31-637C-4F84-9600-02BE4609C699","f4_colorA":"FD7A1959-0F04-41C8-A02F-6C612E39FF3E","f4_colorB":"93C38895-D3C2-4AC2-99DA-DE7B87CF497D","f4_alpha":"3BF5669B-84DF-4C24-AAD5-856A00F354CE","f4_mode":"1A2843A9-ECA1-4791-B5C6-DF22079D6D30"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8AFD6099-E2EF-4A13-B8D9-E636F0A9B7DD","f3_bias":"07F650EF-CD4A-4655-AF31-97623A6928AA","f3_scale":"FC972A36-1EF5-488C-949F-6912561460B5","f3_intensity":"3935D53B-D8D2-42E2-B05C-6BC12954A136","f3_factor":"AC394121-E9DF-43E2-A1E6-B9D26FF38587","f3_alpha":"300E664D-E035-453A-9B73-07DA29B76074","f3_mode":"1E60ECA1-3FB5-4C75-890A-B6907AA9B258"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"ADEB6C3D-CE9E-4DBE-BFCF-B61C1BCA8BAC","fragment":"ADEB6C3D-CE9E-4DBE-BFCF-B61C1BCA8BAC"},{"uuid":"8E22E05B-E635-44EB-AB44-D6A5583A6B62","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4D1F429D-B14B-484F-A01B-7F221885E1E1","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"45E7AEB9-2102-4DB1-83FF-55CA45148D58","f1_mode":"DDA481FD-9FCC-43F5-8439-23EA5AD1BDB2","f1_shininess":"3DB281B5-F694-46F3-BF7F-9E8621688964","f1_specular":"1864FCEE-12B0-4083-B860-4D719020FBBA"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"491DA96E-A3FF-4D05-B3E0-FE5279AE716A","f2_ior":"B35FD5E2-A120-48D9-B15F-13C257983630","f2_roughness":"F194608B-0808-46BF-AC97-73A20BDC1A18","f2_transmissionSamplerSize":"FBD449C4-5519-4F7A-97DE-548C12BE26FF","f2_transmissionSamplerMap":"54DFCBD9-B44C-4A7C-B0A1-EA7D63CB54B3","f2_transmissionDepthMap":"ED58C007-4733-44BA-B707-800667B3EA0F","f2_aspectRatio":"B3A22F63-86BD-4ECF-86FD-F00F24B52B52","f2_alpha":"3A5742C0-5103-4C3B-8E4E-B6DC394BE87A","f2_mode":"8680F2C8-F8CA-4D50-BF81-BF78F72910D3"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4EB5AF97-9608-4A9A-8139-3AEC4AF143D3","f4_far":"81D0427E-1644-48A6-B9EE-FDA467907831","f4_isVector":"CA1FFA70-EB60-4934-9A84-EC49289C4869","f4_isWorldSpace":"459A2302-A722-4B7B-B139-D395ECC96B18","f4_origin":"B7F10256-07FD-42CA-A9D5-A828A5B71830","f4_colorA":"12A7FD91-D94B-434C-A678-8ECE38B6E49E","f4_colorB":"468DD8F3-DFC4-4702-ABE2-4FE7D83DFA09","f4_alpha":"C0FE718E-50FF-422F-BEBD-827EED30A327","f4_mode":"30038AC1-CD06-4080-86DF-DFC231023C5B"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"51D0E871-524F-4F56-9865-29CB6FE44EA5","f3_bias":"AA6F04BB-0324-4A1F-871E-A8C0F3EBD726","f3_scale":"BE01F939-B249-4DC6-9854-D9B379E9BCC9","f3_intensity":"0D48A87C-9E4C-45FA-9779-BD0D34EB546D","f3_factor":"BBF70BBD-DB16-4E9B-BF87-A452001D9F49","f3_alpha":"BBAD0BC5-9260-4CC5-AB28-E535E984CB85","f3_mode":"D478EDDA-0D62-4559-A8DC-97B746DCB6CD"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"417B1E61-6628-480A-9583-17E0897A3BAF","fragment":"417B1E61-6628-480A-9583-17E0897A3BAF"},{"uuid":"D7FF7C3D-9D2C-4201-BAD9-BDE12A910475","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4D135037-5761-46B2-8FAA-4ACDD5AE8215","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"54EB7A63-22C8-46CA-9399-8A20E09DE21A","f1_mode":"6B2DA18F-C590-44F6-ADD1-F6AE838F869A","f1_shininess":"2C8FD28C-A212-4D86-8C29-48CC9094CA02","f1_specular":"5524A6E5-6F61-4A5F-AC59-7F6C827E9572"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"57C87135-3559-46DC-8DEF-3B0F3DAB494D","f2_ior":"42180D63-AE5F-4BF9-914D-16129F014D24","f2_roughness":"7D3CD008-970A-4C60-A6FB-C6BBA8B01D8F","f2_transmissionSamplerSize":"41E20514-3264-4482-B5CF-852DBB4D0D71","f2_transmissionSamplerMap":"B2D2EA05-64AF-48C6-9FB6-FBD344A9E4B7","f2_transmissionDepthMap":"975366BA-6828-4690-995D-BC867D9BB3A9","f2_aspectRatio":"645A95FB-4B7B-4DE0-AB4F-D7ED17B96586","f2_alpha":"B79C2E30-B61B-4D6D-BFD0-FB0250E47347","f2_mode":"0931B1AA-E056-4B2F-8B4C-04A0F47884F5"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"ADAE8EB4-3F41-49DA-B77B-1FD2CC0731EE","f4_far":"3A7E7721-9983-4203-BF05-9AE2E327DE10","f4_isVector":"FBB6598C-834A-4CDE-ABA9-CCE434BA7120","f4_isWorldSpace":"787D1C78-0BB5-49DE-862D-6045D3235871","f4_origin":"E8146A40-1B76-4A3C-A820-1168202C5544","f4_colorA":"861DA8EF-ED4E-4821-943B-A76994A23002","f4_colorB":"48A52FCF-E737-413E-ABC4-DF875AC49C94","f4_alpha":"0D58AD15-DDBF-4B6F-8623-C4F9A0B32A46","f4_mode":"F11404C7-5027-4E29-A5E6-419C055EF5B6"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"C2EB89E7-9736-4723-B9C8-E7980B94ACBE","f3_bias":"7833D89A-E6E3-49D7-8464-1C2F22AFDF69","f3_scale":"9C7C4108-1C10-496F-A257-80B6B2CDD800","f3_intensity":"AA39C163-AA9F-42B6-989E-C4B98462D64D","f3_factor":"BFEDC52B-6580-4854-8281-83BE65164ED9","f3_alpha":"DC1A9B09-76EF-446B-9E43-978DF2DB291F","f3_mode":"6A342BA7-592A-46B0-BCBA-9A43C5F51F11"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"38E5A9D4-B30B-4425-92D1-40582A4CB968","fragment":"38E5A9D4-B30B-4425-92D1-40582A4CB968"},{"uuid":"79F992FF-4AA2-4283-8041-91DC12D02D56","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4D1F429D-B14B-484F-A01B-7F221885E1E1","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"28179318-398C-4BDC-AD0D-AA7277978415","f1_mode":"08EC1063-7652-404D-A0AF-CDDE990697DE","f1_shininess":"53FDA40D-DC7A-4E18-8219-D0F45CAF2F42","f1_specular":"8E0A75F1-87D0-4DF7-A62B-3695BEB6593D"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4559F90A-8639-4BF4-A186-14CEEC52484C","f2_ior":"325A359B-3426-45CD-8932-FE72DD4A9BD0","f2_roughness":"968095E9-A8F3-42ED-ADEA-FC52CF840AD7","f2_transmissionSamplerSize":"0F893202-5541-4A7E-9E6D-CED3B53B1877","f2_transmissionSamplerMap":"A0BE48F4-7F08-43BC-86A4-8A6BC9C402B2","f2_transmissionDepthMap":"85F78DA1-BE4D-4771-A7DE-CCC4C19EACD4","f2_aspectRatio":"D7FD4759-CE92-4342-B4E6-14017EBECC7C","f2_alpha":"ECB0F90B-A97C-4123-BB74-E015298155A3","f2_mode":"E7226147-95F4-43AD-849A-55E8F02735BD"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"158DD91D-31AE-4327-BD8A-58445362ED4A","f4_far":"BA7978D3-FE7C-49E6-BFB6-3D75AF03BC44","f4_isVector":"057B69B3-8661-4234-A47B-AA55350953FA","f4_isWorldSpace":"2051A83F-2C1E-43D3-90D5-29648ACADBF2","f4_origin":"16AC809D-93E3-4BA5-B996-7F041C3D4A2F","f4_colorA":"AB5948FD-1DDA-4CDC-882D-3AC50D94241F","f4_colorB":"CCA48EBC-1424-44A9-88AE-C2311DA6F996","f4_alpha":"40104487-46E8-4025-9682-17795D761B73","f4_mode":"1EAA3905-562F-42DD-ACF5-2D6E9A5655FE"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"87B63B0D-3D66-47D0-A4DF-BD6F3700A6A3","f3_bias":"AFE0E09B-673B-4E8B-A7FD-7AE40614CE6C","f3_scale":"9E8FE047-0D5F-4CAC-A148-369BFA6A524A","f3_intensity":"1262F8D8-7221-492B-A6B6-58C070FF5B53","f3_factor":"E00ED3E3-EA60-41C5-9984-E06B92936367","f3_alpha":"2FEE591B-4508-4B5E-817C-51454B03C8BD","f3_mode":"928AEDB1-E575-45FF-B8C8-6E32F743CC36"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F03C42AE-D7B7-406D-AC8B-29354B5F2AFE","fragment":"F03C42AE-D7B7-406D-AC8B-29354B5F2AFE"},{"uuid":"86FB4F14-8863-4DD5-96ED-7C2A38332463","type":"ShaderMaterial","emissiveIntensity":{"uuid":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"B0835AE7-DCA2-4CF9-B207-3083E2D4750B","f0_alpha":"3558B092-ACCC-4BCF-8A89-B1F88DC522F0","f0_mode":"9FDA3461-BCCD-48A7-A9D0-3A930F76F233"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3119DB25-A452-486F-AE8C-2F1D54FA6458","f1_mode":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","f1_emissive":"F109CFFA-9AD1-400C-B55D-346DB4A4883B"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"6514A565-4614-427D-A948-E46CF6D3E5EA","f2_bias":"5A6867AB-5490-496B-92DD-3C291B181B4C","f2_scale":"B7B6933E-722C-404B-AD80-9D63DFC974D8","f2_intensity":"3E9F6224-D176-4194-AAAA-53C57932B66C","f2_factor":"E549CD5A-6A27-4F83-B36B-8B00D71479EF","f2_alpha":"62302CDE-F692-494A-8967-765106EE0018","f2_mode":"7B6556F7-DA55-4502-BD40-54EA5535AD42"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"4764F644-0523-437C-A906-6A4C6EA43507","fragment":"4764F644-0523-437C-A906-6A4C6EA43507"},{"uuid":"782F065F-6424-4F97-9386-A78123ED1E87","type":"ShaderMaterial","emissiveIntensity":{"uuid":"F304A8E1-0424-4CF8-922F-FEF048A0652C","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"AF30BC4F-6437-4DF6-98C1-5235EBF9ED36","f0_alpha":"3F3A7E1C-735A-4613-9D96-3420011D8EB3","f0_mode":"6EF9ECA2-8828-4B13-A223-0020672E2000"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8881BE93-8CA2-4F57-81D2-9EE56223B303","f1_mode":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","f1_emissive":"02F61905-AF6D-4D97-8BA7-7B74AAB2C6B6"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"4B1BA364-A9B6-4D86-B081-221A4E8611BB","f2_bias":"A7C7F972-0CB2-49CF-A044-5BCD491C9926","f2_scale":"EA5A929E-8DAD-4C7F-ABBF-573424AE6B59","f2_intensity":"93F28524-6EC2-4D4A-953A-B7041A062143","f2_factor":"765E317C-7F8A-4A00-96A0-9D37F99B3BCA","f2_alpha":"C9F5AC18-6E5C-4BE5-B380-8BC7F3EFAFD8","f2_mode":"78615CA3-D84B-4997-92D9-73FDAECD6CBD"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"A141BD81-5415-435E-9447-4B35842D83A9","fragment":"A141BD81-5415-435E-9447-4B35842D83A9"},{"uuid":"189E7DE7-554F-4586-A8C2-0A75A6EF7F20","type":"ShaderMaterial","emissiveIntensity":{"uuid":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"B6B88494-4B46-4706-9AE0-1CBFD6FC3ED2","f0_alpha":"0A6E8F68-EDC7-434C-83A9-2DC5AD6D8F5F","f0_mode":"72FB6D28-A81E-414F-A288-6E16B0604F01"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","f1_mode":"28318C5D-2966-4269-A1FB-4CE52FB1701B","f1_emissive":"D74B4B70-A992-42B1-8C7D-074742CDA157"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"F59EB46B-3ED4-4423-B6D8-59F0C2D92F32","f2_bias":"9123810A-C83C-485C-88BA-BB721211A7A7","f2_scale":"3AD274C8-61C1-45DE-B803-96CAE1DEFD64","f2_intensity":"7CE13810-1F1A-4B64-B21D-A3AD9744B882","f2_factor":"0B9F17A9-1E12-4E24-84A5-9C4FA1300E3B","f2_alpha":"6B2DB2C2-985C-4DB5-905D-6E9F2C605C3C","f2_mode":"3519E239-E3CB-4CF7-8B5D-CD4BCD0EACDA"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9","fragment":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9"},{"uuid":"573A77EE-69E6-466D-A463-8811B4821D26","type":"ShaderMaterial","emissiveIntensity":{"uuid":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"6E909F9D-D5F6-4F34-859E-DFAAC917637A","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"766A4593-0B23-42E7-8CD6-EB122ED10B62","f0_alpha":"9B9CFA3E-617C-486C-8A99-35F788F290DF","f0_mode":"7EA2B462-C188-47B1-9098-05FB94D3B080"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","f1_mode":"968D04D9-56E9-40C6-90BD-CB97017364D0","f1_emissive":"F2CBA3EA-6389-4932-A297-13294C37F9BD"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"526C68BD-522A-4F29-8944-D1D141779B58","f2_bias":"DDAA63E6-25B9-442C-BA77-08774826617F","f2_scale":"B73376D4-81B6-46EA-B316-B067ACE635DB","f2_intensity":"CC4424DA-38B7-4C9D-BBB8-847902C0DAE5","f2_factor":"2AA17009-3F27-4B06-9200-6610B51BAFCC","f2_alpha":"25B8FDCF-5D2D-4FAC-A5E5-82F0DFF85D33","f2_mode":"D9DACDAE-1FD6-4E8D-8481-C5E18EDDDEAB"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"vertex":"4F33245C-5397-42B0-A855-0E78CCD99A46","fragment":"4F33245C-5397-42B0-A855-0E78CCD99A46"},{"uuid":"8219290D-5466-451F-B53F-87E9B670F0AD","type":"ShaderMaterial","emissiveIntensity":{"uuid":"ABD0A8C3-CD86-4678-AFFA-61A39A39D016","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"EAA3C5E7-26B0-4590-B851-6CABA8C2546F","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"6C5E01C7-65FE-4D5F-9B7D-767E29BFE8B4","f0_alpha":"7AE277F7-9781-4988-ABC6-2269890BE425","f0_mode":"E4E5B3E0-B9C5-427E-B043-8246182543B4"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2365340E-56D3-474F-A56B-42B3837CFEBE","f1_mode":"2ABD2098-0A6A-4E23-A3AA-A989A6E95079","f1_emissive":"418967D2-68FB-4036-ABAC-95B23914EA98"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"15A1A2A0-4EB8-4D1F-A642-51EC622D6642","f2_bias":"F264DCD7-91A3-435D-B40C-8790E116D2BC","f2_scale":"6BEBBE99-35CC-413F-895A-D2C2C737E31E","f2_intensity":"ABD0048A-A7F5-4D47-B8DB-4C11149A265C","f2_factor":"DAB00720-919F-43B4-A389-7225F8A200ED","f2_alpha":"5FED5C78-ED0C-48E3-AC15-EB0D26C4BDFD","f2_mode":"C2450611-2316-45FE-A481-DB3DFFC53BC3"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"3A336D88-17D4-41B0-9BFA-CA3591BB464D","fragment":"3A336D88-17D4-41B0-9BFA-CA3591BB464D"},{"uuid":"C512B1E2-7E3A-45BC-A205-8FCF8BAD3EB6","type":"ShaderMaterial","emissiveIntensity":{"uuid":"58CB90D1-9E8C-4B50-8511-C163AF3977EB","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"B6380714-A21D-46BF-8CF8-B5ED47A3EDF6","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"595B9B07-9796-4C50-B4DB-B08DF25E50A4","f0_alpha":"7AFD7B94-D4FB-40DA-812B-C7EF62E60F04","f0_mode":"1F2F47EB-C890-45C5-BC46-94704BD20A93"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"660EE04F-86D5-4F76-A269-C8C8CF0C8DD6","f1_mode":"C083A7FE-ADA3-44FF-B5C7-8BFAF9AB8FF8","f1_emissive":"466797B3-8618-4EC7-9656-ED7FB9C3F764"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"0DACC81D-8728-473D-BA83-5BBD39DDF61C","f2_bias":"D7C094CD-260D-4A42-9377-7046F61782FF","f2_scale":"3384F8A3-384F-48C0-B656-9158ACBACCCE","f2_intensity":"5AC2CDBB-4066-4355-9F68-9CDEEC23747D","f2_factor":"AED459F4-DDD5-4566-A48F-46409D6F45E9","f2_alpha":"29D8FEBD-EBFD-45A2-820B-84BEE4DEB36E","f2_mode":"B6685B8B-A33B-4B37-8AD1-895981D6742F"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"B7A36CB8-8E44-4F03-A66F-B748334AFF52","fragment":"B7A36CB8-8E44-4F03-A66F-B748334AFF52"},{"uuid":"16642A27-0B81-4DF1-A566-8DA4B1FFFB8C","type":"ShaderMaterial","emissiveIntensity":{"uuid":"5C56BBC5-7401-4C6D-B758-97938601233D","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"1B78AECC-5B74-4F77-9346-04F1656F4F34","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"92A7AEA8-8486-4A72-B47D-F440EE9E7B45","f0_alpha":"CD9C5663-7DC8-4718-9DE3-2CD5E872F6B9","f0_mode":"9F92420E-EAAE-4100-9751-E7C28C831A04"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"092A3606-C9C9-4B40-BFDC-7F666067BC96","f1_mode":"9AEB863D-6BD7-431E-9226-6D0AB24332CD","f1_emissive":"A74E273F-BC73-4927-ADBD-78CF81932829"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"D0A9740E-ECE0-4262-B962-0FD94B659E1E","f2_bias":"A3FEBD95-47D7-4928-9BCA-45D3F477F201","f2_scale":"5C2C64FC-3118-49E5-B0AA-29218D909282","f2_intensity":"69EB7C17-4DE9-4733-89B4-8300BF7BE9D3","f2_factor":"099044D6-54B8-4F2F-90AA-8491A45C8CEC","f2_alpha":"8ADE9838-257E-4FC6-8E59-26793DD70D21","f2_mode":"207AAD48-C1B6-4409-844C-F363BA1CFD37"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"3B944289-8AE5-4782-BE2B-0E9458FA6B3A","fragment":"3B944289-8AE5-4782-BE2B-0E9458FA6B3A"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"274385EE-94F2-4E5B-B7B9-E40E6720FB66","name":"Base State","position":[-167.0000000000001,23.996523342699845,-8.308763260530334],"rotation":[-0.34906585039886606,0,0,"XYZ"],"scale":[1,0.9999999999999996,0.9999999999999996],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"C49BDF8A-86ED-4E2F-AC93-1253180D5EF0","name":"State 1","position":[-167.0000000000001,23.996523342699845,-8.308763260530334],"rotation":[-0.34906585039886634,0.26179938779914946,7.183671577107885e-18,"XYZ"],"scale":[0.9999999999999994,0.9999999999999991,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"5C9683A9-D4DC-43A5-96D9-09C7FDD3B89C","name":"Base State","position":[-5.596745068776386,-185.5984449064932,83.90449870945913],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6E5C4DE6-F9BD-4E34-A7E1-57AFBFF7DF44","f1_mode":"F6139010-F640-402F-AD00-7D697194317F","f1_shininess":"BAAF99CB-F038-4ACC-A2DA-8256BEAFC045","f1_specular":"CACC2B76-C1D4-4052-A6D2-E67780845865"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"725FDAAB-6801-457A-9ECB-8C1E7FD6A75B","f2_ior":"F0CE0C3D-6258-4557-A6B0-E479BBD965F0","f2_roughness":"F47A72F3-5CA3-41AD-B5EA-544442597448","f2_transmissionSamplerSize":"50DB80A4-88F5-4C28-9FEE-60FC43613A75","f2_aspectRatio":"BB15F554-E84A-4D55-88F8-3E2589606134","f2_alpha":"47E9B9B2-5347-4F2F-A04B-C26DE3370FB3","f2_mode":"F51639A4-F6BE-436C-88E3-0C6C7EDA773F"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"68E24567-FE58-4A27-A183-669145D44A95","f4_far":"93F720CE-DBB3-4DB6-B09E-E920DE188EF9","f4_isVector":"4049FA79-192B-400C-AFB9-13ED6AFC30D4","f4_isWorldSpace":"D906E855-FA29-4B7C-89AF-728DB869432D","f4_origin":"75007A9B-D18E-49DF-B85B-E6F85C58C409","f4_colorA":"DCB44B9F-60A6-47AF-BE7F-58892EAA1F31","f4_colorB":"54A8ED92-29CE-40B6-AF0E-A053E902FB91","f4_alpha":"88841C86-D268-437E-B26D-56410CC74CB9","f4_mode":"F4397802-6B0E-498D-B9D7-5252F379E526"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D115B29D-2156-49AA-A75D-33845103A086","f3_bias":"F352AB78-DCF9-4110-86E8-CC0B9112B552","f3_scale":"63F28B68-5994-4B16-81A1-76DF9628E382","f3_intensity":"BB4C3000-286F-4E16-97B0-615D964F4C80","f3_factor":"595805F0-994D-4EBD-BC07-E2B37A98F933","f3_alpha":"E2AC9EF1-9383-410B-8B98-27FCE7531004","f3_mode":"17B868F4-2047-4C60-85EA-60B76967DE63"}}]}},{"uuid":"1B6C8C26-65A8-4B6E-B5FF-82935CF624D3","name":"State 1","position":[-5.596745068776386,-185.5984449064932,83.90449870945913],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-301.8682706749416,157.20325183141196,-25.299403096517153,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7E8F3A6B-A62B-40DB-942C-93FA85D26563","f1_mode":"49A1F93C-657D-48EC-A042-FC802CA1D4FA","f1_shininess":"5C3DEAD4-5491-4B84-8A95-DE95041D7493","f1_specular":"30B7289E-E578-477E-A787-6A34DD330FA5"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"35B0478A-8E1C-4F68-855B-D320911D1C80","f2_ior":"D039E748-4E1E-4655-9689-E8DDEB569AFE","f2_roughness":"2EC44F34-D8A9-4C26-B94A-230E670BF49C","f2_transmissionSamplerSize":"78DC79AE-6E02-4005-ABAD-7D1ED5462B71","f2_aspectRatio":"1A74CB62-1090-401B-B5E9-21A2C25F7858","f2_alpha":"D3189793-0D58-4BCC-A43F-9DCD1804690D","f2_mode":"2B990F55-9026-4B10-9BE1-3CEBCB542B9D"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D4997B9C-8222-4440-B0B3-77443B0EAE19","f4_far":"8B11D89B-CF69-4565-BF0A-75DE54BDA711","f4_isVector":"0CD79049-2A4C-4B4D-A86D-8FB07D693243","f4_isWorldSpace":"F804CB8F-0A12-4FC9-8DCF-78A15DF61546","f4_origin":"3DDC37F8-1A94-4BB3-8985-94AFDC230AF2","f4_colorA":"4521F8FE-68A2-4338-BE94-B3D9A5D079B2","f4_colorB":"0F7DF2E3-01C2-4E51-A4E5-B840E9B20E65","f4_alpha":"2CBE9733-3597-4BCC-839A-C7DDC0EEF171","f4_mode":"72D89E95-4366-40C6-827D-1BF244E7E496"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6AEF1CD1-D52E-492D-8CB1-0F3AE2DA5B66","f3_bias":"49A91DF9-05A2-4AA9-9DB3-C1A21B2CB806","f3_scale":"4DBFD402-6154-4C34-85C8-C214E6EFEED3","f3_intensity":"7D8204F8-0999-4EAF-8D72-FB1107C7023D","f3_factor":"D7340C47-26DD-4FE9-B361-943413B4FCD4","f3_alpha":"3803317C-0B97-432D-8A74-B074AA1CFA0C","f3_mode":"75BD02C3-096F-424B-9D82-3EA703ECD0ED"}}]}},{"uuid":"8A11AB09-4F67-4162-B9E8-8036F48D03AE","name":"Base State","position":[192.69534235511117,-144.12250620252024,-60.08034172670993],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"geometry":{"width":150,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0DC6961A-FAF7-4655-86F4-562C9109F3B0","f1_mode":"710C5BA4-ACC0-4242-AFB1-6231212E7E63","f1_shininess":"BEBDBB8D-6A89-4C5B-83D0-2BF4E8E8A4DB","f1_specular":"A3CC937D-35D9-433C-AEC6-2756FAD8F517"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B24ABC18-36E0-4114-A7E4-B738041335AE","f2_ior":"2D968C81-D8DE-4E43-B03B-D33A8A54F23C","f2_roughness":"BC601A58-D21E-4A0D-9A62-9878D8ABC199","f2_transmissionSamplerSize":"0D55AB67-A194-41AE-AAEA-D4FC5E67FDFD","f2_aspectRatio":"47F917A5-F9DB-49A4-A307-00F367943363","f2_alpha":"63CC15A2-F718-42BA-9659-41F3C718332A","f2_mode":"545A9BF3-4C11-4A7F-9E8E-2DA3866C569F"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"01DF86BC-D697-45C8-AF3D-8ACCECE327F2","f4_far":"AB046E6B-395B-4805-87E2-9E6AEBCC7C19","f4_isVector":"F642A008-8F64-4856-9D3E-B95192BE334E","f4_isWorldSpace":"997EA252-CEC2-427B-A16D-A2984C0A4AC5","f4_origin":"E52337AF-9169-4BA3-B9A0-BC10258EECA0","f4_colorA":"7EE41305-6F99-40AA-B15E-E4D6AAFE4B29","f4_colorB":"22F235EE-AB38-4292-8636-FB7F104A8EE5","f4_alpha":"9B8DC357-F54F-4748-8DFA-6B38B2A04D29","f4_mode":"8BA5D6D4-E405-460F-A239-3B0A52B912AC"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D1046FCF-6FFF-4BDB-984D-9DD8FB9EF77D","f3_bias":"045011A7-291D-4A4E-9F33-ED261771D0E4","f3_scale":"712441FB-2EB5-4988-B6DC-BB0878751C3C","f3_intensity":"32E110AD-1C37-411F-8154-3BD396EEE687","f3_factor":"FC7B1CAA-3923-46B0-BAFD-8A87CC75C4D1","f3_alpha":"8FCCF811-F309-4339-9394-E601106A4A30","f3_mode":"0323FBB3-BC7A-46DD-ACE6-C5589A9DC548"}}]}},{"uuid":"20503FE1-3E52-4A9D-9029-14B457E9A782","name":"State 1","position":[192.69534235511117,-144.12250620252024,-60.08034172670993],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-24.709117649701227,58.25314253419873,192.98448970328138,1],"geometry":{"width":150,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6AB21F25-7568-4A57-8A9E-3F17E5011DB3","f1_mode":"C7C33A40-2691-4D60-A07B-E6D0F9DBE14C","f1_shininess":"5A079331-5A47-44D0-9317-A428ED548D8E","f1_specular":"82371467-24E0-45FB-9211-5A5569B8A39A"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8367690E-382D-4B08-914B-DDAF29984AB2","f2_ior":"9997C7BF-9D38-41FB-A3B9-EDF65F667422","f2_roughness":"2FF37A43-6165-40D0-942E-BDD9CF56006E","f2_transmissionSamplerSize":"3E26E4A8-60A1-4476-934D-4137E27F89B0","f2_aspectRatio":"2B762492-C24C-4D43-A077-436131D6C53A","f2_alpha":"F688CC20-D448-4970-ABC7-F3C60F3B913E","f2_mode":"2267F869-B594-420D-8B3B-15E23EF256F0"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"12C5319B-583B-45C7-B94F-DA81500FEBEE","f4_far":"A7C36CBB-0157-4CD4-8ABD-38AAE919FC8B","f4_isVector":"0ACDBFA4-5A95-4D82-A4C4-5D1477675D2D","f4_isWorldSpace":"6BC7418F-86C1-4661-B3DF-CD17288F2FE2","f4_origin":"381BBA69-CDF9-466C-9CBC-3F4BFDB48F58","f4_colorA":"AB62BE45-1023-4995-8329-26311718BBAF","f4_colorB":"3B314203-1CE2-44A2-8132-C4805F38F80D","f4_alpha":"2FE3D91A-9303-47DD-AF43-2E50A8179659","f4_mode":"52503820-F169-4881-A478-E493E4ED7AE0"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"63C89441-C2A4-4AC0-875D-3122F4A11718","f3_bias":"FBD50E71-72CE-4276-9316-CA4DB24F87E2","f3_scale":"260D743C-E29D-432F-B6CA-1208B8A79AFB","f3_intensity":"6A6D2846-EA85-4C48-8CAD-5AE89929576C","f3_factor":"DAA2CEE9-9645-484E-AD21-E0711EC81530","f3_alpha":"CD07F2A6-D6DB-417D-81AC-4A9B9C0E8EA8","f3_mode":"8F18F17B-195E-44DE-8F0A-FAEDD126035B"}}]}},{"uuid":"902FF276-7544-4C91-95D2-D1ADECC18ECA","name":"Base State","position":[360.1446709076129,-247.13774958036134,-119.86555037509562],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"047B2AE5-32F6-4B12-AF37-BC20167EFE39","f1_mode":"BCE8C847-8DD7-4FB8-B68E-58A4F3E0B566","f1_shininess":"C0C17D22-5DD4-406B-AD24-683FC7A66737","f1_specular":"695314BD-7E7D-4C35-9938-05A5C8F75274"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"41D8AEF1-21A1-4A15-8CED-D9022C9DC081","f2_ior":"37CDFD18-A163-4D49-B56A-E84BD1F76DEB","f2_roughness":"CD873B46-134A-4DA7-9AE0-92ECFDD4CF34","f2_transmissionSamplerSize":"B195EE00-4F88-4D13-B625-7DE8AB84BEAD","f2_aspectRatio":"6BD2CB73-38BF-4C42-9094-CA794E5EA51C","f2_alpha":"CBD09871-4CA3-4591-AAE9-C175AEE79733","f2_mode":"DD8CB328-6553-4EA9-9A0C-C5CCEA7E6310"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"423A09FD-5968-4EC1-A725-82A8337B31F3","f4_far":"7509B6E0-89AC-4757-93E0-BBFDE4F94E58","f4_isVector":"CE8D7042-0407-4998-A2C1-5A4B2102F1C3","f4_isWorldSpace":"E135B279-528C-4F93-8645-0D0932788B83","f4_origin":"D2871C63-60B0-41D0-BCD0-EEED612B928C","f4_colorA":"7DF56CDE-BB17-4D8F-8AA3-15B4CD60F15D","f4_colorB":"FDC36817-6F7D-4BF2-A4B8-B99798017BA9","f4_alpha":"D90988D3-B6EE-4721-96C9-49797B4E2A65","f4_mode":"2FC39A8B-2A66-49FB-BDB3-CCEF57E0393F"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"44917772-915A-4405-989F-02FB60FE56CE","f3_bias":"F5F768CE-1771-488B-83DC-9667545F2446","f3_scale":"42129300-E71A-4F35-8FD5-A1FD3B2DF856","f3_intensity":"08AC00AF-B457-4223-B2AB-A815CDA17ED1","f3_factor":"DFC492B4-3958-4779-BFF5-093285E12288","f3_alpha":"3242EC9C-AAEA-4B12-A0B0-ABDE042E82CE","f3_mode":"87FE3B54-1EE9-4C15-9C72-670FDEE20E75"}}]}},{"uuid":"C78E1C9F-CF2E-487C-ACD0-37B561D99A79","name":"State 1","position":[360.1446709076129,-247.13774958036134,-119.86555037509562],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-528.1206522110713,348.3140676441649,33.29889074577795,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"315AB562-DB11-41F9-B26D-04420584C6B8","f1_mode":"DDF43A94-945D-4FE6-BE3C-4E6DE2B6A1FA","f1_shininess":"700C52AF-70DE-4E6D-8DA8-04A580383188","f1_specular":"8C6D43EB-88EB-4BA7-A727-A7F8DE119BB0"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6EA4BC7F-D68D-4624-8C71-799D2A025CAC","f2_ior":"CA7B81D4-5CF6-4056-9551-0969CFA98FD7","f2_roughness":"B08237E6-A9D6-4165-B3C5-AB1A15BF83F4","f2_transmissionSamplerSize":"0A3AB4EB-B406-4E45-AE78-A4D97FFAECA3","f2_aspectRatio":"8DDEFB3C-2766-428B-AF5F-56201EFDCA24","f2_alpha":"F94FC0F9-2F7C-4DC5-A560-496E4249030A","f2_mode":"BB4F68BA-7FFA-418F-9427-77FFD504E61B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"3CFB017A-AF3A-4E39-8A25-8F86A53E0CEC","f4_far":"D287FA83-3822-4173-980A-88DC3835BA33","f4_isVector":"782EDBD3-D1B3-4408-9253-89523922E546","f4_isWorldSpace":"0C77DE25-3E4A-49D8-83D1-A17CB62F9E7F","f4_origin":"C803F0E7-7966-42A5-904E-BF4A0D577B69","f4_colorA":"0F5936A4-99D9-4401-9832-7989F677F173","f4_colorB":"AE13EA2D-97AD-4092-8846-BEBBCA68E94C","f4_alpha":"81D653B6-AFE3-442D-B0EC-C9E37469C074","f4_mode":"06912314-DF25-4090-84AC-6D86C1E48577"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"FDFB7F0F-D161-4590-A15B-B14F215AA8CE","f3_bias":"DD0434EE-19A6-432C-84A9-68005E220303","f3_scale":"5B24962E-8C30-4A6B-A464-61374A6A0F79","f3_intensity":"A927549B-D4DC-4388-BCC0-254D83341484","f3_factor":"E44F193B-83E3-447E-8629-20E6F106B4E1","f3_alpha":"FCDA1579-910D-4151-B9C5-E6F54C50A782","f3_mode":"575561DB-2CC2-4B4F-8237-941502D0BB5B"}}]}},{"uuid":"12A6232F-B353-428E-8574-C9A22297CEBD","name":"Base State","position":[77.64707881858095,10.251627470154062,-302.8586838226405],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"FBA447A7-89E5-45AC-B6A1-55D088981238","f1_mode":"24DD2C7A-ED66-4034-89A4-430A3B103523","f1_shininess":"49B74F8C-8BA7-4469-BAE2-4198D320119B","f1_specular":"1912800F-CE57-4173-9502-ACEB63B6824A"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"E2031B50-E41D-40E8-9E8B-261769DBE54B","f2_ior":"2D6F2ACA-103E-4F89-837D-BC818A26084D","f2_roughness":"3EC4D8D3-3257-4007-9F3C-96DB40FD977C","f2_transmissionSamplerSize":"59A0048A-B6E4-4EAD-9EE9-76887221009C","f2_aspectRatio":"1CCA3F1A-D2BA-43EF-B7EB-894938E5AF3A","f2_alpha":"887A6637-EFAA-477A-A881-8FD9410D1B03","f2_mode":"8BC89B9C-76E7-4224-BF51-06B868FDF428"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"DF99167F-A6B2-4B04-B044-BD43AF8FAA90","f4_far":"91A7EA1B-7A00-48B6-9C50-08C3E82D6881","f4_isVector":"D1B6DC2A-668F-4A18-BFFC-7B7201C43D6A","f4_isWorldSpace":"B4BC7142-4C71-4E8E-AE17-C65B3015A24D","f4_origin":"41A19BB6-2BBC-4FED-BD75-1F85D3859381","f4_colorA":"FA3D04F9-1EA3-49F7-803A-DD6EFBB52364","f4_colorB":"29E85F1E-8CA5-4BBC-A5BB-01307DB95B32","f4_alpha":"69ECA436-EFDD-48FC-8E86-738DF623958A","f4_mode":"DAFA846A-DB65-400D-93F4-858AF1444F45"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"C1EFC22E-8174-432B-90C7-3FCDFB0B881B","f3_bias":"5E3E28F9-1F63-4B72-84A6-43E99EAB9A54","f3_scale":"B8B35E61-6BE0-4300-96CE-7D0A56F1BFA1","f3_intensity":"38714B37-D022-4AFE-A8DC-B7FD61D0A932","f3_factor":"B7778E14-CC39-46C0-94EF-F23E15F7D874","f3_alpha":"A784221E-F280-4213-850E-1F2F64C7C98E","f3_mode":"1280A5A8-96B0-4E6D-AEEF-0F323C2D4DC1"}}]}},{"uuid":"132540F2-699A-4A38-8617-DA6997FDC59A","name":"State 1","position":[77.64707881858095,10.251627470154062,-302.8586838226405],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-355.8954938540594,88.28469512780404,207.6690970245212,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3D2E76EC-CE31-4BCA-9F3A-284948258027","f1_mode":"1BC7B9E0-7C05-4379-8461-8C5B6274D813","f1_shininess":"A223C599-605F-463A-A3BE-93B16E697C3C","f1_specular":"B1EEA7D4-FB5D-4315-9E88-56AEC0032C5B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"C10C9595-CF61-4E29-AA9D-C7492988C375","f2_ior":"F56731C7-00D7-4B32-ADF2-A0A22C48B586","f2_roughness":"86B62E67-EEBC-4296-89A1-6C555AD6E3EE","f2_transmissionSamplerSize":"03D2A3B9-6BF3-4DE2-A760-AB286409BC78","f2_aspectRatio":"80F67D10-EF5D-4C90-BC0E-EE27F275BFBF","f2_alpha":"114A7091-A866-457A-AB11-FD5D881BF5E3","f2_mode":"0BF7C33B-8C46-4C9E-B340-39FF51C22A49"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"15E9013D-6D3F-4AC3-A661-556D0B5EB8AB","f4_far":"DF94ACB6-175A-4116-9A94-218D5DC4E5B4","f4_isVector":"FC0B1CC7-46EC-4150-9850-C3DBFBE39176","f4_isWorldSpace":"108A33A5-ED00-4EA4-B0A7-72B9D6C321F6","f4_origin":"2AF0C95A-99E5-4A60-B9D7-DAE7FC4A36F9","f4_colorA":"CFBCEE76-9CC4-45C1-93B6-45FD786B8580","f4_colorB":"0F57DAF5-98C1-44B9-8C37-9EAAD64BABF8","f4_alpha":"BD809C0C-705C-40CC-ACB5-61166F3ACAE2","f4_mode":"03695B75-77BE-4EAC-9CA3-7B579B533D35"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D46B2488-044B-443F-BD34-B88816B3323C","f3_bias":"721BB10D-FDAB-44CE-9E92-B9CCC32364E0","f3_scale":"9F582663-4FAD-4024-92EB-3C8EA90EFFFF","f3_intensity":"47259AD5-9BA6-4E67-BCD4-DACCF71E52D7","f3_factor":"18CEA317-EF9E-43B7-9B8E-F10965D273CC","f3_alpha":"7DC299FA-74E2-4C0C-8414-96D4877A209C","f3_mode":"6F06BF70-D52C-4C87-A739-E72478DE139F"}}]}},{"uuid":"EE82309E-A200-42C9-9462-FF5D6473B526","name":"Base State","position":[14.943446944406745,-32.15740815566272,10.73403219790113],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"94E5C0B1-E0CA-49E7-9CB3-8E98A54CF62D","f0_alpha":"AF3D87F7-4D0F-4664-8D5E-07F470F278A8","f0_mode":"4878DB78-CE41-4E37-B9B0-1D3D38975C00"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BAD336E0-CF7D-4D07-823D-0B26DCF936CF","f1_mode":"7B5A6FD7-1129-4C90-9C57-538977C937A2","f1_emissive":"53528A02-B7FD-417B-8BC2-153CC1632EA6"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"86D19C59-B577-4525-AE2E-E32BC1ADE5EF","f2_bias":"8BC4EB81-212B-4FFF-8F9C-1B796EF089B1","f2_scale":"DDBF5626-0835-4113-99FA-C178B39122B1","f2_intensity":"3360E3D3-B99D-47BF-89A2-B9480D57AD71","f2_factor":"394D59A4-FB97-4F2B-9FEB-6A601BA9ACC5","f2_alpha":"7D07371B-EA8C-48AB-A972-FA84A41F1BFD","f2_mode":"2E2502EE-083A-4317-9D59-4956812AD701"}}]}},{"uuid":"E7AA4724-9E55-44EA-AA3F-2F3B0BBE2FD7","name":"State 1","position":[14.943446944406745,-32.15740815566272,10.73403219790113],"rotation":[-0.3490658503988662,-0.17453292519943306,0,"XYZ"],"scale":[0.9999999999999997,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"A1EFA83C-7C45-4B55-A889-D19DF8D84AB4","f0_alpha":"DD0CD5EE-95AB-4EE8-857F-4DE46BA570BA","f0_mode":"812B359F-F90A-4E58-ABFF-C032A222D93B"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"AF10FE5E-56CB-4FCE-99E7-2C7E8B9F7913","f1_mode":"A93D5AB8-D7D5-4040-AB1D-374DF619DAF6","f1_emissive":"07514D38-40F7-416E-8F67-95BEFF004750"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"91C94426-59ED-47DB-9EFC-8BF272678890","f2_bias":"3330E67B-5126-4CC2-8235-2878AA08AAEF","f2_scale":"043AEA95-E668-4809-93DE-B1B6DBE71252","f2_intensity":"D8E9AF08-12A5-4FD3-B878-1BC722A1A585","f2_factor":"633ABA70-8727-4E36-B50B-4FFD181800C7","f2_alpha":"82F790FB-F9BC-4E40-B196-A0E2C5671140","f2_mode":"C45F9C40-51C5-4BA9-97D1-B62216556400"}}]}},{"uuid":"F4BDF665-5016-47C9-BA1A-52F1848C4F7A","name":"Base State","position":[14.943446944406745,24.224149091491782,-9.787176401639002],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D0B2F5E3-E495-4E6B-BA7B-56156FC42349","f0_alpha":"5AFBD2C5-7984-4072-AA01-AF421B817ABE","f0_mode":"E7FBD508-4E2F-4911-8961-AEBC7A19DC10"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E91635D9-4AE4-40EC-9D45-109A02F88C77","f1_mode":"54F80CC7-321F-4629-88BD-A46A4A029A66","f1_emissive":"A244455D-C5CB-4DD8-BD3A-4BBB9F93FDB3"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"749109B2-C55F-41E2-BA91-5BADED81ADB8","f2_bias":"C6C528F6-65D9-4DFD-BF5A-D02BC89449B2","f2_scale":"13153B10-77A0-4C99-B7A0-5C929997F7C6","f2_intensity":"E75EA820-D035-4D0E-9702-34257CC9EF95","f2_factor":"D3F76359-6FD6-41F4-81BC-D6ACA8C8250C","f2_alpha":"77EC089B-452F-4135-9729-EE4223451EE5","f2_mode":"797D091B-B946-4BA2-820A-30B83692BA01"}}]}},{"uuid":"78542D85-AC24-42D2-B2B4-474E43CA74BE","name":"State 1","position":[14.943446944406745,24.224149091491782,-9.787176401639002],"rotation":[-0.3490658503988662,-0.17453292519943303,0,"XYZ"],"scale":[0.9999999999999998,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"8B3410B6-96AF-4DC3-B3C6-F80F4C7FB46A","f0_alpha":"01AFC22A-9117-44BF-9D94-7EFFAA0A8864","f0_mode":"A27D744A-5695-4D85-93EC-F385EB6574F6"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2562AA60-39A1-4F0A-AEEA-B73D4349DF95","f1_mode":"CAE5E74D-3A17-4245-8041-85A81258C1E4","f1_emissive":"4049FCEC-448F-45AA-9232-876FB559861F"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"BF313590-96CF-4F44-8C61-67721328443F","f2_bias":"14325E47-F466-4502-9616-6C2EECC19EDA","f2_scale":"3E6F976B-5EAD-481E-B41A-3D4FB3A9CA88","f2_intensity":"3C965CD9-79E9-41EC-AB8A-57204CA7EB6A","f2_factor":"F8F93BB6-5220-41F5-9EB9-77AC0E920C5E","f2_alpha":"EC98D484-1C32-46D4-A8E6-2464C0A845D0","f2_mode":"A28AF9E5-45D2-4717-BAC0-5BEFFC0F1506"}}]}},{"uuid":"63E0609F-DDBF-490F-B465-574A2C4AAB53","name":"Base State","position":[14.943446944406745,80.60570633864633,-30.308385001179136],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"2856E60D-4936-497A-9E3D-90F845B5AF20","f0_alpha":"26F32C74-15A2-4098-8C4E-BFCA9261709B","f0_mode":"3C4177CF-8F27-4A9C-9D65-CCBD94F139EB"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E40A8924-1E83-4940-A391-A1D5D9A23FF8","f1_mode":"7F93BFED-58ED-4AB9-97DE-957F50BCE6EE","f1_emissive":"DBBA1DFF-D916-437D-8642-69A19945F210"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"7E02F78E-4EFB-4239-972A-819B5F0A048D","f2_bias":"1231499F-4357-42B3-9F47-04C3280D2DE4","f2_scale":"257CF335-764D-456A-93BE-AC56C7934CD8","f2_intensity":"FF411C71-BEBB-4176-BBF2-FC3905D4E34D","f2_factor":"3E4E246B-39B8-4A3A-B90B-03CC8406AEB4","f2_alpha":"27DBE8EC-EBA3-4AAE-BE5C-8D3DC7F34A70","f2_mode":"62265F7C-9371-47C6-B859-8F463576CC9B"}}]}},{"uuid":"8E10309A-AB99-43C0-A2F6-EC55FB1F1E6B","name":"State 1","position":[14.943446944406745,80.60570633864633,-30.308385001179136],"rotation":[-0.3490658503988661,-0.17453292519943303,3.522968763539584e-18,"XYZ"],"scale":[0.9999999999999997,0.9999999999999999,0.9999999999999993],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":190,"height":60,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"E2D79CCF-39C0-44B9-97BB-19FA8C1EE005","f0_alpha":"78EC31CC-D4AD-4195-A7E0-396A7DDAD9C0","f0_mode":"5EA7C405-95C0-4C8F-82D2-EDEB31EEC57C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9E6A83D8-B586-47FF-B135-BFDEF8F6FA5D","f1_mode":"C16C29E2-93E9-4275-933C-D29D2551C57A","f1_emissive":"991F8E2B-A550-4403-BE2A-BE57F1C4CE2C"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"30010FE3-5042-4AE7-9B7B-ACAA87E11989","f2_bias":"4CF8AA05-E8EA-48F8-9AEB-CB3041236368","f2_scale":"0C64F55E-0C72-4130-9C20-4640A3059EA2","f2_intensity":"F355701B-5E81-4F16-B9B5-AE905E516A29","f2_factor":"C79080DD-8E52-47B3-B958-E453805DA120","f2_alpha":"9E09C3BC-7F29-465C-8905-0824017B04F9","f2_mode":"432D1C7F-F193-427E-B784-035AF2C73ADD"}}]}}],"nodes":[{"uuid":"A41DE68A-71A7-4BB2-94E1-1B921ECE312F","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"8CA287FB-5604-4EFF-9817-5AC88D24FC71","nodeType":"Color"},{"uuid":"8CA287FB-5604-4EFF-9817-5AC88D24FC71","type":"f","value":1,"nodeType":"Float"},{"uuid":"8498961C-ABB5-45F7-B50B-D4107ABA39DA","type":"i","value":0,"nodeType":"Int"},{"uuid":"B651EB71-FD50-481B-87D5-BCEE30E024ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A2513B6-D079-4DB3-9D7B-33CAC451FD9B","type":"i","value":0,"nodeType":"Int"},{"uuid":"BBD76A44-90B5-4343-BEC7-57B88C6F393D","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"0BD3B700-8151-4CFC-8050-9A9C0079F0E0","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"860FD2BF-F5C6-4E25-8906-17BFF4CF9760","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"10C6F0D7-5370-439D-BFB7-58B54E27888F","type":"f","value":1,"nodeType":"Float"},{"uuid":"C527E2D9-FF92-4ED6-88BC-B34BD7BEE3F1","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"9B29B377-30C3-49E5-B5F3-8353BDEFD369","type":"f","value":1,"nodeType":"Float"},{"uuid":"2820272E-EF74-4E3F-8A27-2ED4C7AAF58F","type":"f","value":1,"nodeType":"Float"},{"uuid":"6701E5EF-D5B2-420A-B0D8-869D40AE9EB7","type":"i","value":0,"nodeType":"Int"},{"uuid":"7110D950-C882-4569-8DC2-9D1FA1F11CA7","type":"lambert","color":"A41DE68A-71A7-4BB2-94E1-1B921ECE312F","emissiveIntensity":"B11C4A62-B337-4A9B-BBBE-ECE710A84674","shadingAlpha":"B651EB71-FD50-481B-87D5-BCEE30E024ED","shadingBlend":"6A2513B6-D079-4DB3-9D7B-33CAC451FD9B","afterColor":"011520C8-B3AF-43D8-A0A0-72004E35FA7F","alpha":"DF8CD61B-6FDD-4771-8D86-9E0C2540936F","emissive":"BBD76A44-90B5-4343-BEC7-57B88C6F393D","nodeType":"Lambert"},{"uuid":"B11C4A62-B337-4A9B-BBBE-ECE710A84674","type":"f","value":1,"nodeType":"Float"},{"uuid":"011520C8-B3AF-43D8-A0A0-72004E35FA7F","type":"v3","a":"45A19429-4CA9-4220-96C9-AE82D04061CA","b":"2CC42E3C-D271-4462-AC55-7B887F76A1D5","alpha":"5AC94DF0-3DCC-423B-A829-1B5F881FADA0","mode":"6701E5EF-D5B2-420A-B0D8-869D40AE9EB7","nodeType":"Blend"},{"uuid":"45A19429-4CA9-4220-96C9-AE82D04061CA","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2CC42E3C-D271-4462-AC55-7B887F76A1D5","type":"v3","color":"0BD3B700-8151-4CFC-8050-9A9C0079F0E0","bias":"860FD2BF-F5C6-4E25-8906-17BFF4CF9760","scale":"10C6F0D7-5370-439D-BFB7-58B54E27888F","intensity":"C527E2D9-FF92-4ED6-88BC-B34BD7BEE3F1","factor":"9B29B377-30C3-49E5-B5F3-8353BDEFD369","alpha":"2820272E-EF74-4E3F-8A27-2ED4C7AAF58F","mode":"6701E5EF-D5B2-420A-B0D8-869D40AE9EB7","calpha":"g2CC42E3CD2714462AC557B887F76A1D5_calpha","nodeType":"Fresnel"},{"uuid":"5AC94DF0-3DCC-423B-A829-1B5F881FADA0","type":"f","src":"g2CC42E3CD2714462AC557B887F76A1D5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DF8CD61B-6FDD-4771-8D86-9E0C2540936F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F719137C-BF52-4EA4-B825-512CC6A831EB","type":"c","r":0.807843137254902,"g":0.8431372549019608,"b":0.8901960784313725,"value":13555683,"alpha":"2E48C9D0-6B61-4D8E-B3D5-C58476E6A431","nodeType":"Color"},{"uuid":"2E48C9D0-6B61-4D8E-B3D5-C58476E6A431","type":"f","value":1,"nodeType":"Float"},{"uuid":"C8FCF898-8E62-4841-B145-5701F598B13A","type":"i","value":0,"nodeType":"Int"},{"uuid":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","type":"f","value":1,"nodeType":"Float"},{"uuid":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","type":"i","value":0,"nodeType":"Int"},{"uuid":"CD252BD4-F2C5-4F3E-A95B-B93E8B6E6C45","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"4F8DFDD3-F285-4D6F-BF38-93FC6E366AA4","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"71E6F361-747A-4AFF-BD8B-0620C8F49EBB","type":"f","value":0,"nodeType":"Float"},{"uuid":"300BFC03-97C3-4873-A895-DEA453814A7D","type":"f","value":1,"nodeType":"Float"},{"uuid":"C2BBB738-AAC9-4890-8B6F-956E6CB676C8","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"7752D19A-D288-4F3B-9AE8-DDEC332BEA4E","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE3D897D-D7EF-4EDF-9F5D-CA52D9BA7CE1","type":"f","value":1,"nodeType":"Float"},{"uuid":"DECF1B5C-E445-414F-9205-4E9AFDC71A2B","type":"i","value":0,"nodeType":"Int"},{"uuid":"C5CF94BB-455D-44C3-AA61-9CED69D3AF9A","type":"lambert","color":"F719137C-BF52-4EA4-B825-512CC6A831EB","emissiveIntensity":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","shadingAlpha":"5E830DD4-08A1-4F2A-9BF3-8850FF1DF185","shadingBlend":"EC7420A3-6BE2-4C13-B455-9B8253C4A796","afterColor":"2CD64EB9-04DF-4ED8-8FF5-1BE95706481D","alpha":"9F36CED9-7E48-493D-8A5A-7FA182BED9DD","emissive":"CD252BD4-F2C5-4F3E-A95B-B93E8B6E6C45","nodeType":"Lambert"},{"uuid":"7E037EE4-11D6-4C54-84B8-FEB26C0B4850","type":"f","value":1,"nodeType":"Float"},{"uuid":"2CD64EB9-04DF-4ED8-8FF5-1BE95706481D","type":"v3","a":"131AE1A9-540B-4E5A-BD57-424CEA8169E3","b":"2EBA09A6-5FDD-4B22-945E-14EE7E4474F3","alpha":"4E8F08BA-BA25-4544-80FA-66797C65E583","mode":"DECF1B5C-E445-414F-9205-4E9AFDC71A2B","nodeType":"Blend"},{"uuid":"131AE1A9-540B-4E5A-BD57-424CEA8169E3","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2EBA09A6-5FDD-4B22-945E-14EE7E4474F3","type":"v3","color":"4F8DFDD3-F285-4D6F-BF38-93FC6E366AA4","bias":"71E6F361-747A-4AFF-BD8B-0620C8F49EBB","scale":"300BFC03-97C3-4873-A895-DEA453814A7D","intensity":"C2BBB738-AAC9-4890-8B6F-956E6CB676C8","factor":"7752D19A-D288-4F3B-9AE8-DDEC332BEA4E","alpha":"BE3D897D-D7EF-4EDF-9F5D-CA52D9BA7CE1","mode":"DECF1B5C-E445-414F-9205-4E9AFDC71A2B","calpha":"g2EBA09A65FDD4B22945E14EE7E4474F3_calpha","nodeType":"Fresnel"},{"uuid":"4E8F08BA-BA25-4544-80FA-66797C65E583","type":"f","src":"g2EBA09A65FDD4B22945E14EE7E4474F3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9F36CED9-7E48-493D-8A5A-7FA182BED9DD","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2070508-F739-4757-B074-1607BEE9968F","type":"c","r":0.807843137254902,"g":0.8431372549019608,"b":0.8901960784313725,"value":13555683,"alpha":"DF76C6F8-0FFB-4FFF-94C3-64ED5E01A9BD","nodeType":"Color"},{"uuid":"DF76C6F8-0FFB-4FFF-94C3-64ED5E01A9BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"75518605-8F9C-4099-B3C7-7C055F718333","type":"i","value":0,"nodeType":"Int"},{"uuid":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","type":"f","value":1,"nodeType":"Float"},{"uuid":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","type":"i","value":0,"nodeType":"Int"},{"uuid":"8B8DA941-89B0-4209-B96F-05B4D5A3A157","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"DFE7530C-13D1-46D1-93A7-C017BFADA319","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"30F85C16-241D-4F9D-8A8B-AC4E4DC52B74","type":"f","value":0,"nodeType":"Float"},{"uuid":"915C8773-4181-4FA7-B9F4-88E9FD0C6430","type":"f","value":1,"nodeType":"Float"},{"uuid":"FC57D027-8A73-49D2-8AB5-E910EBDADBB4","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"7C54559A-909B-48E6-AA31-9FE9119D7787","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2C37AB7-1FD4-433F-8E1E-79EF6D315D66","type":"f","value":1,"nodeType":"Float"},{"uuid":"93592C43-6F04-4B12-9C50-EF5F72743774","type":"i","value":0,"nodeType":"Int"},{"uuid":"7B0AD755-2FB9-4A72-91F7-9E8F53863BD7","type":"lambert","color":"B2070508-F739-4757-B074-1607BEE9968F","emissiveIntensity":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","shadingAlpha":"AE69F538-24FC-40B3-8838-8DCFD2FE0E15","shadingBlend":"C19F953B-DF61-4CDE-964D-432EBCA5DC2E","afterColor":"FC108649-AF7C-4007-803F-D9CE58897A65","alpha":"6DD4C88E-9E92-4E61-AB58-75B972F7FA61","emissive":"8B8DA941-89B0-4209-B96F-05B4D5A3A157","nodeType":"Lambert"},{"uuid":"1D0196DA-5758-4D83-8709-2ADDC101EDBF","type":"f","value":1,"nodeType":"Float"},{"uuid":"FC108649-AF7C-4007-803F-D9CE58897A65","type":"v3","a":"15264B69-0148-42C8-89AE-D72EFE7BC819","b":"4D1B2F8D-8DB8-4FBF-B8EF-BCEEBAF5F08C","alpha":"3EEBFCFD-2DBE-4267-B8D0-E5E61DD9930F","mode":"93592C43-6F04-4B12-9C50-EF5F72743774","nodeType":"Blend"},{"uuid":"15264B69-0148-42C8-89AE-D72EFE7BC819","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4D1B2F8D-8DB8-4FBF-B8EF-BCEEBAF5F08C","type":"v3","color":"DFE7530C-13D1-46D1-93A7-C017BFADA319","bias":"30F85C16-241D-4F9D-8A8B-AC4E4DC52B74","scale":"915C8773-4181-4FA7-B9F4-88E9FD0C6430","intensity":"FC57D027-8A73-49D2-8AB5-E910EBDADBB4","factor":"7C54559A-909B-48E6-AA31-9FE9119D7787","alpha":"B2C37AB7-1FD4-433F-8E1E-79EF6D315D66","mode":"93592C43-6F04-4B12-9C50-EF5F72743774","calpha":"g4D1B2F8D8DB84FBFB8EFBCEEBAF5F08C_calpha","nodeType":"Fresnel"},{"uuid":"3EEBFCFD-2DBE-4267-B8D0-E5E61DD9930F","type":"f","src":"g4D1B2F8D8DB84FBFB8EFBCEEBAF5F08C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6DD4C88E-9E92-4E61-AB58-75B972F7FA61","type":"f","value":1,"nodeType":"Float"},{"uuid":"6E5C4DE6-F9BD-4E34-A7E1-57AFBFF7DF44","type":"f","value":1,"nodeType":"Float"},{"uuid":"F6139010-F640-402F-AD00-7D697194317F","type":"i","value":0,"nodeType":"Int"},{"uuid":"BAAF99CB-F038-4ACC-A2DA-8256BEAFC045","type":"f","value":30,"nodeType":"Float"},{"uuid":"CACC2B76-C1D4-4052-A6D2-E67780845865","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"725FDAAB-6801-457A-9ECB-8C1E7FD6A75B","type":"f","value":10,"nodeType":"Float"},{"uuid":"F0CE0C3D-6258-4557-A6B0-E479BBD965F0","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F47A72F3-5CA3-41AD-B5EA-544442597448","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"50DB80A4-88F5-4C28-9FEE-60FC43613A75","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"BB15F554-E84A-4D55-88F8-3E2589606134","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"47E9B9B2-5347-4F2F-A04B-C26DE3370FB3","type":"f","value":1,"nodeType":"Float"},{"uuid":"F51639A4-F6BE-436C-88E3-0C6C7EDA773F","type":"i","value":0,"nodeType":"Int"},{"uuid":"68E24567-FE58-4A27-A183-669145D44A95","type":"f","value":50,"nodeType":"Float"},{"uuid":"93F720CE-DBB3-4DB6-B09E-E920DE188EF9","type":"f","value":105,"nodeType":"Float"},{"uuid":"4049FA79-192B-400C-AFB9-13ED6AFC30D4","type":"f","value":1,"nodeType":"Float"},{"uuid":"D906E855-FA29-4B7C-89AF-728DB869432D","type":"f","value":0,"nodeType":"Float"},{"uuid":"75007A9B-D18E-49DF-B85B-E6F85C58C409","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"DCB44B9F-60A6-47AF-BE7F-58892EAA1F31","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"54A8ED92-29CE-40B6-AF0E-A053E902FB91","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"88841C86-D268-437E-B26D-56410CC74CB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"F4397802-6B0E-498D-B9D7-5252F379E526","type":"i","value":1,"nodeType":"Int"},{"uuid":"D115B29D-2156-49AA-A75D-33845103A086","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"F352AB78-DCF9-4110-86E8-CC0B9112B552","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"63F28B68-5994-4B16-81A1-76DF9628E382","type":"f","value":1,"nodeType":"Float"},{"uuid":"BB4C3000-286F-4E16-97B0-615D964F4C80","type":"f","value":2,"nodeType":"Float"},{"uuid":"595805F0-994D-4EBD-BC07-E2B37A98F933","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2AC9EF1-9383-410B-8B98-27FCE7531004","type":"f","value":1,"nodeType":"Float"},{"uuid":"17B868F4-2047-4C60-85EA-60B76967DE63","type":"i","value":2,"nodeType":"Int"},{"uuid":"7E8F3A6B-A62B-40DB-942C-93FA85D26563","type":"f","value":1,"nodeType":"Float"},{"uuid":"49A1F93C-657D-48EC-A042-FC802CA1D4FA","type":"i","value":0,"nodeType":"Int"},{"uuid":"5C3DEAD4-5491-4B84-8A95-DE95041D7493","type":"f","value":30,"nodeType":"Float"},{"uuid":"30B7289E-E578-477E-A787-6A34DD330FA5","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"35B0478A-8E1C-4F68-855B-D320911D1C80","type":"f","value":10,"nodeType":"Float"},{"uuid":"D039E748-4E1E-4655-9689-E8DDEB569AFE","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2EC44F34-D8A9-4C26-B94A-230E670BF49C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"78DC79AE-6E02-4005-ABAD-7D1ED5462B71","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"1A74CB62-1090-401B-B5E9-21A2C25F7858","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"D3189793-0D58-4BCC-A43F-9DCD1804690D","type":"f","value":1,"nodeType":"Float"},{"uuid":"2B990F55-9026-4B10-9BE1-3CEBCB542B9D","type":"i","value":0,"nodeType":"Int"},{"uuid":"D4997B9C-8222-4440-B0B3-77443B0EAE19","type":"f","value":50,"nodeType":"Float"},{"uuid":"8B11D89B-CF69-4565-BF0A-75DE54BDA711","type":"f","value":105,"nodeType":"Float"},{"uuid":"0CD79049-2A4C-4B4D-A86D-8FB07D693243","type":"f","value":1,"nodeType":"Float"},{"uuid":"F804CB8F-0A12-4FC9-8DCF-78A15DF61546","type":"f","value":0,"nodeType":"Float"},{"uuid":"3DDC37F8-1A94-4BB3-8985-94AFDC230AF2","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"4521F8FE-68A2-4338-BE94-B3D9A5D079B2","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"0F7DF2E3-01C2-4E51-A4E5-B840E9B20E65","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"2CBE9733-3597-4BCC-839A-C7DDC0EEF171","type":"f","value":1,"nodeType":"Float"},{"uuid":"72D89E95-4366-40C6-827D-1BF244E7E496","type":"i","value":1,"nodeType":"Int"},{"uuid":"6AEF1CD1-D52E-492D-8CB1-0F3AE2DA5B66","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"49A91DF9-05A2-4AA9-9DB3-C1A21B2CB806","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4DBFD402-6154-4C34-85C8-C214E6EFEED3","type":"f","value":1,"nodeType":"Float"},{"uuid":"7D8204F8-0999-4EAF-8D72-FB1107C7023D","type":"f","value":2,"nodeType":"Float"},{"uuid":"D7340C47-26DD-4FE9-B361-943413B4FCD4","type":"f","value":1,"nodeType":"Float"},{"uuid":"3803317C-0B97-432D-8A74-B074AA1CFA0C","type":"f","value":1,"nodeType":"Float"},{"uuid":"75BD02C3-096F-424B-9D82-3EA703ECD0ED","type":"i","value":2,"nodeType":"Int"},{"uuid":"D4ABAC86-1ECB-41D0-8DC8-90514C760EA7","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2743DAF-405F-42A8-924E-B20E2E229DB1","type":"i","value":0,"nodeType":"Int"},{"uuid":"5BDB981F-D98D-4C7D-9D72-266C6CA3E5A7","type":"f","value":30,"nodeType":"Float"},{"uuid":"0E6FEB4C-6DA6-40DC-A555-472255A93255","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"7F847337-ECF4-4514-AF0C-E954EF687837","type":"f","value":10,"nodeType":"Float"},{"uuid":"3234FB7A-FF31-419C-B10E-3FF30790006B","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"04CA929A-A440-49A3-B415-1BC350BC2548","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"2F4BED1C-5F4D-45E4-97BE-78F4087CF114","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"CD0AA887-7593-4E29-9466-7DC48A37B928","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"D5502986-9A14-41E3-BA35-16B8F1868C23","project":false,"nodeType":"Texture"},{"uuid":"D5502986-9A14-41E3-BA35-16B8F1868C23","type":"v2","index":0,"nodeType":"UV"},{"uuid":"C74486FF-4694-49FF-B5C1-59FB08332B80","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"24C5F8E9-284B-4FFD-B6F4-354F0FCDAF35","project":false,"nodeType":"Texture"},{"uuid":"24C5F8E9-284B-4FFD-B6F4-354F0FCDAF35","type":"v2","index":0,"nodeType":"UV"},{"uuid":"07D8AC7E-AABA-4C1E-976A-736BAE3790A2","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"91422881-5B7A-420E-AB48-37B9C9837652","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9F5F553-EB92-4ECC-9EFD-6970A7465AE8","type":"i","value":0,"nodeType":"Int"},{"uuid":"7FBD432E-0D22-4A61-AA39-70DA29B2CDAE","type":"f","value":50,"nodeType":"Float"},{"uuid":"4DEF9DD3-05E3-4B58-9A17-743E446AFB44","type":"f","value":105,"nodeType":"Float"},{"uuid":"0E94197D-4C40-421F-919D-EECB9F7C5684","type":"f","value":1,"nodeType":"Float"},{"uuid":"7FB9A18F-EDBD-4EFC-BFDD-E5CC6F7FA887","type":"f","value":0,"nodeType":"Float"},{"uuid":"F5CA8D31-637C-4F84-9600-02BE4609C699","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FD7A1959-0F04-41C8-A02F-6C612E39FF3E","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"93C38895-D3C2-4AC2-99DA-DE7B87CF497D","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"3BF5669B-84DF-4C24-AAD5-856A00F354CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A2843A9-ECA1-4791-B5C6-DF22079D6D30","type":"i","value":1,"nodeType":"Int"},{"uuid":"8AFD6099-E2EF-4A13-B8D9-E636F0A9B7DD","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"07F650EF-CD4A-4655-AF31-97623A6928AA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FC972A36-1EF5-488C-949F-6912561460B5","type":"f","value":1,"nodeType":"Float"},{"uuid":"3935D53B-D8D2-42E2-B05C-6BC12954A136","type":"f","value":2,"nodeType":"Float"},{"uuid":"AC394121-E9DF-43E2-A1E6-B9D26FF38587","type":"f","value":1,"nodeType":"Float"},{"uuid":"300E664D-E035-453A-9B73-07DA29B76074","type":"f","value":1,"nodeType":"Float"},{"uuid":"1E60ECA1-3FB5-4C75-890A-B6907AA9B258","type":"i","value":2,"nodeType":"Int"},{"uuid":"ADEB6C3D-CE9E-4DBE-BFCF-B61C1BCA8BAC","type":"phong","color":"743D49C9-D915-4C71-A68B-0C0B087D8DFE","specular":"0E6FEB4C-6DA6-40DC-A555-472255A93255","shininess":"5BDB981F-D98D-4C7D-9D72-266C6CA3E5A7","shadingAlpha":"D4ABAC86-1ECB-41D0-8DC8-90514C760EA7","shadingBlend":"B2743DAF-405F-42A8-924E-B20E2E229DB1","afterColor":"F7F97E8B-A84E-44DD-A96A-EC439E9F1D51","alpha":"87D8A36A-DEF7-47FD-8147-73364AB7F36E","nodeType":"Phong"},{"uuid":"743D49C9-D915-4C71-A68B-0C0B087D8DFE","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"F7F97E8B-A84E-44DD-A96A-EC439E9F1D51","type":"v3","a":"E15A4DEB-766D-4BD2-95C8-FE7244D57702","b":"84BA8B8A-FCA4-4AAC-A8B4-AA12240487AC","alpha":"18E10132-2DCF-4908-B3A9-04A0AF11E77F","mode":"1E60ECA1-3FB5-4C75-890A-B6907AA9B258","nodeType":"Blend"},{"uuid":"E15A4DEB-766D-4BD2-95C8-FE7244D57702","type":"v3","a":"6F000CDE-598A-4ECB-9A4C-7518A2AE2E82","b":"C52095F8-44A2-4F52-ACE2-62FCE4CD015C","alpha":"E2888363-1476-4D59-9166-161384F7D788","mode":"1A2843A9-ECA1-4791-B5C6-DF22079D6D30","nodeType":"Blend"},{"uuid":"6F000CDE-598A-4ECB-9A4C-7518A2AE2E82","type":"v3","a":"6808ED17-3A19-4C2D-9531-14D08923E439","b":"ADB78F3D-A8F3-49BB-B4D2-6EFC0541D5C5","alpha":"74B68103-C5CE-46A5-AFEF-C85E2426F8E9","mode":"C9F5F553-EB92-4ECC-9EFD-6970A7465AE8","nodeType":"Blend"},{"uuid":"6808ED17-3A19-4C2D-9531-14D08923E439","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"ADB78F3D-A8F3-49BB-B4D2-6EFC0541D5C5","type":"v3","thickness":"7F847337-ECF4-4514-AF0C-E954EF687837","ior":"3234FB7A-FF31-419C-B10E-3FF30790006B","roughness":"04CA929A-A440-49A3-B415-1BC350BC2548","alpha":"91422881-5B7A-420E-AB48-37B9C9837652","calpha":"gADB78F3DA8F349BBB4D26EFC0541D5C5_calpha","nodeType":"Transmission"},{"uuid":"74B68103-C5CE-46A5-AFEF-C85E2426F8E9","type":"f","src":"gADB78F3DA8F349BBB4D26EFC0541D5C5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C52095F8-44A2-4F52-ACE2-62FCE4CD015C","type":"v3","near":"7FBD432E-0D22-4A61-AA39-70DA29B2CDAE","far":"4DEF9DD3-05E3-4B58-9A17-743E446AFB44","isVector":"0E94197D-4C40-421F-919D-EECB9F7C5684","isWorldSpace":"7FB9A18F-EDBD-4EFC-BFDD-E5CC6F7FA887","origin":"F5CA8D31-637C-4F84-9600-02BE4609C699","colorA":"FD7A1959-0F04-41C8-A02F-6C612E39FF3E","colorB":"93C38895-D3C2-4AC2-99DA-DE7B87CF497D","alpha":"3BF5669B-84DF-4C24-AAD5-856A00F354CE","nodeType":"Depth"},{"uuid":"E2888363-1476-4D59-9166-161384F7D788","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"3BF5669B-84DF-4C24-AAD5-856A00F354CE"},"nodeType":"Expression"},{"uuid":"84BA8B8A-FCA4-4AAC-A8B4-AA12240487AC","type":"v3","color":"8AFD6099-E2EF-4A13-B8D9-E636F0A9B7DD","bias":"07F650EF-CD4A-4655-AF31-97623A6928AA","scale":"FC972A36-1EF5-488C-949F-6912561460B5","intensity":"3935D53B-D8D2-42E2-B05C-6BC12954A136","factor":"AC394121-E9DF-43E2-A1E6-B9D26FF38587","alpha":"300E664D-E035-453A-9B73-07DA29B76074","mode":"1E60ECA1-3FB5-4C75-890A-B6907AA9B258","calpha":"g84BA8B8AFCA44AACA8B4AA12240487AC_calpha","nodeType":"Fresnel"},{"uuid":"18E10132-2DCF-4908-B3A9-04A0AF11E77F","type":"f","src":"g84BA8B8AFCA44AACA8B4AA12240487AC_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"87D8A36A-DEF7-47FD-8147-73364AB7F36E","type":"f","value":1,"nodeType":"Float"},{"uuid":"0DC6961A-FAF7-4655-86F4-562C9109F3B0","type":"f","value":1,"nodeType":"Float"},{"uuid":"710C5BA4-ACC0-4242-AFB1-6231212E7E63","type":"i","value":0,"nodeType":"Int"},{"uuid":"BEBDBB8D-6A89-4C5B-83D0-2BF4E8E8A4DB","type":"f","value":30,"nodeType":"Float"},{"uuid":"A3CC937D-35D9-433C-AEC6-2756FAD8F517","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B24ABC18-36E0-4114-A7E4-B738041335AE","type":"f","value":10,"nodeType":"Float"},{"uuid":"2D968C81-D8DE-4E43-B03B-D33A8A54F23C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"BC601A58-D21E-4A0D-9A62-9878D8ABC199","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0D55AB67-A194-41AE-AAEA-D4FC5E67FDFD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"47F917A5-F9DB-49A4-A307-00F367943363","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"63CC15A2-F718-42BA-9659-41F3C718332A","type":"f","value":1,"nodeType":"Float"},{"uuid":"545A9BF3-4C11-4A7F-9E8E-2DA3866C569F","type":"i","value":0,"nodeType":"Int"},{"uuid":"01DF86BC-D697-45C8-AF3D-8ACCECE327F2","type":"f","value":50,"nodeType":"Float"},{"uuid":"AB046E6B-395B-4805-87E2-9E6AEBCC7C19","type":"f","value":145,"nodeType":"Float"},{"uuid":"F642A008-8F64-4856-9D3E-B95192BE334E","type":"f","value":1,"nodeType":"Float"},{"uuid":"997EA252-CEC2-427B-A16D-A2984C0A4AC5","type":"f","value":0,"nodeType":"Float"},{"uuid":"E52337AF-9169-4BA3-B9A0-BC10258EECA0","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7EE41305-6F99-40AA-B15E-E4D6AAFE4B29","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"22F235EE-AB38-4292-8636-FB7F104A8EE5","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"9B8DC357-F54F-4748-8DFA-6B38B2A04D29","type":"f","value":1,"nodeType":"Float"},{"uuid":"8BA5D6D4-E405-460F-A239-3B0A52B912AC","type":"i","value":1,"nodeType":"Int"},{"uuid":"D1046FCF-6FFF-4BDB-984D-9DD8FB9EF77D","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"045011A7-291D-4A4E-9F33-ED261771D0E4","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"712441FB-2EB5-4988-B6DC-BB0878751C3C","type":"f","value":1,"nodeType":"Float"},{"uuid":"32E110AD-1C37-411F-8154-3BD396EEE687","type":"f","value":2,"nodeType":"Float"},{"uuid":"FC7B1CAA-3923-46B0-BAFD-8A87CC75C4D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"8FCCF811-F309-4339-9394-E601106A4A30","type":"f","value":1,"nodeType":"Float"},{"uuid":"0323FBB3-BC7A-46DD-ACE6-C5589A9DC548","type":"i","value":2,"nodeType":"Int"},{"uuid":"6AB21F25-7568-4A57-8A9E-3F17E5011DB3","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7C33A40-2691-4D60-A07B-E6D0F9DBE14C","type":"i","value":0,"nodeType":"Int"},{"uuid":"5A079331-5A47-44D0-9317-A428ED548D8E","type":"f","value":30,"nodeType":"Float"},{"uuid":"82371467-24E0-45FB-9211-5A5569B8A39A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"8367690E-382D-4B08-914B-DDAF29984AB2","type":"f","value":10,"nodeType":"Float"},{"uuid":"9997C7BF-9D38-41FB-A3B9-EDF65F667422","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2FF37A43-6165-40D0-942E-BDD9CF56006E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"3E26E4A8-60A1-4476-934D-4137E27F89B0","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2B762492-C24C-4D43-A077-436131D6C53A","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"F688CC20-D448-4970-ABC7-F3C60F3B913E","type":"f","value":1,"nodeType":"Float"},{"uuid":"2267F869-B594-420D-8B3B-15E23EF256F0","type":"i","value":0,"nodeType":"Int"},{"uuid":"12C5319B-583B-45C7-B94F-DA81500FEBEE","type":"f","value":50,"nodeType":"Float"},{"uuid":"A7C36CBB-0157-4CD4-8ABD-38AAE919FC8B","type":"f","value":145,"nodeType":"Float"},{"uuid":"0ACDBFA4-5A95-4D82-A4C4-5D1477675D2D","type":"f","value":1,"nodeType":"Float"},{"uuid":"6BC7418F-86C1-4661-B3DF-CD17288F2FE2","type":"f","value":0,"nodeType":"Float"},{"uuid":"381BBA69-CDF9-466C-9CBC-3F4BFDB48F58","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AB62BE45-1023-4995-8329-26311718BBAF","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"3B314203-1CE2-44A2-8132-C4805F38F80D","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"2FE3D91A-9303-47DD-AF43-2E50A8179659","type":"f","value":1,"nodeType":"Float"},{"uuid":"52503820-F169-4881-A478-E493E4ED7AE0","type":"i","value":1,"nodeType":"Int"},{"uuid":"63C89441-C2A4-4AC0-875D-3122F4A11718","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"FBD50E71-72CE-4276-9316-CA4DB24F87E2","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"260D743C-E29D-432F-B6CA-1208B8A79AFB","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A6D2846-EA85-4C48-8CAD-5AE89929576C","type":"f","value":2,"nodeType":"Float"},{"uuid":"DAA2CEE9-9645-484E-AD21-E0711EC81530","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD07F2A6-D6DB-417D-81AC-4A9B9C0E8EA8","type":"f","value":1,"nodeType":"Float"},{"uuid":"8F18F17B-195E-44DE-8F0A-FAEDD126035B","type":"i","value":2,"nodeType":"Int"},{"uuid":"45E7AEB9-2102-4DB1-83FF-55CA45148D58","type":"f","value":1,"nodeType":"Float"},{"uuid":"DDA481FD-9FCC-43F5-8439-23EA5AD1BDB2","type":"i","value":0,"nodeType":"Int"},{"uuid":"3DB281B5-F694-46F3-BF7F-9E8621688964","type":"f","value":30,"nodeType":"Float"},{"uuid":"1864FCEE-12B0-4083-B860-4D719020FBBA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"491DA96E-A3FF-4D05-B3E0-FE5279AE716A","type":"f","value":10,"nodeType":"Float"},{"uuid":"B35FD5E2-A120-48D9-B15F-13C257983630","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F194608B-0808-46BF-AC97-73A20BDC1A18","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FBD449C4-5519-4F7A-97DE-548C12BE26FF","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"54DFCBD9-B44C-4A7C-B0A1-EA7D63CB54B3","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"503BF966-4B53-4273-B5F8-9C6F05C28B1E","project":false,"nodeType":"Texture"},{"uuid":"503BF966-4B53-4273-B5F8-9C6F05C28B1E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"ED58C007-4733-44BA-B707-800667B3EA0F","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"72243730-115C-4D36-A6D4-A855175C506F","project":false,"nodeType":"Texture"},{"uuid":"72243730-115C-4D36-A6D4-A855175C506F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B3A22F63-86BD-4ECF-86FD-F00F24B52B52","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"3A5742C0-5103-4C3B-8E4E-B6DC394BE87A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8680F2C8-F8CA-4D50-BF81-BF78F72910D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"4EB5AF97-9608-4A9A-8139-3AEC4AF143D3","type":"f","value":50,"nodeType":"Float"},{"uuid":"81D0427E-1644-48A6-B9EE-FDA467907831","type":"f","value":145,"nodeType":"Float"},{"uuid":"CA1FFA70-EB60-4934-9A84-EC49289C4869","type":"f","value":1,"nodeType":"Float"},{"uuid":"459A2302-A722-4B7B-B139-D395ECC96B18","type":"f","value":0,"nodeType":"Float"},{"uuid":"B7F10256-07FD-42CA-A9D5-A828A5B71830","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"12A7FD91-D94B-434C-A678-8ECE38B6E49E","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"468DD8F3-DFC4-4702-ABE2-4FE7D83DFA09","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"C0FE718E-50FF-422F-BEBD-827EED30A327","type":"f","value":1,"nodeType":"Float"},{"uuid":"30038AC1-CD06-4080-86DF-DFC231023C5B","type":"i","value":1,"nodeType":"Int"},{"uuid":"51D0E871-524F-4F56-9865-29CB6FE44EA5","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"AA6F04BB-0324-4A1F-871E-A8C0F3EBD726","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BE01F939-B249-4DC6-9854-D9B379E9BCC9","type":"f","value":1,"nodeType":"Float"},{"uuid":"0D48A87C-9E4C-45FA-9779-BD0D34EB546D","type":"f","value":2,"nodeType":"Float"},{"uuid":"BBF70BBD-DB16-4E9B-BF87-A452001D9F49","type":"f","value":1,"nodeType":"Float"},{"uuid":"BBAD0BC5-9260-4CC5-AB28-E535E984CB85","type":"f","value":1,"nodeType":"Float"},{"uuid":"D478EDDA-0D62-4559-A8DC-97B746DCB6CD","type":"i","value":2,"nodeType":"Int"},{"uuid":"417B1E61-6628-480A-9583-17E0897A3BAF","type":"phong","color":"F964553C-780B-4F62-A6AB-2DADEC81C739","specular":"1864FCEE-12B0-4083-B860-4D719020FBBA","shininess":"3DB281B5-F694-46F3-BF7F-9E8621688964","shadingAlpha":"45E7AEB9-2102-4DB1-83FF-55CA45148D58","shadingBlend":"DDA481FD-9FCC-43F5-8439-23EA5AD1BDB2","afterColor":"9EFB98D6-0CCE-46D5-89F5-E6E65828851F","alpha":"9A095D88-5AC6-463D-AE20-ABE2FA00A3A2","nodeType":"Phong"},{"uuid":"F964553C-780B-4F62-A6AB-2DADEC81C739","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"9EFB98D6-0CCE-46D5-89F5-E6E65828851F","type":"v3","a":"AF7067DA-48A7-4046-80ED-0B1CBF0E3605","b":"BF77349A-7849-4AEB-9A4F-889C702177CF","alpha":"036FB9D1-1A51-4993-AA99-B7B7CA93BFC1","mode":"D478EDDA-0D62-4559-A8DC-97B746DCB6CD","nodeType":"Blend"},{"uuid":"AF7067DA-48A7-4046-80ED-0B1CBF0E3605","type":"v3","a":"390E15A3-B358-41EF-AC1D-CCBADB08C338","b":"19878764-AF77-42B7-866C-D3B05C55BBA9","alpha":"B7E53342-A15D-48C9-9046-11E34366510B","mode":"30038AC1-CD06-4080-86DF-DFC231023C5B","nodeType":"Blend"},{"uuid":"390E15A3-B358-41EF-AC1D-CCBADB08C338","type":"v3","a":"E55822B0-3FFB-4B49-A222-B7A8EEF7E916","b":"4FDC7D8E-B269-422D-BB62-12BE21170203","alpha":"9D1E60F2-3A5E-4AEC-A168-BB6FCE88F6E4","mode":"8680F2C8-F8CA-4D50-BF81-BF78F72910D3","nodeType":"Blend"},{"uuid":"E55822B0-3FFB-4B49-A222-B7A8EEF7E916","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4FDC7D8E-B269-422D-BB62-12BE21170203","type":"v3","thickness":"491DA96E-A3FF-4D05-B3E0-FE5279AE716A","ior":"B35FD5E2-A120-48D9-B15F-13C257983630","roughness":"F194608B-0808-46BF-AC97-73A20BDC1A18","alpha":"3A5742C0-5103-4C3B-8E4E-B6DC394BE87A","calpha":"g4FDC7D8EB269422DBB6212BE21170203_calpha","nodeType":"Transmission"},{"uuid":"9D1E60F2-3A5E-4AEC-A168-BB6FCE88F6E4","type":"f","src":"g4FDC7D8EB269422DBB6212BE21170203_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"19878764-AF77-42B7-866C-D3B05C55BBA9","type":"v3","near":"4EB5AF97-9608-4A9A-8139-3AEC4AF143D3","far":"81D0427E-1644-48A6-B9EE-FDA467907831","isVector":"CA1FFA70-EB60-4934-9A84-EC49289C4869","isWorldSpace":"459A2302-A722-4B7B-B139-D395ECC96B18","origin":"B7F10256-07FD-42CA-A9D5-A828A5B71830","colorA":"12A7FD91-D94B-434C-A678-8ECE38B6E49E","colorB":"468DD8F3-DFC4-4702-ABE2-4FE7D83DFA09","alpha":"C0FE718E-50FF-422F-BEBD-827EED30A327","nodeType":"Depth"},{"uuid":"B7E53342-A15D-48C9-9046-11E34366510B","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"C0FE718E-50FF-422F-BEBD-827EED30A327"},"nodeType":"Expression"},{"uuid":"BF77349A-7849-4AEB-9A4F-889C702177CF","type":"v3","color":"51D0E871-524F-4F56-9865-29CB6FE44EA5","bias":"AA6F04BB-0324-4A1F-871E-A8C0F3EBD726","scale":"BE01F939-B249-4DC6-9854-D9B379E9BCC9","intensity":"0D48A87C-9E4C-45FA-9779-BD0D34EB546D","factor":"BBF70BBD-DB16-4E9B-BF87-A452001D9F49","alpha":"BBAD0BC5-9260-4CC5-AB28-E535E984CB85","mode":"D478EDDA-0D62-4559-A8DC-97B746DCB6CD","calpha":"gBF77349A78494AEB9A4F889C702177CF_calpha","nodeType":"Fresnel"},{"uuid":"036FB9D1-1A51-4993-AA99-B7B7CA93BFC1","type":"f","src":"gBF77349A78494AEB9A4F889C702177CF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9A095D88-5AC6-463D-AE20-ABE2FA00A3A2","type":"f","value":1,"nodeType":"Float"},{"uuid":"047B2AE5-32F6-4B12-AF37-BC20167EFE39","type":"f","value":1,"nodeType":"Float"},{"uuid":"BCE8C847-8DD7-4FB8-B68E-58A4F3E0B566","type":"i","value":0,"nodeType":"Int"},{"uuid":"C0C17D22-5DD4-406B-AD24-683FC7A66737","type":"f","value":30,"nodeType":"Float"},{"uuid":"695314BD-7E7D-4C35-9938-05A5C8F75274","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"41D8AEF1-21A1-4A15-8CED-D9022C9DC081","type":"f","value":10,"nodeType":"Float"},{"uuid":"37CDFD18-A163-4D49-B56A-E84BD1F76DEB","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"CD873B46-134A-4DA7-9AE0-92ECFDD4CF34","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B195EE00-4F88-4D13-B625-7DE8AB84BEAD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"6BD2CB73-38BF-4C42-9094-CA794E5EA51C","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"CBD09871-4CA3-4591-AAE9-C175AEE79733","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD8CB328-6553-4EA9-9A0C-C5CCEA7E6310","type":"i","value":0,"nodeType":"Int"},{"uuid":"423A09FD-5968-4EC1-A725-82A8337B31F3","type":"f","value":50,"nodeType":"Float"},{"uuid":"7509B6E0-89AC-4757-93E0-BBFDE4F94E58","type":"f","value":105,"nodeType":"Float"},{"uuid":"CE8D7042-0407-4998-A2C1-5A4B2102F1C3","type":"f","value":1,"nodeType":"Float"},{"uuid":"E135B279-528C-4F93-8645-0D0932788B83","type":"f","value":0,"nodeType":"Float"},{"uuid":"D2871C63-60B0-41D0-BCD0-EEED612B928C","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7DF56CDE-BB17-4D8F-8AA3-15B4CD60F15D","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"FDC36817-6F7D-4BF2-A4B8-B99798017BA9","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"D90988D3-B6EE-4721-96C9-49797B4E2A65","type":"f","value":1,"nodeType":"Float"},{"uuid":"2FC39A8B-2A66-49FB-BDB3-CCEF57E0393F","type":"i","value":1,"nodeType":"Int"},{"uuid":"44917772-915A-4405-989F-02FB60FE56CE","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"F5F768CE-1771-488B-83DC-9667545F2446","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"42129300-E71A-4F35-8FD5-A1FD3B2DF856","type":"f","value":1,"nodeType":"Float"},{"uuid":"08AC00AF-B457-4223-B2AB-A815CDA17ED1","type":"f","value":2,"nodeType":"Float"},{"uuid":"DFC492B4-3958-4779-BFF5-093285E12288","type":"f","value":1,"nodeType":"Float"},{"uuid":"3242EC9C-AAEA-4B12-A0B0-ABDE042E82CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"87FE3B54-1EE9-4C15-9C72-670FDEE20E75","type":"i","value":2,"nodeType":"Int"},{"uuid":"315AB562-DB11-41F9-B26D-04420584C6B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"DDF43A94-945D-4FE6-BE3C-4E6DE2B6A1FA","type":"i","value":0,"nodeType":"Int"},{"uuid":"700C52AF-70DE-4E6D-8DA8-04A580383188","type":"f","value":30,"nodeType":"Float"},{"uuid":"8C6D43EB-88EB-4BA7-A727-A7F8DE119BB0","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"6EA4BC7F-D68D-4624-8C71-799D2A025CAC","type":"f","value":10,"nodeType":"Float"},{"uuid":"CA7B81D4-5CF6-4056-9551-0969CFA98FD7","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"B08237E6-A9D6-4165-B3C5-AB1A15BF83F4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0A3AB4EB-B406-4E45-AE78-A4D97FFAECA3","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"8DDEFB3C-2766-428B-AF5F-56201EFDCA24","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"F94FC0F9-2F7C-4DC5-A560-496E4249030A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BB4F68BA-7FFA-418F-9427-77FFD504E61B","type":"i","value":0,"nodeType":"Int"},{"uuid":"3CFB017A-AF3A-4E39-8A25-8F86A53E0CEC","type":"f","value":50,"nodeType":"Float"},{"uuid":"D287FA83-3822-4173-980A-88DC3835BA33","type":"f","value":105,"nodeType":"Float"},{"uuid":"782EDBD3-D1B3-4408-9253-89523922E546","type":"f","value":1,"nodeType":"Float"},{"uuid":"0C77DE25-3E4A-49D8-83D1-A17CB62F9E7F","type":"f","value":0,"nodeType":"Float"},{"uuid":"C803F0E7-7966-42A5-904E-BF4A0D577B69","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"0F5936A4-99D9-4401-9832-7989F677F173","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"AE13EA2D-97AD-4092-8846-BEBBCA68E94C","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"81D653B6-AFE3-442D-B0EC-C9E37469C074","type":"f","value":1,"nodeType":"Float"},{"uuid":"06912314-DF25-4090-84AC-6D86C1E48577","type":"i","value":1,"nodeType":"Int"},{"uuid":"FDFB7F0F-D161-4590-A15B-B14F215AA8CE","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"DD0434EE-19A6-432C-84A9-68005E220303","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5B24962E-8C30-4A6B-A464-61374A6A0F79","type":"f","value":1,"nodeType":"Float"},{"uuid":"A927549B-D4DC-4388-BCC0-254D83341484","type":"f","value":2,"nodeType":"Float"},{"uuid":"E44F193B-83E3-447E-8629-20E6F106B4E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"FCDA1579-910D-4151-B9C5-E6F54C50A782","type":"f","value":1,"nodeType":"Float"},{"uuid":"575561DB-2CC2-4B4F-8237-941502D0BB5B","type":"i","value":2,"nodeType":"Int"},{"uuid":"54EB7A63-22C8-46CA-9399-8A20E09DE21A","type":"f","value":1,"nodeType":"Float"},{"uuid":"6B2DA18F-C590-44F6-ADD1-F6AE838F869A","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C8FD28C-A212-4D86-8C29-48CC9094CA02","type":"f","value":30,"nodeType":"Float"},{"uuid":"5524A6E5-6F61-4A5F-AC59-7F6C827E9572","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"57C87135-3559-46DC-8DEF-3B0F3DAB494D","type":"f","value":10,"nodeType":"Float"},{"uuid":"42180D63-AE5F-4BF9-914D-16129F014D24","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"7D3CD008-970A-4C60-A6FB-C6BBA8B01D8F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"41E20514-3264-4482-B5CF-852DBB4D0D71","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B2D2EA05-64AF-48C6-9FB6-FBD344A9E4B7","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"0979E9E0-1F98-4CA8-8048-706FB2E1E61E","project":false,"nodeType":"Texture"},{"uuid":"0979E9E0-1F98-4CA8-8048-706FB2E1E61E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"975366BA-6828-4690-995D-BC867D9BB3A9","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"EE969258-6F80-45C9-89CB-CD74FF51FBBD","project":false,"nodeType":"Texture"},{"uuid":"EE969258-6F80-45C9-89CB-CD74FF51FBBD","type":"v2","index":0,"nodeType":"UV"},{"uuid":"645A95FB-4B7B-4DE0-AB4F-D7ED17B96586","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"B79C2E30-B61B-4D6D-BFD0-FB0250E47347","type":"f","value":1,"nodeType":"Float"},{"uuid":"0931B1AA-E056-4B2F-8B4C-04A0F47884F5","type":"i","value":0,"nodeType":"Int"},{"uuid":"ADAE8EB4-3F41-49DA-B77B-1FD2CC0731EE","type":"f","value":50,"nodeType":"Float"},{"uuid":"3A7E7721-9983-4203-BF05-9AE2E327DE10","type":"f","value":105,"nodeType":"Float"},{"uuid":"FBB6598C-834A-4CDE-ABA9-CCE434BA7120","type":"f","value":1,"nodeType":"Float"},{"uuid":"787D1C78-0BB5-49DE-862D-6045D3235871","type":"f","value":0,"nodeType":"Float"},{"uuid":"E8146A40-1B76-4A3C-A820-1168202C5544","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"861DA8EF-ED4E-4821-943B-A76994A23002","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"48A52FCF-E737-413E-ABC4-DF875AC49C94","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"0D58AD15-DDBF-4B6F-8623-C4F9A0B32A46","type":"f","value":1,"nodeType":"Float"},{"uuid":"F11404C7-5027-4E29-A5E6-419C055EF5B6","type":"i","value":1,"nodeType":"Int"},{"uuid":"C2EB89E7-9736-4723-B9C8-E7980B94ACBE","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"7833D89A-E6E3-49D7-8464-1C2F22AFDF69","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9C7C4108-1C10-496F-A257-80B6B2CDD800","type":"f","value":1,"nodeType":"Float"},{"uuid":"AA39C163-AA9F-42B6-989E-C4B98462D64D","type":"f","value":2,"nodeType":"Float"},{"uuid":"BFEDC52B-6580-4854-8281-83BE65164ED9","type":"f","value":1,"nodeType":"Float"},{"uuid":"DC1A9B09-76EF-446B-9E43-978DF2DB291F","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A342BA7-592A-46B0-BCBA-9A43C5F51F11","type":"i","value":2,"nodeType":"Int"},{"uuid":"38E5A9D4-B30B-4425-92D1-40582A4CB968","type":"phong","color":"C5D46767-BF76-47C1-95B1-654DA3247BDE","specular":"5524A6E5-6F61-4A5F-AC59-7F6C827E9572","shininess":"2C8FD28C-A212-4D86-8C29-48CC9094CA02","shadingAlpha":"54EB7A63-22C8-46CA-9399-8A20E09DE21A","shadingBlend":"6B2DA18F-C590-44F6-ADD1-F6AE838F869A","afterColor":"2CBB5FE7-21A2-4F20-AFE9-637FE24EDB2E","alpha":"3BC4732B-DC87-4094-B4E0-93859329AEDB","nodeType":"Phong"},{"uuid":"C5D46767-BF76-47C1-95B1-654DA3247BDE","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"2CBB5FE7-21A2-4F20-AFE9-637FE24EDB2E","type":"v3","a":"B7EE1603-EF38-49AD-900A-94A6B7BFBDD7","b":"C8201D36-A618-4974-B1F4-405B6717339B","alpha":"F8F14B3C-1CDD-4029-BEF7-97CAF508C398","mode":"6A342BA7-592A-46B0-BCBA-9A43C5F51F11","nodeType":"Blend"},{"uuid":"B7EE1603-EF38-49AD-900A-94A6B7BFBDD7","type":"v3","a":"EC65E177-8104-42B4-838E-3C81D7BBC4D9","b":"FC066C0D-DF54-47F2-AB36-D6C9AA05E4EE","alpha":"2E04D33D-C83E-4EEF-9CE8-D7FC3871B48F","mode":"F11404C7-5027-4E29-A5E6-419C055EF5B6","nodeType":"Blend"},{"uuid":"EC65E177-8104-42B4-838E-3C81D7BBC4D9","type":"v3","a":"A657224D-CF71-472D-8586-7102575BCE83","b":"FC0528BB-A6BF-4D2F-8E62-87F3D9AF5930","alpha":"216AF6D2-E605-4C11-AFEE-1DDB7E804FF5","mode":"0931B1AA-E056-4B2F-8B4C-04A0F47884F5","nodeType":"Blend"},{"uuid":"A657224D-CF71-472D-8586-7102575BCE83","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"FC0528BB-A6BF-4D2F-8E62-87F3D9AF5930","type":"v3","thickness":"57C87135-3559-46DC-8DEF-3B0F3DAB494D","ior":"42180D63-AE5F-4BF9-914D-16129F014D24","roughness":"7D3CD008-970A-4C60-A6FB-C6BBA8B01D8F","alpha":"B79C2E30-B61B-4D6D-BFD0-FB0250E47347","calpha":"gFC0528BBA6BF4D2F8E6287F3D9AF5930_calpha","nodeType":"Transmission"},{"uuid":"216AF6D2-E605-4C11-AFEE-1DDB7E804FF5","type":"f","src":"gFC0528BBA6BF4D2F8E6287F3D9AF5930_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"FC066C0D-DF54-47F2-AB36-D6C9AA05E4EE","type":"v3","near":"ADAE8EB4-3F41-49DA-B77B-1FD2CC0731EE","far":"3A7E7721-9983-4203-BF05-9AE2E327DE10","isVector":"FBB6598C-834A-4CDE-ABA9-CCE434BA7120","isWorldSpace":"787D1C78-0BB5-49DE-862D-6045D3235871","origin":"E8146A40-1B76-4A3C-A820-1168202C5544","colorA":"861DA8EF-ED4E-4821-943B-A76994A23002","colorB":"48A52FCF-E737-413E-ABC4-DF875AC49C94","alpha":"0D58AD15-DDBF-4B6F-8623-C4F9A0B32A46","nodeType":"Depth"},{"uuid":"2E04D33D-C83E-4EEF-9CE8-D7FC3871B48F","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"0D58AD15-DDBF-4B6F-8623-C4F9A0B32A46"},"nodeType":"Expression"},{"uuid":"C8201D36-A618-4974-B1F4-405B6717339B","type":"v3","color":"C2EB89E7-9736-4723-B9C8-E7980B94ACBE","bias":"7833D89A-E6E3-49D7-8464-1C2F22AFDF69","scale":"9C7C4108-1C10-496F-A257-80B6B2CDD800","intensity":"AA39C163-AA9F-42B6-989E-C4B98462D64D","factor":"BFEDC52B-6580-4854-8281-83BE65164ED9","alpha":"DC1A9B09-76EF-446B-9E43-978DF2DB291F","mode":"6A342BA7-592A-46B0-BCBA-9A43C5F51F11","calpha":"gC8201D36A6184974B1F4405B6717339B_calpha","nodeType":"Fresnel"},{"uuid":"F8F14B3C-1CDD-4029-BEF7-97CAF508C398","type":"f","src":"gC8201D36A6184974B1F4405B6717339B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3BC4732B-DC87-4094-B4E0-93859329AEDB","type":"f","value":1,"nodeType":"Float"},{"uuid":"FBA447A7-89E5-45AC-B6A1-55D088981238","type":"f","value":1,"nodeType":"Float"},{"uuid":"24DD2C7A-ED66-4034-89A4-430A3B103523","type":"i","value":0,"nodeType":"Int"},{"uuid":"49B74F8C-8BA7-4469-BAE2-4198D320119B","type":"f","value":30,"nodeType":"Float"},{"uuid":"1912800F-CE57-4173-9502-ACEB63B6824A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"E2031B50-E41D-40E8-9E8B-261769DBE54B","type":"f","value":10,"nodeType":"Float"},{"uuid":"2D6F2ACA-103E-4F89-837D-BC818A26084D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3EC4D8D3-3257-4007-9F3C-96DB40FD977C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"59A0048A-B6E4-4EAD-9EE9-76887221009C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"1CCA3F1A-D2BA-43EF-B7EB-894938E5AF3A","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"887A6637-EFAA-477A-A881-8FD9410D1B03","type":"f","value":1,"nodeType":"Float"},{"uuid":"8BC89B9C-76E7-4224-BF51-06B868FDF428","type":"i","value":0,"nodeType":"Int"},{"uuid":"DF99167F-A6B2-4B04-B044-BD43AF8FAA90","type":"f","value":50,"nodeType":"Float"},{"uuid":"91A7EA1B-7A00-48B6-9C50-08C3E82D6881","type":"f","value":145,"nodeType":"Float"},{"uuid":"D1B6DC2A-668F-4A18-BFFC-7B7201C43D6A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4BC7142-4C71-4E8E-AE17-C65B3015A24D","type":"f","value":0,"nodeType":"Float"},{"uuid":"41A19BB6-2BBC-4FED-BD75-1F85D3859381","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FA3D04F9-1EA3-49F7-803A-DD6EFBB52364","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"29E85F1E-8CA5-4BBC-A5BB-01307DB95B32","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"69ECA436-EFDD-48FC-8E86-738DF623958A","type":"f","value":1,"nodeType":"Float"},{"uuid":"DAFA846A-DB65-400D-93F4-858AF1444F45","type":"i","value":1,"nodeType":"Int"},{"uuid":"C1EFC22E-8174-432B-90C7-3FCDFB0B881B","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"5E3E28F9-1F63-4B72-84A6-43E99EAB9A54","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B8B35E61-6BE0-4300-96CE-7D0A56F1BFA1","type":"f","value":1,"nodeType":"Float"},{"uuid":"38714B37-D022-4AFE-A8DC-B7FD61D0A932","type":"f","value":2,"nodeType":"Float"},{"uuid":"B7778E14-CC39-46C0-94EF-F23E15F7D874","type":"f","value":1,"nodeType":"Float"},{"uuid":"A784221E-F280-4213-850E-1F2F64C7C98E","type":"f","value":1,"nodeType":"Float"},{"uuid":"1280A5A8-96B0-4E6D-AEEF-0F323C2D4DC1","type":"i","value":2,"nodeType":"Int"},{"uuid":"3D2E76EC-CE31-4BCA-9F3A-284948258027","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BC7B9E0-7C05-4379-8461-8C5B6274D813","type":"i","value":0,"nodeType":"Int"},{"uuid":"A223C599-605F-463A-A3BE-93B16E697C3C","type":"f","value":30,"nodeType":"Float"},{"uuid":"B1EEA7D4-FB5D-4315-9E88-56AEC0032C5B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"C10C9595-CF61-4E29-AA9D-C7492988C375","type":"f","value":10,"nodeType":"Float"},{"uuid":"F56731C7-00D7-4B32-ADF2-A0A22C48B586","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"86B62E67-EEBC-4296-89A1-6C555AD6E3EE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"03D2A3B9-6BF3-4DE2-A760-AB286409BC78","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"80F67D10-EF5D-4C90-BC0E-EE27F275BFBF","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"114A7091-A866-457A-AB11-FD5D881BF5E3","type":"f","value":1,"nodeType":"Float"},{"uuid":"0BF7C33B-8C46-4C9E-B340-39FF51C22A49","type":"i","value":0,"nodeType":"Int"},{"uuid":"15E9013D-6D3F-4AC3-A661-556D0B5EB8AB","type":"f","value":50,"nodeType":"Float"},{"uuid":"DF94ACB6-175A-4116-9A94-218D5DC4E5B4","type":"f","value":145,"nodeType":"Float"},{"uuid":"FC0B1CC7-46EC-4150-9850-C3DBFBE39176","type":"f","value":1,"nodeType":"Float"},{"uuid":"108A33A5-ED00-4EA4-B0A7-72B9D6C321F6","type":"f","value":0,"nodeType":"Float"},{"uuid":"2AF0C95A-99E5-4A60-B9D7-DAE7FC4A36F9","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"CFBCEE76-9CC4-45C1-93B6-45FD786B8580","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"0F57DAF5-98C1-44B9-8C37-9EAAD64BABF8","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"BD809C0C-705C-40CC-ACB5-61166F3ACAE2","type":"f","value":1,"nodeType":"Float"},{"uuid":"03695B75-77BE-4EAC-9CA3-7B579B533D35","type":"i","value":1,"nodeType":"Int"},{"uuid":"D46B2488-044B-443F-BD34-B88816B3323C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"721BB10D-FDAB-44CE-9E92-B9CCC32364E0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9F582663-4FAD-4024-92EB-3C8EA90EFFFF","type":"f","value":1,"nodeType":"Float"},{"uuid":"47259AD5-9BA6-4E67-BCD4-DACCF71E52D7","type":"f","value":2,"nodeType":"Float"},{"uuid":"18CEA317-EF9E-43B7-9B8E-F10965D273CC","type":"f","value":1,"nodeType":"Float"},{"uuid":"7DC299FA-74E2-4C0C-8414-96D4877A209C","type":"f","value":1,"nodeType":"Float"},{"uuid":"6F06BF70-D52C-4C87-A739-E72478DE139F","type":"i","value":2,"nodeType":"Int"},{"uuid":"28179318-398C-4BDC-AD0D-AA7277978415","type":"f","value":1,"nodeType":"Float"},{"uuid":"08EC1063-7652-404D-A0AF-CDDE990697DE","type":"i","value":0,"nodeType":"Int"},{"uuid":"53FDA40D-DC7A-4E18-8219-D0F45CAF2F42","type":"f","value":30,"nodeType":"Float"},{"uuid":"8E0A75F1-87D0-4DF7-A62B-3695BEB6593D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"4559F90A-8639-4BF4-A186-14CEEC52484C","type":"f","value":10,"nodeType":"Float"},{"uuid":"325A359B-3426-45CD-8932-FE72DD4A9BD0","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"968095E9-A8F3-42ED-ADEA-FC52CF840AD7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0F893202-5541-4A7E-9E6D-CED3B53B1877","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A0BE48F4-7F08-43BC-86A4-8A6BC9C402B2","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"45F8BCFA-DCCB-46A6-A3D8-0C6D8933840F","project":false,"nodeType":"Texture"},{"uuid":"45F8BCFA-DCCB-46A6-A3D8-0C6D8933840F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"85F78DA1-BE4D-4771-A7DE-CCC4C19EACD4","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"2D7BBB86-ADC9-4BF0-8509-EFC98B1EB87C","project":false,"nodeType":"Texture"},{"uuid":"2D7BBB86-ADC9-4BF0-8509-EFC98B1EB87C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"D7FD4759-CE92-4342-B4E6-14017EBECC7C","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"ECB0F90B-A97C-4123-BB74-E015298155A3","type":"f","value":1,"nodeType":"Float"},{"uuid":"E7226147-95F4-43AD-849A-55E8F02735BD","type":"i","value":0,"nodeType":"Int"},{"uuid":"158DD91D-31AE-4327-BD8A-58445362ED4A","type":"f","value":50,"nodeType":"Float"},{"uuid":"BA7978D3-FE7C-49E6-BFB6-3D75AF03BC44","type":"f","value":145,"nodeType":"Float"},{"uuid":"057B69B3-8661-4234-A47B-AA55350953FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"2051A83F-2C1E-43D3-90D5-29648ACADBF2","type":"f","value":0,"nodeType":"Float"},{"uuid":"16AC809D-93E3-4BA5-B996-7F041C3D4A2F","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AB5948FD-1DDA-4CDC-882D-3AC50D94241F","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"CCA48EBC-1424-44A9-88AE-C2311DA6F996","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"40104487-46E8-4025-9682-17795D761B73","type":"f","value":1,"nodeType":"Float"},{"uuid":"1EAA3905-562F-42DD-ACF5-2D6E9A5655FE","type":"i","value":1,"nodeType":"Int"},{"uuid":"87B63B0D-3D66-47D0-A4DF-BD6F3700A6A3","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"AFE0E09B-673B-4E8B-A7FD-7AE40614CE6C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9E8FE047-0D5F-4CAC-A148-369BFA6A524A","type":"f","value":1,"nodeType":"Float"},{"uuid":"1262F8D8-7221-492B-A6B6-58C070FF5B53","type":"f","value":2,"nodeType":"Float"},{"uuid":"E00ED3E3-EA60-41C5-9984-E06B92936367","type":"f","value":1,"nodeType":"Float"},{"uuid":"2FEE591B-4508-4B5E-817C-51454B03C8BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"928AEDB1-E575-45FF-B8C8-6E32F743CC36","type":"i","value":2,"nodeType":"Int"},{"uuid":"F03C42AE-D7B7-406D-AC8B-29354B5F2AFE","type":"phong","color":"30B9C457-4300-47D6-A635-22524BA35121","specular":"8E0A75F1-87D0-4DF7-A62B-3695BEB6593D","shininess":"53FDA40D-DC7A-4E18-8219-D0F45CAF2F42","shadingAlpha":"28179318-398C-4BDC-AD0D-AA7277978415","shadingBlend":"08EC1063-7652-404D-A0AF-CDDE990697DE","afterColor":"3D4A1380-BFBD-4987-B5A3-5ABD09A6093E","alpha":"E8EE3BD2-D345-4D6C-ACD4-1BE82C480A92","nodeType":"Phong"},{"uuid":"30B9C457-4300-47D6-A635-22524BA35121","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"3D4A1380-BFBD-4987-B5A3-5ABD09A6093E","type":"v3","a":"FBB6D00E-60B2-4B81-AE63-B7783B98A5E7","b":"159DB78F-19E2-40B4-843A-E8391FD6999D","alpha":"3B5A72BA-6C6E-458C-B1F7-9298E78B9CE0","mode":"928AEDB1-E575-45FF-B8C8-6E32F743CC36","nodeType":"Blend"},{"uuid":"FBB6D00E-60B2-4B81-AE63-B7783B98A5E7","type":"v3","a":"273333AB-D422-4271-AA52-90CF033444BF","b":"00835978-F305-4099-A622-11F2E89DEF9F","alpha":"4B75CC35-3887-4857-82D7-D8E35F05DB1B","mode":"1EAA3905-562F-42DD-ACF5-2D6E9A5655FE","nodeType":"Blend"},{"uuid":"273333AB-D422-4271-AA52-90CF033444BF","type":"v3","a":"6367829A-7A65-4C2A-BD20-278F2A8658B0","b":"172854BD-61F3-42AF-824A-5F138159F17C","alpha":"1DBBC5E0-3AD5-4E01-A89E-0C956BDABEA1","mode":"E7226147-95F4-43AD-849A-55E8F02735BD","nodeType":"Blend"},{"uuid":"6367829A-7A65-4C2A-BD20-278F2A8658B0","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"172854BD-61F3-42AF-824A-5F138159F17C","type":"v3","thickness":"4559F90A-8639-4BF4-A186-14CEEC52484C","ior":"325A359B-3426-45CD-8932-FE72DD4A9BD0","roughness":"968095E9-A8F3-42ED-ADEA-FC52CF840AD7","alpha":"ECB0F90B-A97C-4123-BB74-E015298155A3","calpha":"g172854BD61F342AF824A5F138159F17C_calpha","nodeType":"Transmission"},{"uuid":"1DBBC5E0-3AD5-4E01-A89E-0C956BDABEA1","type":"f","src":"g172854BD61F342AF824A5F138159F17C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"00835978-F305-4099-A622-11F2E89DEF9F","type":"v3","near":"158DD91D-31AE-4327-BD8A-58445362ED4A","far":"BA7978D3-FE7C-49E6-BFB6-3D75AF03BC44","isVector":"057B69B3-8661-4234-A47B-AA55350953FA","isWorldSpace":"2051A83F-2C1E-43D3-90D5-29648ACADBF2","origin":"16AC809D-93E3-4BA5-B996-7F041C3D4A2F","colorA":"AB5948FD-1DDA-4CDC-882D-3AC50D94241F","colorB":"CCA48EBC-1424-44A9-88AE-C2311DA6F996","alpha":"40104487-46E8-4025-9682-17795D761B73","nodeType":"Depth"},{"uuid":"4B75CC35-3887-4857-82D7-D8E35F05DB1B","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"40104487-46E8-4025-9682-17795D761B73"},"nodeType":"Expression"},{"uuid":"159DB78F-19E2-40B4-843A-E8391FD6999D","type":"v3","color":"87B63B0D-3D66-47D0-A4DF-BD6F3700A6A3","bias":"AFE0E09B-673B-4E8B-A7FD-7AE40614CE6C","scale":"9E8FE047-0D5F-4CAC-A148-369BFA6A524A","intensity":"1262F8D8-7221-492B-A6B6-58C070FF5B53","factor":"E00ED3E3-EA60-41C5-9984-E06B92936367","alpha":"2FEE591B-4508-4B5E-817C-51454B03C8BD","mode":"928AEDB1-E575-45FF-B8C8-6E32F743CC36","calpha":"g159DB78F19E240B4843AE8391FD6999D_calpha","nodeType":"Fresnel"},{"uuid":"3B5A72BA-6C6E-458C-B1F7-9298E78B9CE0","type":"f","src":"g159DB78F19E240B4843AE8391FD6999D_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E8EE3BD2-D345-4D6C-ACD4-1BE82C480A92","type":"f","value":1,"nodeType":"Float"},{"uuid":"B0835AE7-DCA2-4CF9-B207-3083E2D4750B","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"3558B092-ACCC-4BCF-8A89-B1F88DC522F0","nodeType":"Color"},{"uuid":"3558B092-ACCC-4BCF-8A89-B1F88DC522F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"9FDA3461-BCCD-48A7-A9D0-3A930F76F233","type":"i","value":0,"nodeType":"Int"},{"uuid":"3119DB25-A452-486F-AE8C-2F1D54FA6458","type":"f","value":1,"nodeType":"Float"},{"uuid":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","type":"i","value":0,"nodeType":"Int"},{"uuid":"F109CFFA-9AD1-400C-B55D-346DB4A4883B","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"6514A565-4614-427D-A948-E46CF6D3E5EA","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"5A6867AB-5490-496B-92DD-3C291B181B4C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B7B6933E-722C-404B-AD80-9D63DFC974D8","type":"f","value":1,"nodeType":"Float"},{"uuid":"3E9F6224-D176-4194-AAAA-53C57932B66C","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"E549CD5A-6A27-4F83-B36B-8B00D71479EF","type":"f","value":1,"nodeType":"Float"},{"uuid":"62302CDE-F692-494A-8967-765106EE0018","type":"f","value":1,"nodeType":"Float"},{"uuid":"7B6556F7-DA55-4502-BD40-54EA5535AD42","type":"i","value":0,"nodeType":"Int"},{"uuid":"4764F644-0523-437C-A906-6A4C6EA43507","type":"lambert","color":"B0835AE7-DCA2-4CF9-B207-3083E2D4750B","emissiveIntensity":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","shadingAlpha":"3119DB25-A452-486F-AE8C-2F1D54FA6458","shadingBlend":"33269A5C-23F6-4315-B46A-5C5365C4D2FB","afterColor":"1211C124-7BD7-4230-9E10-CB1B0173B5AA","alpha":"DA913C1D-F4FB-45BC-9988-70CCD0657598","emissive":"F109CFFA-9AD1-400C-B55D-346DB4A4883B","nodeType":"Lambert"},{"uuid":"9AFD6675-5C61-4E53-AAD8-C9334CC926C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"1211C124-7BD7-4230-9E10-CB1B0173B5AA","type":"v3","a":"9F39F28F-B3FA-46D2-B28E-FF04FFB02AA9","b":"CB18A2CE-872E-4BC8-9526-7E4C7317DF3D","alpha":"652B58C3-CC3A-4384-9E72-0591CA848370","mode":"7B6556F7-DA55-4502-BD40-54EA5535AD42","nodeType":"Blend"},{"uuid":"9F39F28F-B3FA-46D2-B28E-FF04FFB02AA9","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CB18A2CE-872E-4BC8-9526-7E4C7317DF3D","type":"v3","color":"6514A565-4614-427D-A948-E46CF6D3E5EA","bias":"5A6867AB-5490-496B-92DD-3C291B181B4C","scale":"B7B6933E-722C-404B-AD80-9D63DFC974D8","intensity":"3E9F6224-D176-4194-AAAA-53C57932B66C","factor":"E549CD5A-6A27-4F83-B36B-8B00D71479EF","alpha":"62302CDE-F692-494A-8967-765106EE0018","mode":"7B6556F7-DA55-4502-BD40-54EA5535AD42","calpha":"gCB18A2CE872E4BC895267E4C7317DF3D_calpha","nodeType":"Fresnel"},{"uuid":"652B58C3-CC3A-4384-9E72-0591CA848370","type":"f","src":"gCB18A2CE872E4BC895267E4C7317DF3D_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DA913C1D-F4FB-45BC-9988-70CCD0657598","type":"f","value":1,"nodeType":"Float"},{"uuid":"AF30BC4F-6437-4DF6-98C1-5235EBF9ED36","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"3F3A7E1C-735A-4613-9D96-3420011D8EB3","nodeType":"Color"},{"uuid":"3F3A7E1C-735A-4613-9D96-3420011D8EB3","type":"f","value":1,"nodeType":"Float"},{"uuid":"6EF9ECA2-8828-4B13-A223-0020672E2000","type":"i","value":0,"nodeType":"Int"},{"uuid":"8881BE93-8CA2-4F57-81D2-9EE56223B303","type":"f","value":1,"nodeType":"Float"},{"uuid":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","type":"i","value":0,"nodeType":"Int"},{"uuid":"02F61905-AF6D-4D97-8BA7-7B74AAB2C6B6","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"4B1BA364-A9B6-4D86-B081-221A4E8611BB","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"A7C7F972-0CB2-49CF-A044-5BCD491C9926","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"EA5A929E-8DAD-4C7F-ABBF-573424AE6B59","type":"f","value":1,"nodeType":"Float"},{"uuid":"93F28524-6EC2-4D4A-953A-B7041A062143","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"765E317C-7F8A-4A00-96A0-9D37F99B3BCA","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9F5AC18-6E5C-4BE5-B380-8BC7F3EFAFD8","type":"f","value":1,"nodeType":"Float"},{"uuid":"78615CA3-D84B-4997-92D9-73FDAECD6CBD","type":"i","value":0,"nodeType":"Int"},{"uuid":"A141BD81-5415-435E-9447-4B35842D83A9","type":"lambert","color":"AF30BC4F-6437-4DF6-98C1-5235EBF9ED36","emissiveIntensity":"F304A8E1-0424-4CF8-922F-FEF048A0652C","shadingAlpha":"8881BE93-8CA2-4F57-81D2-9EE56223B303","shadingBlend":"0072FAE6-E468-4E97-B41C-D32B1EF7A533","afterColor":"3FC7CF87-DF80-4A1C-B52C-55A08F4B1D7B","alpha":"BE52C837-0A04-4C9D-86C1-872943DAACCC","emissive":"02F61905-AF6D-4D97-8BA7-7B74AAB2C6B6","nodeType":"Lambert"},{"uuid":"F304A8E1-0424-4CF8-922F-FEF048A0652C","type":"f","value":1,"nodeType":"Float"},{"uuid":"3FC7CF87-DF80-4A1C-B52C-55A08F4B1D7B","type":"v3","a":"0AE8E127-78DF-4992-A1D6-5CF3147B6EEB","b":"5A69FEED-F917-4FAC-A76E-733237B38F05","alpha":"3C0EC629-A72E-407F-A02E-2E46F16D67C1","mode":"78615CA3-D84B-4997-92D9-73FDAECD6CBD","nodeType":"Blend"},{"uuid":"0AE8E127-78DF-4992-A1D6-5CF3147B6EEB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5A69FEED-F917-4FAC-A76E-733237B38F05","type":"v3","color":"4B1BA364-A9B6-4D86-B081-221A4E8611BB","bias":"A7C7F972-0CB2-49CF-A044-5BCD491C9926","scale":"EA5A929E-8DAD-4C7F-ABBF-573424AE6B59","intensity":"93F28524-6EC2-4D4A-953A-B7041A062143","factor":"765E317C-7F8A-4A00-96A0-9D37F99B3BCA","alpha":"C9F5AC18-6E5C-4BE5-B380-8BC7F3EFAFD8","mode":"78615CA3-D84B-4997-92D9-73FDAECD6CBD","calpha":"g5A69FEEDF9174FACA76E733237B38F05_calpha","nodeType":"Fresnel"},{"uuid":"3C0EC629-A72E-407F-A02E-2E46F16D67C1","type":"f","src":"g5A69FEEDF9174FACA76E733237B38F05_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BE52C837-0A04-4C9D-86C1-872943DAACCC","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6B88494-4B46-4706-9AE0-1CBFD6FC3ED2","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"0A6E8F68-EDC7-434C-83A9-2DC5AD6D8F5F","nodeType":"Color"},{"uuid":"0A6E8F68-EDC7-434C-83A9-2DC5AD6D8F5F","type":"f","value":1,"nodeType":"Float"},{"uuid":"72FB6D28-A81E-414F-A288-6E16B0604F01","type":"i","value":0,"nodeType":"Int"},{"uuid":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","type":"f","value":1,"nodeType":"Float"},{"uuid":"28318C5D-2966-4269-A1FB-4CE52FB1701B","type":"i","value":0,"nodeType":"Int"},{"uuid":"D74B4B70-A992-42B1-8C7D-074742CDA157","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"F59EB46B-3ED4-4423-B6D8-59F0C2D92F32","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"9123810A-C83C-485C-88BA-BB721211A7A7","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3AD274C8-61C1-45DE-B803-96CAE1DEFD64","type":"f","value":1,"nodeType":"Float"},{"uuid":"7CE13810-1F1A-4B64-B21D-A3AD9744B882","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"0B9F17A9-1E12-4E24-84A5-9C4FA1300E3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"6B2DB2C2-985C-4DB5-905D-6E9F2C605C3C","type":"f","value":1,"nodeType":"Float"},{"uuid":"3519E239-E3CB-4CF7-8B5D-CD4BCD0EACDA","type":"i","value":0,"nodeType":"Int"},{"uuid":"C231D72C-C7A6-4DAA-AD39-9030C5A81AF9","type":"lambert","color":"B6B88494-4B46-4706-9AE0-1CBFD6FC3ED2","emissiveIntensity":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","shadingAlpha":"562A224A-1A2F-4E2C-9BCF-F6E8CA115521","shadingBlend":"28318C5D-2966-4269-A1FB-4CE52FB1701B","afterColor":"89976D38-7E04-4B5A-B1C1-8DBB1119B169","alpha":"B7DE09B2-19AF-448B-B4C2-F9439E93C607","emissive":"D74B4B70-A992-42B1-8C7D-074742CDA157","nodeType":"Lambert"},{"uuid":"A6247DCE-7204-4B2F-83BB-5B209E916DC0","type":"f","value":1,"nodeType":"Float"},{"uuid":"89976D38-7E04-4B5A-B1C1-8DBB1119B169","type":"v3","a":"BCEC81BC-8C06-48FC-8327-0FA10106C05D","b":"76E4C4AA-1FDE-447F-8CCB-D673ECC2C37A","alpha":"7732DA32-A51A-451A-B15E-2731D0CAB743","mode":"3519E239-E3CB-4CF7-8B5D-CD4BCD0EACDA","nodeType":"Blend"},{"uuid":"BCEC81BC-8C06-48FC-8327-0FA10106C05D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"76E4C4AA-1FDE-447F-8CCB-D673ECC2C37A","type":"v3","color":"F59EB46B-3ED4-4423-B6D8-59F0C2D92F32","bias":"9123810A-C83C-485C-88BA-BB721211A7A7","scale":"3AD274C8-61C1-45DE-B803-96CAE1DEFD64","intensity":"7CE13810-1F1A-4B64-B21D-A3AD9744B882","factor":"0B9F17A9-1E12-4E24-84A5-9C4FA1300E3B","alpha":"6B2DB2C2-985C-4DB5-905D-6E9F2C605C3C","mode":"3519E239-E3CB-4CF7-8B5D-CD4BCD0EACDA","calpha":"g76E4C4AA1FDE447F8CCBD673ECC2C37A_calpha","nodeType":"Fresnel"},{"uuid":"7732DA32-A51A-451A-B15E-2731D0CAB743","type":"f","src":"g76E4C4AA1FDE447F8CCBD673ECC2C37A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B7DE09B2-19AF-448B-B4C2-F9439E93C607","type":"f","value":1,"nodeType":"Float"},{"uuid":"766A4593-0B23-42E7-8CD6-EB122ED10B62","type":"c","r":0.9058823529411765,"g":0.9450980392156862,"b":0.996078431372549,"value":15200766,"alpha":"9B9CFA3E-617C-486C-8A99-35F788F290DF","nodeType":"Color"},{"uuid":"9B9CFA3E-617C-486C-8A99-35F788F290DF","type":"f","value":1,"nodeType":"Float"},{"uuid":"7EA2B462-C188-47B1-9098-05FB94D3B080","type":"i","value":0,"nodeType":"Int"},{"uuid":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"968D04D9-56E9-40C6-90BD-CB97017364D0","type":"i","value":0,"nodeType":"Int"},{"uuid":"F2CBA3EA-6389-4932-A297-13294C37F9BD","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"526C68BD-522A-4F29-8944-D1D141779B58","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"DDAA63E6-25B9-442C-BA77-08774826617F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B73376D4-81B6-46EA-B316-B067ACE635DB","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC4424DA-38B7-4C9D-BBB8-847902C0DAE5","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"2AA17009-3F27-4B06-9200-6610B51BAFCC","type":"f","value":1,"nodeType":"Float"},{"uuid":"25B8FDCF-5D2D-4FAC-A5E5-82F0DFF85D33","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9DACDAE-1FD6-4E8D-8481-C5E18EDDDEAB","type":"i","value":0,"nodeType":"Int"},{"uuid":"4F33245C-5397-42B0-A855-0E78CCD99A46","type":"lambert","color":"766A4593-0B23-42E7-8CD6-EB122ED10B62","emissiveIntensity":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","shadingAlpha":"BE68FEE7-3E58-42F1-A017-B3A6C54B31B4","shadingBlend":"968D04D9-56E9-40C6-90BD-CB97017364D0","afterColor":"D62794B5-FFE0-42EF-B6C2-9961BD855850","alpha":"D96F9E4C-4F5C-4FE5-AD89-C05EB8B3DB67","emissive":"F2CBA3EA-6389-4932-A297-13294C37F9BD","nodeType":"Lambert"},{"uuid":"21B6E8E0-94D0-40F6-B6FE-072DC0BDBE3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D62794B5-FFE0-42EF-B6C2-9961BD855850","type":"v3","a":"D4DB12DB-4B89-4A9A-8BEB-818487C796DA","b":"0C09C2CC-FFA5-4898-9752-E63F199223AA","alpha":"895B6E51-0450-4BF9-AD76-909F43003A44","mode":"D9DACDAE-1FD6-4E8D-8481-C5E18EDDDEAB","nodeType":"Blend"},{"uuid":"D4DB12DB-4B89-4A9A-8BEB-818487C796DA","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0C09C2CC-FFA5-4898-9752-E63F199223AA","type":"v3","color":"526C68BD-522A-4F29-8944-D1D141779B58","bias":"DDAA63E6-25B9-442C-BA77-08774826617F","scale":"B73376D4-81B6-46EA-B316-B067ACE635DB","intensity":"CC4424DA-38B7-4C9D-BBB8-847902C0DAE5","factor":"2AA17009-3F27-4B06-9200-6610B51BAFCC","alpha":"25B8FDCF-5D2D-4FAC-A5E5-82F0DFF85D33","mode":"D9DACDAE-1FD6-4E8D-8481-C5E18EDDDEAB","calpha":"g0C09C2CCFFA548989752E63F199223AA_calpha","nodeType":"Fresnel"},{"uuid":"895B6E51-0450-4BF9-AD76-909F43003A44","type":"f","src":"g0C09C2CCFFA548989752E63F199223AA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D96F9E4C-4F5C-4FE5-AD89-C05EB8B3DB67","type":"f","value":1,"nodeType":"Float"},{"uuid":"94E5C0B1-E0CA-49E7-9CB3-8E98A54CF62D","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"43F29994-B11C-4DE1-9DCC-D01B9C815334","nodeType":"Color"},{"uuid":"43F29994-B11C-4DE1-9DCC-D01B9C815334","type":"f","value":1,"nodeType":"Float"},{"uuid":"AF3D87F7-4D0F-4664-8D5E-07F470F278A8","type":"f","value":1,"nodeType":"Float"},{"uuid":"4878DB78-CE41-4E37-B9B0-1D3D38975C00","type":"i","value":0,"nodeType":"Int"},{"uuid":"BAD336E0-CF7D-4D07-823D-0B26DCF936CF","type":"f","value":1,"nodeType":"Float"},{"uuid":"7B5A6FD7-1129-4C90-9C57-538977C937A2","type":"i","value":0,"nodeType":"Int"},{"uuid":"53528A02-B7FD-417B-8BC2-153CC1632EA6","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"86D19C59-B577-4525-AE2E-E32BC1ADE5EF","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"8BC4EB81-212B-4FFF-8F9C-1B796EF089B1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DDBF5626-0835-4113-99FA-C178B39122B1","type":"f","value":1,"nodeType":"Float"},{"uuid":"3360E3D3-B99D-47BF-89A2-B9480D57AD71","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"394D59A4-FB97-4F2B-9FEB-6A601BA9ACC5","type":"f","value":1,"nodeType":"Float"},{"uuid":"7D07371B-EA8C-48AB-A972-FA84A41F1BFD","type":"f","value":1,"nodeType":"Float"},{"uuid":"2E2502EE-083A-4317-9D59-4956812AD701","type":"i","value":0,"nodeType":"Int"},{"uuid":"A1EFA83C-7C45-4B55-A889-D19DF8D84AB4","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"65854D9B-5904-4103-A93F-744C032B88CD","nodeType":"Color"},{"uuid":"65854D9B-5904-4103-A93F-744C032B88CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD0CD5EE-95AB-4EE8-857F-4DE46BA570BA","type":"f","value":1,"nodeType":"Float"},{"uuid":"812B359F-F90A-4E58-ABFF-C032A222D93B","type":"i","value":0,"nodeType":"Int"},{"uuid":"AF10FE5E-56CB-4FCE-99E7-2C7E8B9F7913","type":"f","value":1,"nodeType":"Float"},{"uuid":"A93D5AB8-D7D5-4040-AB1D-374DF619DAF6","type":"i","value":0,"nodeType":"Int"},{"uuid":"07514D38-40F7-416E-8F67-95BEFF004750","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"91C94426-59ED-47DB-9EFC-8BF272678890","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"3330E67B-5126-4CC2-8235-2878AA08AAEF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"043AEA95-E668-4809-93DE-B1B6DBE71252","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8E9AF08-12A5-4FD3-B878-1BC722A1A585","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"633ABA70-8727-4E36-B50B-4FFD181800C7","type":"f","value":1,"nodeType":"Float"},{"uuid":"82F790FB-F9BC-4E40-B196-A0E2C5671140","type":"f","value":1,"nodeType":"Float"},{"uuid":"C45F9C40-51C5-4BA9-97D1-B62216556400","type":"i","value":0,"nodeType":"Int"},{"uuid":"6C5E01C7-65FE-4D5F-9B7D-767E29BFE8B4","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"7AE277F7-9781-4988-ABC6-2269890BE425","nodeType":"Color"},{"uuid":"7AE277F7-9781-4988-ABC6-2269890BE425","type":"f","value":1,"nodeType":"Float"},{"uuid":"E4E5B3E0-B9C5-427E-B043-8246182543B4","type":"i","value":0,"nodeType":"Int"},{"uuid":"2365340E-56D3-474F-A56B-42B3837CFEBE","type":"f","value":1,"nodeType":"Float"},{"uuid":"2ABD2098-0A6A-4E23-A3AA-A989A6E95079","type":"i","value":0,"nodeType":"Int"},{"uuid":"418967D2-68FB-4036-ABAC-95B23914EA98","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"15A1A2A0-4EB8-4D1F-A642-51EC622D6642","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"F264DCD7-91A3-435D-B40C-8790E116D2BC","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6BEBBE99-35CC-413F-895A-D2C2C737E31E","type":"f","value":1,"nodeType":"Float"},{"uuid":"ABD0048A-A7F5-4D47-B8DB-4C11149A265C","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"DAB00720-919F-43B4-A389-7225F8A200ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"5FED5C78-ED0C-48E3-AC15-EB0D26C4BDFD","type":"f","value":1,"nodeType":"Float"},{"uuid":"C2450611-2316-45FE-A481-DB3DFFC53BC3","type":"i","value":0,"nodeType":"Int"},{"uuid":"3A336D88-17D4-41B0-9BFA-CA3591BB464D","type":"lambert","color":"6C5E01C7-65FE-4D5F-9B7D-767E29BFE8B4","emissiveIntensity":"ABD0A8C3-CD86-4678-AFFA-61A39A39D016","shadingAlpha":"2365340E-56D3-474F-A56B-42B3837CFEBE","shadingBlend":"2ABD2098-0A6A-4E23-A3AA-A989A6E95079","afterColor":"C256DDE8-53A4-4EC5-AA16-4518539BAE77","alpha":"18194750-C8BA-40BA-AC81-D11C63F61394","emissive":"418967D2-68FB-4036-ABAC-95B23914EA98","nodeType":"Lambert"},{"uuid":"ABD0A8C3-CD86-4678-AFFA-61A39A39D016","type":"f","value":1,"nodeType":"Float"},{"uuid":"C256DDE8-53A4-4EC5-AA16-4518539BAE77","type":"v3","a":"E20DD79C-8751-4616-87B8-1C8E3F2F2807","b":"91ECC7B7-5939-4AD9-93AC-B36798096472","alpha":"513CCB3C-1481-4693-B76C-A83D74F05994","mode":"C2450611-2316-45FE-A481-DB3DFFC53BC3","nodeType":"Blend"},{"uuid":"E20DD79C-8751-4616-87B8-1C8E3F2F2807","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"91ECC7B7-5939-4AD9-93AC-B36798096472","type":"v3","color":"15A1A2A0-4EB8-4D1F-A642-51EC622D6642","bias":"F264DCD7-91A3-435D-B40C-8790E116D2BC","scale":"6BEBBE99-35CC-413F-895A-D2C2C737E31E","intensity":"ABD0048A-A7F5-4D47-B8DB-4C11149A265C","factor":"DAB00720-919F-43B4-A389-7225F8A200ED","alpha":"5FED5C78-ED0C-48E3-AC15-EB0D26C4BDFD","mode":"C2450611-2316-45FE-A481-DB3DFFC53BC3","calpha":"g91ECC7B759394AD993ACB36798096472_calpha","nodeType":"Fresnel"},{"uuid":"513CCB3C-1481-4693-B76C-A83D74F05994","type":"f","src":"g91ECC7B759394AD993ACB36798096472_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"18194750-C8BA-40BA-AC81-D11C63F61394","type":"f","value":1,"nodeType":"Float"},{"uuid":"D0B2F5E3-E495-4E6B-BA7B-56156FC42349","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"4ABBF2F9-7013-4A08-9A0B-4DE2BE68228A","nodeType":"Color"},{"uuid":"4ABBF2F9-7013-4A08-9A0B-4DE2BE68228A","type":"f","value":1,"nodeType":"Float"},{"uuid":"5AFBD2C5-7984-4072-AA01-AF421B817ABE","type":"f","value":1,"nodeType":"Float"},{"uuid":"E7FBD508-4E2F-4911-8961-AEBC7A19DC10","type":"i","value":0,"nodeType":"Int"},{"uuid":"E91635D9-4AE4-40EC-9D45-109A02F88C77","type":"f","value":1,"nodeType":"Float"},{"uuid":"54F80CC7-321F-4629-88BD-A46A4A029A66","type":"i","value":0,"nodeType":"Int"},{"uuid":"A244455D-C5CB-4DD8-BD3A-4BBB9F93FDB3","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"749109B2-C55F-41E2-BA91-5BADED81ADB8","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"C6C528F6-65D9-4DFD-BF5A-D02BC89449B2","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"13153B10-77A0-4C99-B7A0-5C929997F7C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"E75EA820-D035-4D0E-9702-34257CC9EF95","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"D3F76359-6FD6-41F4-81BC-D6ACA8C8250C","type":"f","value":1,"nodeType":"Float"},{"uuid":"77EC089B-452F-4135-9729-EE4223451EE5","type":"f","value":1,"nodeType":"Float"},{"uuid":"797D091B-B946-4BA2-820A-30B83692BA01","type":"i","value":0,"nodeType":"Int"},{"uuid":"8B3410B6-96AF-4DC3-B3C6-F80F4C7FB46A","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"82D27524-ECB0-4438-94D3-49F6242F3B5C","nodeType":"Color"},{"uuid":"82D27524-ECB0-4438-94D3-49F6242F3B5C","type":"f","value":1,"nodeType":"Float"},{"uuid":"01AFC22A-9117-44BF-9D94-7EFFAA0A8864","type":"f","value":1,"nodeType":"Float"},{"uuid":"A27D744A-5695-4D85-93EC-F385EB6574F6","type":"i","value":0,"nodeType":"Int"},{"uuid":"2562AA60-39A1-4F0A-AEEA-B73D4349DF95","type":"f","value":1,"nodeType":"Float"},{"uuid":"CAE5E74D-3A17-4245-8041-85A81258C1E4","type":"i","value":0,"nodeType":"Int"},{"uuid":"4049FCEC-448F-45AA-9232-876FB559861F","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"BF313590-96CF-4F44-8C61-67721328443F","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"14325E47-F466-4502-9616-6C2EECC19EDA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3E6F976B-5EAD-481E-B41A-3D4FB3A9CA88","type":"f","value":1,"nodeType":"Float"},{"uuid":"3C965CD9-79E9-41EC-AB8A-57204CA7EB6A","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"F8F93BB6-5220-41F5-9EB9-77AC0E920C5E","type":"f","value":1,"nodeType":"Float"},{"uuid":"EC98D484-1C32-46D4-A8E6-2464C0A845D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"A28AF9E5-45D2-4717-BAC0-5BEFFC0F1506","type":"i","value":0,"nodeType":"Int"},{"uuid":"595B9B07-9796-4C50-B4DB-B08DF25E50A4","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"7AFD7B94-D4FB-40DA-812B-C7EF62E60F04","nodeType":"Color"},{"uuid":"7AFD7B94-D4FB-40DA-812B-C7EF62E60F04","type":"f","value":1,"nodeType":"Float"},{"uuid":"1F2F47EB-C890-45C5-BC46-94704BD20A93","type":"i","value":0,"nodeType":"Int"},{"uuid":"660EE04F-86D5-4F76-A269-C8C8CF0C8DD6","type":"f","value":1,"nodeType":"Float"},{"uuid":"C083A7FE-ADA3-44FF-B5C7-8BFAF9AB8FF8","type":"i","value":0,"nodeType":"Int"},{"uuid":"466797B3-8618-4EC7-9656-ED7FB9C3F764","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"0DACC81D-8728-473D-BA83-5BBD39DDF61C","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"D7C094CD-260D-4A42-9377-7046F61782FF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3384F8A3-384F-48C0-B656-9158ACBACCCE","type":"f","value":1,"nodeType":"Float"},{"uuid":"5AC2CDBB-4066-4355-9F68-9CDEEC23747D","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"AED459F4-DDD5-4566-A48F-46409D6F45E9","type":"f","value":1,"nodeType":"Float"},{"uuid":"29D8FEBD-EBFD-45A2-820B-84BEE4DEB36E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6685B8B-A33B-4B37-8AD1-895981D6742F","type":"i","value":0,"nodeType":"Int"},{"uuid":"B7A36CB8-8E44-4F03-A66F-B748334AFF52","type":"lambert","color":"595B9B07-9796-4C50-B4DB-B08DF25E50A4","emissiveIntensity":"58CB90D1-9E8C-4B50-8511-C163AF3977EB","shadingAlpha":"660EE04F-86D5-4F76-A269-C8C8CF0C8DD6","shadingBlend":"C083A7FE-ADA3-44FF-B5C7-8BFAF9AB8FF8","afterColor":"A997CCAF-A696-44AD-97ED-6289D5E71ACF","alpha":"634BB071-74AA-409B-A9CB-8C7E674D9256","emissive":"466797B3-8618-4EC7-9656-ED7FB9C3F764","nodeType":"Lambert"},{"uuid":"58CB90D1-9E8C-4B50-8511-C163AF3977EB","type":"f","value":1,"nodeType":"Float"},{"uuid":"A997CCAF-A696-44AD-97ED-6289D5E71ACF","type":"v3","a":"17BC23F7-4037-492F-AB37-C72BA9642751","b":"ECBEC300-05EC-412D-BAE0-CD300B742F18","alpha":"836DE9EA-ECE3-4B04-ADF5-B318EE67C9EB","mode":"B6685B8B-A33B-4B37-8AD1-895981D6742F","nodeType":"Blend"},{"uuid":"17BC23F7-4037-492F-AB37-C72BA9642751","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"ECBEC300-05EC-412D-BAE0-CD300B742F18","type":"v3","color":"0DACC81D-8728-473D-BA83-5BBD39DDF61C","bias":"D7C094CD-260D-4A42-9377-7046F61782FF","scale":"3384F8A3-384F-48C0-B656-9158ACBACCCE","intensity":"5AC2CDBB-4066-4355-9F68-9CDEEC23747D","factor":"AED459F4-DDD5-4566-A48F-46409D6F45E9","alpha":"29D8FEBD-EBFD-45A2-820B-84BEE4DEB36E","mode":"B6685B8B-A33B-4B37-8AD1-895981D6742F","calpha":"gECBEC30005EC412DBAE0CD300B742F18_calpha","nodeType":"Fresnel"},{"uuid":"836DE9EA-ECE3-4B04-ADF5-B318EE67C9EB","type":"f","src":"gECBEC30005EC412DBAE0CD300B742F18_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"634BB071-74AA-409B-A9CB-8C7E674D9256","type":"f","value":1,"nodeType":"Float"},{"uuid":"2856E60D-4936-497A-9E3D-90F845B5AF20","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"4098E8F8-6AD7-4B6D-A9AB-380115FFB7E6","nodeType":"Color"},{"uuid":"4098E8F8-6AD7-4B6D-A9AB-380115FFB7E6","type":"f","value":1,"nodeType":"Float"},{"uuid":"26F32C74-15A2-4098-8C4E-BFCA9261709B","type":"f","value":1,"nodeType":"Float"},{"uuid":"3C4177CF-8F27-4A9C-9D65-CCBD94F139EB","type":"i","value":0,"nodeType":"Int"},{"uuid":"E40A8924-1E83-4940-A391-A1D5D9A23FF8","type":"f","value":1,"nodeType":"Float"},{"uuid":"7F93BFED-58ED-4AB9-97DE-957F50BCE6EE","type":"i","value":0,"nodeType":"Int"},{"uuid":"DBBA1DFF-D916-437D-8642-69A19945F210","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"7E02F78E-4EFB-4239-972A-819B5F0A048D","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"1231499F-4357-42B3-9F47-04C3280D2DE4","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"257CF335-764D-456A-93BE-AC56C7934CD8","type":"f","value":1,"nodeType":"Float"},{"uuid":"FF411C71-BEBB-4176-BBF2-FC3905D4E34D","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"3E4E246B-39B8-4A3A-B90B-03CC8406AEB4","type":"f","value":1,"nodeType":"Float"},{"uuid":"27DBE8EC-EBA3-4AAE-BE5C-8D3DC7F34A70","type":"f","value":1,"nodeType":"Float"},{"uuid":"62265F7C-9371-47C6-B859-8F463576CC9B","type":"i","value":0,"nodeType":"Int"},{"uuid":"E2D79CCF-39C0-44B9-97BB-19FA8C1EE005","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"5ED07FD0-441A-42F7-88C0-65430E3CE7B3","nodeType":"Color"},{"uuid":"5ED07FD0-441A-42F7-88C0-65430E3CE7B3","type":"f","value":1,"nodeType":"Float"},{"uuid":"78EC31CC-D4AD-4195-A7E0-396A7DDAD9C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"5EA7C405-95C0-4C8F-82D2-EDEB31EEC57C","type":"i","value":0,"nodeType":"Int"},{"uuid":"9E6A83D8-B586-47FF-B135-BFDEF8F6FA5D","type":"f","value":1,"nodeType":"Float"},{"uuid":"C16C29E2-93E9-4275-933C-D29D2551C57A","type":"i","value":0,"nodeType":"Int"},{"uuid":"991F8E2B-A550-4403-BE2A-BE57F1C4CE2C","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"30010FE3-5042-4AE7-9B7B-ACAA87E11989","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"4CF8AA05-E8EA-48F8-9AEB-CB3041236368","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"0C64F55E-0C72-4130-9C20-4640A3059EA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"F355701B-5E81-4F16-B9B5-AE905E516A29","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"C79080DD-8E52-47B3-B958-E453805DA120","type":"f","value":1,"nodeType":"Float"},{"uuid":"9E09C3BC-7F29-465C-8905-0824017B04F9","type":"f","value":1,"nodeType":"Float"},{"uuid":"432D1C7F-F193-427E-B784-035AF2C73ADD","type":"i","value":0,"nodeType":"Int"},{"uuid":"92A7AEA8-8486-4A72-B47D-F440EE9E7B45","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"CD9C5663-7DC8-4718-9DE3-2CD5E872F6B9","nodeType":"Color"},{"uuid":"CD9C5663-7DC8-4718-9DE3-2CD5E872F6B9","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F92420E-EAAE-4100-9751-E7C28C831A04","type":"i","value":0,"nodeType":"Int"},{"uuid":"092A3606-C9C9-4B40-BFDC-7F666067BC96","type":"f","value":1,"nodeType":"Float"},{"uuid":"9AEB863D-6BD7-431E-9226-6D0AB24332CD","type":"i","value":0,"nodeType":"Int"},{"uuid":"A74E273F-BC73-4927-ADBD-78CF81932829","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"D0A9740E-ECE0-4262-B962-0FD94B659E1E","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"A3FEBD95-47D7-4928-9BCA-45D3F477F201","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5C2C64FC-3118-49E5-B0AA-29218D909282","type":"f","value":1,"nodeType":"Float"},{"uuid":"69EB7C17-4DE9-4733-89B4-8300BF7BE9D3","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"099044D6-54B8-4F2F-90AA-8491A45C8CEC","type":"f","value":1,"nodeType":"Float"},{"uuid":"8ADE9838-257E-4FC6-8E59-26793DD70D21","type":"f","value":1,"nodeType":"Float"},{"uuid":"207AAD48-C1B6-4409-844C-F363BA1CFD37","type":"i","value":0,"nodeType":"Int"},{"uuid":"3B944289-8AE5-4782-BE2B-0E9458FA6B3A","type":"lambert","color":"92A7AEA8-8486-4A72-B47D-F440EE9E7B45","emissiveIntensity":"5C56BBC5-7401-4C6D-B758-97938601233D","shadingAlpha":"092A3606-C9C9-4B40-BFDC-7F666067BC96","shadingBlend":"9AEB863D-6BD7-431E-9226-6D0AB24332CD","afterColor":"DBC831AA-55A5-4E60-B434-AFD044675412","alpha":"4FF398A1-1AD6-4F31-815A-43903E3D263E","emissive":"A74E273F-BC73-4927-ADBD-78CF81932829","nodeType":"Lambert"},{"uuid":"5C56BBC5-7401-4C6D-B758-97938601233D","type":"f","value":1,"nodeType":"Float"},{"uuid":"DBC831AA-55A5-4E60-B434-AFD044675412","type":"v3","a":"A36E8D76-25CF-4914-8E67-6FA5A0336261","b":"5417FFFE-1927-4845-A733-8508CDBAE32B","alpha":"1E3DCDAC-40D5-4527-9901-B6469AD3B8AC","mode":"207AAD48-C1B6-4409-844C-F363BA1CFD37","nodeType":"Blend"},{"uuid":"A36E8D76-25CF-4914-8E67-6FA5A0336261","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5417FFFE-1927-4845-A733-8508CDBAE32B","type":"v3","color":"D0A9740E-ECE0-4262-B962-0FD94B659E1E","bias":"A3FEBD95-47D7-4928-9BCA-45D3F477F201","scale":"5C2C64FC-3118-49E5-B0AA-29218D909282","intensity":"69EB7C17-4DE9-4733-89B4-8300BF7BE9D3","factor":"099044D6-54B8-4F2F-90AA-8491A45C8CEC","alpha":"8ADE9838-257E-4FC6-8E59-26793DD70D21","mode":"207AAD48-C1B6-4409-844C-F363BA1CFD37","calpha":"g5417FFFE19274845A7338508CDBAE32B_calpha","nodeType":"Fresnel"},{"uuid":"1E3DCDAC-40D5-4527-9901-B6469AD3B8AC","type":"f","src":"g5417FFFE19274845A7338508CDBAE32B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4FF398A1-1AD6-4F31-815A-43903E3D263E","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1456,1210],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/icon_dark/index.html b/site/spline/design/icon_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/icon_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/icon_dark/runtime.js b/site/spline/design/icon_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/icon_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=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[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlv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i45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/icon_dark/scene.json b/site/spline/design/icon_dark/scene.json deleted file mode 100644 index 7a8993ccc..000000000 --- a/site/spline/design/icon_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"D41E2A23-2EB8-49EC-9A12-BE822BE48E78","objectType":"Mesh3D","name":"Cube copy 12","matrix":[0.9063317966392347,-0.00001354807954235401,-0.4225667689456309,0,-0.10935720975744877,0.9659253552104146,-0.2345830531724103,0,0.4081711345437908,0.25882080283098335,0.8754473810270726,0,141.02183525332993,-296.6187429733143,-721.0597147499648,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"interaction":{"uuid":"56D10C51-5733-4D82-9947-BB1F86426ADE","selectedState":0,"states":["AE06BDD2-E0CF-426B-BE04-B4868334EBAC","8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D41E2A23-2EB8-49EC-9A12-BE822BE48E78","state":"8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6"}]}]},"geometry":"FE756607-4E63-4AE8-A1BF-B31F89294A33","material":"40E7FE5A-3B26-42E0-90E8-A3F2337FB388"},{"uuid":"6AEA82BA-1415-4E85-B12A-D8274F42C085","objectType":"EmptyObject","name":"Empty Object copy","matrix":[0.9622501868990567,-0.017453591614906838,0.27160624063608585,0,0.08418598282936908,0.968088514620299,-0.2360452248093846,0,-0.25881904510252063,0.24999999999999986,0.9330127018922185,0,168.69965599500395,135.95632075884583,-197.92637657361064,1],"layers":1,"children":[{"uuid":"21A87820-888A-4715-A26F-AEE4D5F9471B","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,296.990014827501,56.150706714317494,26.606201283083465,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-297.9010727611103,0,-21.303100641541732,1],"interaction":{"uuid":"0A8413FA-FCE6-419F-9FE6-190A401AA2B5"},"geometry":"7EEB59BA-7971-48C2-B2D6-DB41E40B4071","material":"35666EF9-819A-4361-82B9-FE79904774D0"},{"uuid":"C5E630E5-0E6E-4447-945B-BE68CE484048","objectType":"Mesh2D","name":"Rectangle copy","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,297.9010727611103,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-297.9010727611103,0,-21.303100641541732,1],"interaction":{"uuid":"156FDCAB-3692-4AF8-9793-DF9FE1DBDF96"},"geometry":"44CEDE4D-089D-4BC0-982F-49613B56CEBF","material":"4CA45ED0-6F00-4839-BB28-9BF718F4D5C2"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1],"interaction":{"uuid":"40836C02-ACB2-48D1-AD56-1F849A787D18","selectedState":0,"states":["208984AD-68A2-4B5F-984F-D25E0AC0E004","62180D6B-6FBA-4458-8CE6-715559EF9BA1"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6AEA82BA-1415-4E85-B12A-D8274F42C085","state":"62180D6B-6FBA-4458-8CE6-715559EF9BA1"}]}]},"enableHelper":true},{"uuid":"68C97D46-8DDA-4395-9B92-2A9DAED535DF","objectType":"EmptyObject","name":"Empty Object 2","matrix":[0.7251800530091804,3.486235457115772e-17,0.4186828988157972,0,0.17694303891808935,0.7589111429916692,-0.30647433345176817,0,-0.37945557149583503,0.3538860778361794,0.6572363290458711,0,114.72632135694906,-20.522380316571702,-156.39426960988678,1],"layers":1,"children":[{"uuid":"924DAB5F-0F69-4C48-88C4-8313CACC363E","objectType":"Mesh3D","name":"Cylinder","matrix":[1,4.163336342344336e-17,-2.7755575615628907e-17,0,2.775557561562892e-17,2.2204460492503146e-16,1.0000000000000007,0,4.163336342344338e-17,-1.0000000000000004,2.220446049250314e-16,0,-1.4210854715202004e-14,-2.2302414469596096e-14,35.52916395788273,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,1.3877787807814457e-17,0,0,-1.3877787807814457e-17,1,-2.7755575615628914e-17,0,0,2.7755575615628914e-17,1,0,1.4210854715202004e-14,0,-21.76458197894137,0.9999999999999999],"interaction":{"uuid":"59659180-4A77-4131-995A-DA43CD0F6F94"},"geometry":"377A15C6-6F1F-45E7-9E5B-0FAE5DF66567","material":"3AC8809D-07DC-4605-88E4-8ABC72598500"},{"uuid":"7B7CE997-97F8-40F5-A297-BDF3CD754BE1","objectType":"Mesh2D","name":"Rectangle","matrix":[1,-1.3877787807814457e-17,-2.7755575615628914e-17,0,1.387778780781446e-17,1.0000000000000002,1.387778780781447e-17,0,2.7755575615628914e-17,-1.3877787807814466e-17,1,0,-1.5987211554602254e-14,-1.0658141036401503e-14,1.0658141036401503e-14,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,1.3877787807814457e-17,0,0,-1.3877787807814457e-17,1,-2.7755575615628914e-17,0,0,2.7755575615628914e-17,1,0,1.4210854715202004e-14,0,-21.76458197894137,0.9999999999999999],"interaction":{"uuid":"10954B9A-6956-4C4F-BAFE-FCA8F2D2A39E"},"geometry":"A9320118-92ED-4E18-B14B-BCB9B3FE2AFB","material":"12D46C4B-14EC-4E2C-A9B2-E633115F3097"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"6AAF9AF7-57F1-4165-993C-128A4B35554A","selectedState":0,"states":["4596904D-B29F-4CBD-A90A-4F84B0F2FB61","61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"68C97D46-8DDA-4395-9B92-2A9DAED535DF","state":"61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA"}]}]},"enableHelper":true},{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.9322951073772445,-6.938893903907228e-18,-0.36169853851025185,0,-0.10178047655012812,0.9595917683126233,-0.2623439970342023,0,0.34708294016514385,0.2813958745018353,0.8946227106773366,0,444.38606073462046,243.0966737275686,868.4452950553914,1],"visible":false,"layers":9,"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000022,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[0.9063077870366525,1.5265566588595947e-16,0.4226182617407008,0,0.21130913087035008,0.8660254037844399,-0.45315389351832575,0,-0.3659981507706667,0.49999999999999983,0.7848855672213952,0,145.26433001757783,109.51028322658746,-44.57193952147844,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["C0E7FD0E-F8A5-43AC-9256-DFEB7453BAFD","5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"345A9D1D-E69F-4421-B3C8-896550CA126C"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[0.6427876096865397,-5.551115123125793e-17,0.76604444311898,0,0.26200263022938497,0.9396926207859075,-0.21984631039295366,0,-0.7198463103929549,0.3420201433256688,0.6040227735550531,0,166.4449569745533,-136.32101579128442,-292.4943118617949,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["D86D5F0D-7A6B-497D-92CB-19F9F7B50F78","B805F286-540C-4923-9DB9-306A8561C88A"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"B805F286-540C-4923-9DB9-306A8561C88A"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"273934A2-4C83-4C6D-8972-0FAA2A21BB52"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.039613253960852e-17,0,0,6.039613253960852e-17,1,0,-575.5886480647118,13.90611789504065,1000,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"B67A428C-3219-40AA-8E97-5EC1EDBAC51D","objectType":"EmptyObject","name":"Empty Object","matrix":[0.9063077870366492,-8.326672684688669e-17,-0.4226182617406998,0,-0.1093816549466151,0.9659258262890683,-0.23456971600980445,0,0.4082178936767352,0.2588190451025206,0.8754260980655924,0,-138.165696925378,-13.632103442965462,-157.28079644362225,1],"layers":1,"children":[{"uuid":"3BFFF4B1-9751-469B-AABD-5C4759CB1070","objectType":"Mesh2D","name":"Triangle","matrix":[2.2204460492503195e-16,-1.0000000000000029,0,0,1.0000000000000029,2.2204460492503195e-16,0,0,0,0,1,0,-219.44300360880783,-2.6151466922991817,24.19639750570466,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,225,0,-20.50066360952973,1],"interaction":{"uuid":"E268C046-B449-47EC-A120-B0BBBFB11588"},"geometry":"63190C12-0343-4771-9324-412A23B4BE49","material":"2F6B7FAC-E0BB-4FB3-B555-28E46A78D262"},{"uuid":"6E67B843-2E8D-467D-A268-474FDD00D55C","objectType":"Mesh2D","name":"Rectangle copy 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-225,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,225,0,-20.50066360952973,1],"interaction":{"uuid":"0CD8CF15-EFD4-4731-BCD2-5F1AC9C6684E"},"geometry":"84922242-9D7F-4E40-AC3E-6F54D1BF27FD","material":"D3B36C2F-CC9E-4D3B-BD20-682BBF238DCF"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"8B488D9A-5FEA-46B7-84F8-932FDFBF4E77","selectedState":0,"states":["AA54E20C-9CAC-49D4-8129-6C593B730710","87BFAD8A-9C35-4E54-B093-594677A83229"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"B67A428C-3219-40AA-8E97-5EC1EDBAC51D","state":"87BFAD8A-9C35-4E54-B093-594677A83229"}]}]},"enableHelper":true}],"activeCamera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"FE756607-4E63-4AE8-A1BF-B31F89294A33","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":50,"depth":20},"type":"CubeGeometry"}},{"uuid":"7EEB59BA-7971-48C2-B2D6-DB41E40B4071","userData":{"parameters":{"width":61,"subdivisions":40,"roundness":0,"extrudeDepth":16,"surfaceMaxCount":1855,"extrudeBevelSize":8,"extrudeBevelSegments":3,"height":61,"depth":16},"shape":{"points":[-0.4876749791154644,-5.6019483429302115,-0.4876749791154644,-5.6019483429302115,-0.4876749791154644,-5.6019483429302115,10,-56.59892340558349,-60.25892340558359,-56.59892340558349,-60.25892340558359,-56.59892340558349,-60.25892340558359,200,-32.964911396250386,-60.25892340558359,-32.964911396250386,-60.25892340558359,-32.964911396250386,-60.25892340558359,0,-32.964911396250386,-100.29308038110426,-32.964911396250386,-100.29308038110426,-32.964911396250386,-100.29308038110426,10,32.94000000000002,-100.29308038110426,32.94000000000002,-100.29308038110426,32.94000000000002,-100.29308038110426,10,32.94000000000002,-60.25892340558359,32.94000000000002,-60.25892340558359,32.94000000000002,-60.25892340558359,0,57.95000000000012,-60.25892340558359,57.95000000000012,-60.25892340558359,57.95000000000012,-60.25892340558359,200],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"44CEDE4D-089D-4BC0-982F-49613B56CEBF","userData":{"shape":{"points":[-85,85,-85,85,-85,85,50,85,85,85,85,85,85,50,85,-85,85,-85,85,-85,50,-85,-85,-85,-85,-85,-85,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":170,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":170},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}},{"uuid":"377A15C6-6F1F-45E7-9E5B-0FAE5DF66567","userData":{"parameters":{"width":110,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":8,"cornerSegments":8,"hollow":0.58,"height":16,"depth":110,"radiusTop":55,"radiusBottom":55},"type":"CylinderGeometry"}},{"uuid":"A9320118-92ED-4E18-B14B-BCB9B3FE2AFB","userData":{"shape":{"points":[-90,90,-90,90,-90,90,50,90,90,90,90,90,90,50,90,-90,90,-90,90,-90,50,-90,-90,-90,-90,-90,-90,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":180,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":180},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}},{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":50,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"63190C12-0343-4771-9324-412A23B4BE49","userData":{"shape":{"points":[0,32.5,0,32.5,0,32.5,12,38.5,-32.5,38.5,-32.5,38.5,-32.5,12,-38.5,-32.5,-38.5,-32.5,-38.5,-32.5,12],"shapeHoles":[],"isClosed":true,"roundness":12},"parameters":{"width":77,"depth":16,"spikes":5,"cornerRadius":12,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":5,"isRect":false,"surfaceMaxCount":1000,"height":65},"type":"TriangleGeometry"}},{"uuid":"84922242-9D7F-4E40-AC3E-6F54D1BF27FD","userData":{"shape":{"points":[-75,75,-75,75,-75,75,50,75,75,75,75,75,75,50,75,-75,75,-75,75,-75,50,-75,-75,-75,-75,-75,-75,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":150,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":150},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}}],"materials":[{"uuid":"40E7FE5A-3B26-42E0-90E8-A3F2337FB388","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C7B2F91D-7FED-478C-959C-449A10D9819E","f1_mode":"9184024C-B5B0-4E89-9537-600F47F2E5A2","f1_shininess":"5CAF24EF-9689-4241-BD52-E9903F19E671","f1_specular":"D958C88D-CB96-4E9A-9C6B-65992544B911"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"D181C661-09CB-4AF5-99A9-4A38ABBDF718","f2_ior":"2309B2B2-3674-4AB1-A390-5C7267F464F7","f2_roughness":"356F961F-3952-43F5-A112-19DBE950745A","f2_transmissionSamplerSize":"501F0F29-ED8C-4205-9D03-0E82FC2B6D79","f2_transmissionSamplerMap":"B012D4A3-4638-49F9-99A8-73368280AF8E","f2_transmissionDepthMap":"0F7F000D-23F9-41D7-B335-FF2316DA13FF","f2_aspectRatio":"89184C21-AC8C-40F0-887E-5D95F2597D9C","f2_alpha":"632CB303-39CA-43EF-B83C-D1B0BA894482","f2_mode":"0D51CF3B-3D47-40D0-A89C-3BDF5A842122"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"41BFA695-8447-4A9D-8403-1BEAE65A6A04","f4_far":"A7F9BA3D-AE7B-40EE-9E0E-F19C6FD51AC5","f4_isVector":"961CD512-9975-471B-B2CB-30B04858218F","f4_isWorldSpace":"26D6692C-CC7C-40C5-BCB5-DA372EEC2FE5","f4_origin":"EE0E66A5-4C92-4066-A3DF-5D1229534AE0","f4_colorA":"F6974809-65B3-405A-B4B2-1109BB74E60E","f4_colorB":"D3159DED-E504-4490-82D3-8B9C2F5C4F1B","f4_alpha":"BA5466DA-C13A-4FA0-8F61-58F2252925C1","f4_mode":"1273EABA-E66F-4888-87DD-5EB6EFCAF946"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E4C2A185-4F58-48C6-9E70-1E6CD8BFA546","f3_bias":"6A16FC1F-878F-479A-A5F3-60169E31D143","f3_scale":"4B31F9F3-2C52-40A6-A96F-3DE0D21532AF","f3_intensity":"BEB75B90-0B15-4BB9-9593-2CC24A72045E","f3_factor":"DCAA89F2-9FCC-4AE3-9010-527951BE2BB3","f3_alpha":"C7098429-AA24-44CF-A0D9-C656C1645AF8","f3_mode":"3D408CB1-B0B9-4D91-BAA7-649D465D47AF"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"16470AB3-EFDA-46A2-9C0B-C6FF32B16DC4","fragment":"16470AB3-EFDA-46A2-9C0B-C6FF32B16DC4"},{"uuid":"35666EF9-819A-4361-82B9-FE79904774D0","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"66443CC6-3EBB-42E0-A7A7-94B2621FE0E3","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2A756239-6F9E-42CD-A215-8005305F6050","f1_mode":"0152E954-6FFF-4ABC-91DD-76215984C9B0","f1_shininess":"3252B908-C558-4EB9-BB96-1FAF15ACF31D","f1_specular":"DC2D985C-ED99-43B6-BBD8-F194FC5114DC"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"532EC462-FB11-4543-BBE4-707CFB792BC1","f2_ior":"8442DAFF-9DB1-4CF1-BD39-41F1C6F507E3","f2_roughness":"1243DF9B-B5BE-4322-99B2-9DF4B7276C0D","f2_transmissionSamplerSize":"A10BFA28-0AE8-4620-ABA9-49DEBE6EA0A1","f2_transmissionSamplerMap":"EB18570A-F5DB-4F51-8A26-DC5E190C0403","f2_transmissionDepthMap":"8B6B5F3C-DC0D-4B24-A168-68485CE527C2","f2_aspectRatio":"5929A6DB-B273-400A-8C89-6637D7FC2156","f2_alpha":"9B72542F-65ED-49CA-8FE5-8A0274999972","f2_mode":"28BACF00-9E60-474C-9A58-5D219B8F07A0"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"BCC3242C-2C3A-4D6A-A008-8856B3807565","f4_far":"7842F70F-7F82-4755-96A7-2BF18FBA41EC","f4_isVector":"E871B1E9-6DE6-4833-B0DE-78E210A70059","f4_isWorldSpace":"CC913C5D-2791-4D90-8FD0-348541C16CB4","f4_origin":"1A39FCBC-BACE-4755-A570-0BDAC757046C","f4_colorA":"910474FF-08F8-4097-9272-DA61CCA2AE90","f4_colorB":"5F45BE5E-BF15-4711-BB7D-18B103AEDAA2","f4_alpha":"151F2D99-1CEF-46B5-8DE1-40AA7CAF9BA1","f4_mode":"A8FAB85F-BEDE-4AA1-B912-36E23CD4215D"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4ED800BC-F994-4493-82E7-EBCEAEC3CF8A","f3_bias":"DF4B3FB4-45EB-419D-A865-879D6047DEB0","f3_scale":"6386941C-7CB4-4092-A76A-529DD2D99EE6","f3_intensity":"BC00FC25-A783-4110-A136-AB05B81B8BC9","f3_factor":"0B9D284A-44BB-4221-B383-07D235E52969","f3_alpha":"A9812F6E-5E08-4728-84B4-DE6494B66A06","f3_mode":"CDF5A285-1151-440B-A315-1F7F9A8BFEB9"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"553E99F1-F8DB-41D3-BC17-C1FC5D6F5F80","fragment":"553E99F1-F8DB-41D3-BC17-C1FC5D6F5F80"},{"uuid":"4CA45ED0-6F00-4839-BB28-9BF718F4D5C2","type":"ShaderMaterial","reflectivity":{"uuid":"D1BA5403-5C59-4109-A6AB-5D9961536520","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"9CE4A97C-F153-40B5-B21E-6C901620972E","f0_alpha":"AA436B6B-9AE2-4A08-A3B3-B09193B45ED3","f0_mode":"7D301AF5-EC4F-400C-A15C-FA89C1035965"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1A2AAEE5-F060-4C07-A78F-9F760BDFC3F7","f1_mode":"0CBAFA87-E7E7-4F84-8E7D-728490F21748","f1_roughness":"9F518D66-84AF-466F-8D81-D5AEF42F8F3B","f1_metalness":"C95D4170-3E95-4DD4-96A8-2FCF7EA5A7A4","f1_reflectivity":"D1BA5403-5C59-4109-A6AB-5D9961536520"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"2906BBFA-D5ED-47C2-9D1B-2BD6FEFF8BEB","fragment":"2906BBFA-D5ED-47C2-9D1B-2BD6FEFF8BEB"},{"uuid":"3AC8809D-07DC-4605-88E4-8ABC72598500","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F2AB0418-1210-4A29-B2F9-90887F9C4A9E","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"801F4FEA-C0CA-41B1-AD51-9FCD00BC267C","f1_mode":"D8298C5D-4883-4485-B02B-4A20D1CB9A4C","f1_shininess":"5CCADEBD-A17D-4B41-A00E-C3AC3509AD77","f1_specular":"4B8FA47E-8C03-4BCF-AD42-89E7C9E6594D"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"ED2F275C-9D6A-445F-9051-CACB25C3EE06","f2_ior":"CCC297AB-6A34-4F98-8F51-BE9429BCA618","f2_roughness":"9D86EFC2-86BD-4519-8B5A-229EF9A1C47B","f2_transmissionSamplerSize":"7BF34958-1356-4C2A-A6A3-68E12E8B635C","f2_transmissionSamplerMap":"B445BB67-DC48-4555-898B-28B7754AD4D9","f2_transmissionDepthMap":"5D42C6BE-A45C-407B-A52A-E6F682721ECC","f2_aspectRatio":"20A74181-C194-4ECF-AB06-257839C645AA","f2_alpha":"3D5FA44C-CC81-4D00-A46A-8D7E43EB7CDC","f2_mode":"CF320FA1-FC14-45F5-892A-32103300C9FF"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"6FB43F4F-3C15-4AF2-8F54-DDF5FBFCA27A","f4_far":"28D73D1B-5521-41CA-8714-2E92EB0BA7AE","f4_isVector":"243936AE-7E75-4CBF-9A4D-E8DC5BC4ED4D","f4_isWorldSpace":"57A811BD-6F90-4EC8-A78E-AF21DBC58E04","f4_origin":"131AD92C-DFBE-4947-9503-0CE0F84B505B","f4_colorA":"71BE4882-D1C9-4F31-9B75-A17DA1A4B81C","f4_colorB":"997DE9AD-1DA2-46BE-9D28-EB3CC8FF8666","f4_alpha":"23765059-3A9C-4BCE-A013-C207BF2ED396","f4_mode":"872BAD52-229D-4655-801B-0C87EF39022A"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"48022D5D-55AC-4E4C-B1F8-7449DFE7E8F5","f3_bias":"EEFA56CB-7FCF-43FE-9604-D95E5D8C3D8F","f3_scale":"D6BB813A-BA40-48E8-AFAC-E88ACF49FE8A","f3_intensity":"1454940A-094E-4D84-845E-538C1D7BD987","f3_factor":"68DCA73F-B202-43E1-AAB8-FB8B02D986EB","f3_alpha":"D0BE2F08-CF59-4B0B-9B9D-BFAD1B7BFA2B","f3_mode":"C7E6B9E5-2ED8-45D9-82C0-0C7DCDE77E42"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"730312A9-7B4A-4E2E-9479-312D4AA50CA6","fragment":"730312A9-7B4A-4E2E-9479-312D4AA50CA6"},{"uuid":"12D46C4B-14EC-4E2C-A9B2-E633115F3097","type":"ShaderMaterial","reflectivity":{"uuid":"0E9CA7ED-22DA-4BC0-A42E-345FEE70AEE8","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"C7875B40-FDC3-4744-9751-7CE84A1B2E09","f0_alpha":"843FD723-6CE2-441C-ABDB-12E93E9C75EA","f0_mode":"FE360A35-3DFC-4C3A-845D-1DED5DE37879"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D799B087-FEB4-495D-915A-9BB255F1B745","f1_mode":"C61C9594-320B-4248-B181-D944590510A1","f1_roughness":"0258A1EC-DF7B-4ED9-BEEF-25EA8F789974","f1_metalness":"6D88A5A9-665F-436E-A236-79D6074B3F3C","f1_reflectivity":"0E9CA7ED-22DA-4BC0-A42E-345FEE70AEE8"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"FB8D74F7-D45D-4E0F-94B8-B2B2AAF617E8","fragment":"FB8D74F7-D45D-4E0F-94B8-B2B2AAF617E8"},{"uuid":"345A9D1D-E69F-4421-B3C8-896550CA126C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B567DA9C-F981-453E-BBD1-CD3F42ABA4A0","f1_mode":"E10457EE-AE9A-4919-9AD0-399A4EB863A4","f1_shininess":"E48477BD-6849-4C3A-A72C-F9F380F57809","f1_specular":"2D66F1ED-CB0F-4201-B1DB-A655CDFED233"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"22AFD2F7-BE2B-4D1B-9B03-454124703F48","f2_ior":"B5A981D3-6F54-4DA3-8E49-87976C074B82","f2_roughness":"16F1B09E-881B-4FD8-A791-33B250B2F942","f2_transmissionSamplerSize":"C237AC5B-6976-4891-B448-7DB052C86E08","f2_transmissionSamplerMap":"C9A457DD-4CA0-45F3-87C9-3B8D06CAEE7D","f2_transmissionDepthMap":"5F61A991-59A5-4A69-92D5-BD71F5CA7562","f2_aspectRatio":"7255CC61-EBEC-43F1-9393-7719745F2C52","f2_alpha":"FF63B2B4-59E7-4C4B-8ACD-155A2BB57384","f2_mode":"A47E475B-1B2E-49ED-B00D-512E66EA58F0"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"36E57C84-6C36-4259-B2C6-41844F42B9F5","f4_far":"89FB03B5-7E97-4AFF-9FE7-1DDAA1803974","f4_isVector":"6CEF2A18-F449-4B96-94E4-1884E2979EE3","f4_isWorldSpace":"4487B2C6-A00F-4378-A6FB-AF6D190A3F19","f4_origin":"28CE1160-A55F-4EAA-9679-02412471D079","f4_colorA":"E064FE48-4D83-4397-B845-4B63CB8B4A11","f4_colorB":"F2314A8B-2B06-4C8C-8D96-FE2160A1841D","f4_alpha":"21BD2AAD-D6EF-445B-976C-269DB754C09A","f4_mode":"1E2ED708-C4DC-4EF0-B495-7742F869F74E"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"EFF4DF44-381E-4EC3-B3B8-D1DEE7C938E9","f3_bias":"E2E69446-F67A-41D4-A9EC-C7E7323AB92A","f3_scale":"348097D7-6398-45CF-ABC3-C4AED70A130A","f3_intensity":"4AB84981-F846-4EF7-A724-3D4599FAE7FF","f3_factor":"7E09CBC7-F95B-45DF-AD02-F46E81852770","f3_alpha":"6026E22E-E7C0-452D-A52C-965095B9C1B6","f3_mode":"55FC15CD-AF70-472C-A812-D2D5877049BA"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"C97B84A1-A0F5-4A52-9266-32DAF8511774","fragment":"C97B84A1-A0F5-4A52-9266-32DAF8511774"},{"uuid":"273934A2-4C83-4C6D-8972-0FAA2A21BB52","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E00AB7FA-54E0-40F3-A334-DF7BA15FBB59","f1_mode":"D09CE24A-DF83-43E3-AE6C-489E5BF768D3","f1_shininess":"CAE5EFC3-BE2C-4779-A723-7B6E454E3335","f1_specular":"F88523A7-185A-459E-A030-F229257E82A5"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"403ECCAC-F880-4075-AB20-1F8CE7B18D0A","f2_ior":"173AA08A-4C3B-4C26-9C00-9BA26CF87DB2","f2_roughness":"FD525C6E-BC0B-4A02-8953-F2C818A03BC6","f2_transmissionSamplerSize":"E9E01B7A-0614-4FBF-8B24-D1E35FD906EC","f2_transmissionSamplerMap":"9AABB8C2-C043-40CE-A646-443F1AA3287C","f2_transmissionDepthMap":"F3324220-C688-4735-91D0-5C3DE3843079","f2_aspectRatio":"D4A274D7-324F-4683-9A6E-C7794CCB655C","f2_alpha":"5E84EC0A-7CC5-49E8-A5CA-A8B14DA2C87E","f2_mode":"BA9EE373-1ADF-420D-9A41-A5B3C75403DA"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"78665D6C-08DD-4FF3-8869-1E7B3A55B015","f4_far":"ABD150BB-9C45-4A60-B5CD-6D01C7551382","f4_isVector":"64112331-4AD7-4316-AB4D-78916123F637","f4_isWorldSpace":"EFCA8ADE-0F4F-4861-9132-8AB61B1B2C5A","f4_origin":"CBEA7389-2E8A-45C4-981B-3CC1556940AF","f4_colorA":"89EAA588-CB39-4FFA-ADCA-5B443A7006A3","f4_colorB":"6E0F0350-96CD-4838-BA52-E355C663308E","f4_alpha":"DC235A35-0644-40B8-A7CD-F879C1D262A0","f4_mode":"3D8D2047-712B-4E5E-A629-2BCABAD894C9"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"CE18C29F-8532-461E-A54B-8F52A7882C1F","f3_bias":"E6F704BE-078A-48A2-A2FC-8D4D58932343","f3_scale":"FA68CE73-DF0E-425F-A34D-CCDE2BA41A94","f3_intensity":"06A28249-2189-424D-B5EE-561EA59F6D80","f3_factor":"91700CD7-CEB9-40B0-B53F-8CFCF56393B6","f3_alpha":"61AB44FB-33BA-4154-B902-6BD2FF35B479","f3_mode":"AEABAD3D-FF54-4123-964E-0935EE2971E1"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"9BEEBFF9-03CB-4691-9B2F-47E5F95B6B89","fragment":"9BEEBFF9-03CB-4691-9B2F-47E5F95B6B89"},{"uuid":"2F6B7FAC-E0BB-4FB3-B555-28E46A78D262","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2ABE374D-B591-4F63-9656-5405362CF87D","f1_mode":"AAFF39AD-A590-4982-8FB1-2AC780862905","f1_shininess":"D8A5AD4D-6F16-4811-B9A9-BFE10DDCBDF7","f1_specular":"17F8FC1D-93DC-42A0-A2FF-CE2C1904CE81"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"BCAF7273-E35D-4803-B21E-0049A4D5DD98","f2_ior":"7639406A-4F5A-4BDA-885E-36F4D45AA344","f2_roughness":"5E1A099F-709F-4663-9A94-E79114A66FF8","f2_transmissionSamplerSize":"C244CF08-7B85-4E4D-B1F4-447D773BFA8B","f2_transmissionSamplerMap":"9968B4BB-7D31-4B8F-B62D-54CF9B00880D","f2_transmissionDepthMap":"B55973B0-0DA0-4208-ABE6-8BCE1FBE36D6","f2_aspectRatio":"5A0857E9-16F3-456F-9471-2B0C6F4F96D4","f2_alpha":"6B6ACFEE-F214-4343-805C-CA8DE599D93C","f2_mode":"83FA1124-2B0C-4202-9474-1F2C198375A3"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"274821BB-B487-4B45-8F16-89F6FB4054CD","f4_far":"44A1B599-EA26-4321-94D1-19126AA8E006","f4_isVector":"507ABD3C-B169-48E3-9D54-A490D17DD09A","f4_isWorldSpace":"66A63639-E2BF-4A52-90DF-61A3A44633A3","f4_origin":"579184AB-0437-4E8A-B033-4FD950F0C57B","f4_colorA":"474A9D86-644D-494F-87BC-6CEDD5B2D5C9","f4_colorB":"FD1BE0DB-F8F7-46EE-8451-9C9704AF87FB","f4_alpha":"5936ADB5-9804-48BF-88F5-658ED14CCA59","f4_mode":"B53AB88C-8029-4C15-A4BD-8F2B18C0FA32"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F4E654E3-BE0D-4F34-BB53-C16A7BB25A63","f3_bias":"85D6924A-A118-4F78-8BEA-A1573E7FCBB0","f3_scale":"DD35BE09-24CF-442B-BD59-D8BD5CA10F38","f3_intensity":"9321F44F-F091-448F-83B4-9CE206533AEE","f3_factor":"AE8568DB-9875-4EF9-AEAC-64351F6D1443","f3_alpha":"2EEE3061-C647-46C1-8494-EBA2C9FB4586","f3_mode":"C1D86344-8387-4A03-9121-CECE3C9C88D3"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"8520BBB9-50EB-4DD5-AF68-A77B0C8B6E67","fragment":"8520BBB9-50EB-4DD5-AF68-A77B0C8B6E67"},{"uuid":"D3B36C2F-CC9E-4D3B-BD20-682BBF238DCF","type":"ShaderMaterial","reflectivity":{"uuid":"88C15CF6-045F-43D3-83EA-4A44364A738C","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"0793EC50-F08F-41A8-9724-F0D332F25262","f0_alpha":"649BFA03-B69B-46BA-97D8-BA95548CC305","f0_mode":"455B4622-B132-45DB-86C8-379AF25115B8"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"A3BEEEDA-88A0-420F-A9F8-69A0C4A3A74D","f1_mode":"108F6F65-DD6D-4DC6-8EFC-3C84ECD95CB4","f1_roughness":"FB77B62D-7341-49E8-B3F3-DC7CB085294C","f1_metalness":"67AE7F03-F15B-44B6-80F2-C695083148A7","f1_reflectivity":"88C15CF6-045F-43D3-83EA-4A44364A738C"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"C2B8C630-1FB7-4AA4-B56F-8B6E3BC21ED4","fragment":"C2B8C630-1FB7-4AA4-B56F-8B6E3BC21ED4"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"AE06BDD2-E0CF-426B-BE04-B4868334EBAC","name":"Base State","position":[141.02183525332993,-296.6187429733143,-721.0597147499648],"rotation":[-0.2874557278034662,0.42044981680543386,0.12007865253721106,"XYZ"],"scale":[1.0000000000000018,0.999999999999995,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"geometry":{"width":50,"height":50,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"97D599E3-2D87-4E4E-BA2F-E1504C18AF38","f1_mode":"289392FC-5605-436F-917E-2EDADBECF5DB","f1_shininess":"F6A68E7A-7F95-4461-B577-CFC0E5E89FD2","f1_specular":"7B2B89AF-0030-487D-B919-914E28580627"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DB499C87-183A-44AC-A630-12187BF93009","f2_ior":"7182CE29-724E-4119-B493-97EA34A95A69","f2_roughness":"FEBB8B7C-ECAD-4EE3-9345-5236ABE26783","f2_transmissionSamplerSize":"64EC6987-76FB-4BBF-BF1D-52D8E5B09A15","f2_aspectRatio":"E49FB43F-6F9E-481D-B7DB-3AFE6F403DD4","f2_alpha":"ED611CDD-F4BB-48F3-B4B6-CE74DF848BE8","f2_mode":"FD61BC62-F4B3-4370-B7E5-22EE6B757B2B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"0C837D43-30F2-4E70-9245-37DA45714D08","f4_far":"1067115A-9121-479B-B267-08187776ABB8","f4_isVector":"8031D260-CCD8-41BE-A9AA-AC8AFDB0C64A","f4_isWorldSpace":"C9845EA5-ED81-4F19-9C1F-A3526CA84C7D","f4_origin":"37341C34-5506-4062-8D66-92103EB28D52","f4_colorA":"A1FA6631-5897-49CF-8790-46FA1FD93BA5","f4_colorB":"56F41374-B012-4489-BA40-C8C0123AFD40","f4_alpha":"C491BB62-5E94-4D0D-A911-E3FA3C3A18E9","f4_mode":"5936EE3E-81D5-4917-BB2A-6C1405CDCB81"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4859FD31-4236-4E91-8068-30E0881511B5","f3_bias":"32BC114C-9030-47B1-B081-E5451D57167B","f3_scale":"4AAEC51B-8949-42A5-9326-4BF4388E934D","f3_intensity":"D8463CD5-D0D7-4D70-B3B9-1B7FD449BDE5","f3_factor":"E1CC51EA-B0D4-4557-A8A8-8CA9DC9B9C10","f3_alpha":"8B947BFF-F40E-4395-A411-BAF8866544AE","f3_mode":"069CD155-1FEF-4A74-8A66-D94467F23403"}}]}},{"uuid":"8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6","name":"State 1","position":[141.02183525332993,-296.6187429733143,-721.0597147499648],"rotation":[-0.2874557278034662,0.42044981680543386,0.12007865253721106,"XYZ"],"scale":[1.0000000000000018,0.999999999999995,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"geometry":{"width":50,"height":50,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"08994AC3-8CCD-4C06-AA10-D8B076F2A28D","f1_mode":"26F0632E-36BB-4538-8B06-4B736599DEF8","f1_shininess":"DA9811E6-CFC6-4A76-9C1C-10FE83CECACA","f1_specular":"330A752D-349C-48FD-8789-F4530615FC2D"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"7E829141-DEB0-4E03-AE46-EE151C5460FE","f2_ior":"8E56073A-134C-47CE-A331-E605736AA2F1","f2_roughness":"B32DA12D-5E41-4E73-8192-0A1F066C0B6F","f2_transmissionSamplerSize":"7994DD4C-C8A1-44C7-AF71-975C740098A1","f2_aspectRatio":"2D8E15EA-682F-4BFF-9FBE-4C25767AD4E1","f2_alpha":"06624DC7-0B26-4323-93F9-3C4E62AA035C","f2_mode":"38AC740E-EB57-48A7-816A-32891EEF12A1"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"B99521F5-4BC3-4AF2-B681-84FC52EE6527","f4_far":"DB173E36-C1C7-49F0-9C6B-21484D89E31E","f4_isVector":"6FD4EE6E-4C93-4ED6-836A-5B9A5E62DA63","f4_isWorldSpace":"660426CA-B602-4AF2-872A-8B5B3D7ECDB6","f4_origin":"C7626789-1EED-4CB0-BBF1-59C7EF89798F","f4_colorA":"C7EE252C-6BB0-4496-BB54-8984EE1A7265","f4_colorB":"C440BD83-5B53-484B-A58C-FDBB3DEDC16F","f4_alpha":"DEB09ABB-B928-4989-9781-B2DE1E2D6BD8","f4_mode":"3442EE1C-89DC-4B81-8C1A-9DFBB29989A3"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"53A359F2-5E84-457E-BF91-523309AD793A","f3_bias":"FD227DAF-EBC9-4A60-9858-7C830ADF8F66","f3_scale":"B2B9863C-00C3-4BDA-ACCB-6E50E4C29EF8","f3_intensity":"1D3B2926-3432-46C4-9871-3B2E95D5A920","f3_factor":"5B605423-2316-4812-ACBF-E4E79261F33C","f3_alpha":"CF52E2BC-1174-4E88-A9AE-EA40DAC077A5","f3_mode":"D2BDC10C-42B5-4F08-B1EA-B37C9ECE9D3B"}}]}},{"uuid":"208984AD-68A2-4B5F-984F-D25E0AC0E004","name":"Base State","position":[168.69965599500395,135.95632075884583,-197.92637657361064],"rotation":[-0.26179938779914946,-0.2617993877991495,-0.08726646259971652,"XYZ"],"scale":[0.9999999999999984,0.9999999999999982,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1]},{"uuid":"62180D6B-6FBA-4458-8CE6-715559EF9BA1","name":"State 1","position":[168.69965599500395,135.95632075884583,-197.92637657361064],"rotation":[-0.36207427520465874,-0.3395493729251824,-0.12082205594174805,"XYZ"],"scale":[0.9999999999999984,0.9999999999999982,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1]},{"uuid":"4596904D-B29F-4CBD-A90A-4F84B0F2FB61","name":"Base State","position":[114.72632135694906,-20.522380316571702,-156.39426960988678],"rotation":[-0.4939290934384833,-0.4703001772840014,-0.2393225174477351,"XYZ"],"scale":[0.8373657976315947,0.837365797631594,0.8373657976315954],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA","name":"State 1","position":[114.72632135694906,-20.522380316571702,-156.39426960988678],"rotation":[-0.6163023083427105,-0.5311053580547312,-0.3019630117629061,"XYZ"],"scale":[0.8373657976315948,0.8373657976315941,0.8373657976315957],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"C0E7FD0E-F8A5-43AC-9256-DFEB7453BAFD","name":"Base State","position":[145.26433001757783,109.51028322658746,-44.57193952147844],"rotation":[-0.5672073082371434,-0.3747051476082441,-0.22906169065725074,"XYZ"],"scale":[1.0000000000000029,1.0000000000000016,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":50,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C0A2AA84-2D3C-43A6-9401-ACE89E7A1D01","f1_mode":"233A9CFB-6E9E-42CD-B9E9-908A125DD4CE","f1_shininess":"A21C5A15-6C30-47ED-A49E-D4AA61069276","f1_specular":"CFE287DB-00A0-412D-A971-BB424138ED4F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8E9A064A-D472-4E6F-8190-3A055B4CB344","f2_ior":"3A96255C-4F9B-48B0-9E8D-FA23F7EC4BEF","f2_roughness":"F13E4CB4-D2DB-40B2-983C-874AEFD21B80","f2_transmissionSamplerSize":"B9E36D16-C9BA-47F3-96CC-CFEE58A06931","f2_aspectRatio":"776CADE3-BD21-420C-8BD7-2D4A7C7C4078","f2_alpha":"807EF072-2E03-409D-94C2-82C516E7A7D3","f2_mode":"8A89F1D3-CB12-4765-9CE5-39380379FFDF"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"B4B666BD-E5E5-4D91-9C31-CC82F4B08669","f4_far":"2E7EF4FC-4C7B-4533-AA57-F15A55101943","f4_isVector":"3DF27407-96F8-4D0F-829F-E0E93E226BF9","f4_isWorldSpace":"5DD7DDBF-4DFD-47E1-8038-737E078B351C","f4_origin":"4CD7EFC4-81DB-4E18-A4E1-352E0021C2B6","f4_colorA":"35670302-430E-4495-A6EA-59C4FE3122AE","f4_colorB":"0CCE096C-CD85-4825-9512-9563FEC70CB9","f4_alpha":"3D1CAEC5-B6D9-45A7-A66C-F451EE4EB081","f4_mode":"6267F202-E60F-4894-8B22-949035C3309E"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"51C04126-9C78-41F6-A794-E0C45727279E","f3_bias":"A8E1A38E-B53B-46CB-8252-E1240290AAEE","f3_scale":"F4669BB0-464A-427D-845F-550F94AD86B8","f3_intensity":"0B9DC131-A1FF-4B59-9DFF-ECA674A54B45","f3_factor":"9F6690B3-5B46-4FDB-ADEB-60BE7A9C1B58","f3_alpha":"6B741CD0-54D9-4722-92B7-D43B3E380706","f3_mode":"EB9EC14B-C7EE-452E-976C-160EE9DB02D5"}}]}},{"uuid":"5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B","name":"State 1","position":[145.26433001757783,109.51028322658746,-44.57193952147844],"rotation":[-0.5672073082371434,-0.3747051476082441,-0.22906169065725074,"XYZ"],"scale":[1.0000000000000029,1.0000000000000016,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":50,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B0466183-ACD9-4580-B8EF-43FFB282AB26","f1_mode":"62A636E8-F312-40B4-8056-3A7C000A5EC8","f1_shininess":"67B1B407-D4F3-4625-BAE1-809FE4B061C8","f1_specular":"B4D6C10D-2CCD-4553-B6CD-AAA5FC257808"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"12655624-DE63-45C3-B2F2-AF9EDD142B32","f2_ior":"D4E637C6-32C4-44ED-9876-BF272BB9335C","f2_roughness":"8F139FB3-FDE1-4D11-8B4A-D4C4E3A6C6A7","f2_transmissionSamplerSize":"BA25A6BE-62E4-4028-A7E7-7945379792F6","f2_aspectRatio":"A5B19FE4-02D1-4B9E-BEDB-9F854CDB65BD","f2_alpha":"8B05A9FE-BB1C-451E-9865-A52CB0B121EA","f2_mode":"1FC8DED6-8B26-4B79-9C72-8E81C7C7761B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"133CE290-555D-4021-98F5-EF7D3C70A542","f4_far":"F5CAA045-C490-4865-B0B6-9A38EFCFFAA5","f4_isVector":"5CC34833-08D2-4C92-8A50-06E4EFC63C01","f4_isWorldSpace":"572C15C9-C638-48AB-886C-E106E53038DE","f4_origin":"555027F2-ECEE-485A-8AB7-112D351F8FEC","f4_colorA":"8FB90206-0177-4B6A-9861-7580FC055514","f4_colorB":"967DA95F-0B27-4BCD-9038-D59A9A6FDA9A","f4_alpha":"01C09800-C118-4FFB-8FEE-C1D379166314","f4_mode":"84F99C05-1E2E-4A1E-A7B1-CD88100EE39E"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"5A6591BB-7829-4199-ACBC-185496402786","f3_bias":"27BECCC1-494F-4CE3-A5DF-FEB15503F4F9","f3_scale":"816FFA88-9A28-453C-8247-3B7595AD4A82","f3_intensity":"931B663D-06E0-4DBC-ADDA-E0D61EDA3A65","f3_factor":"DA1D99F5-0F94-4FAF-B1E2-FF623C4EE6D3","f3_alpha":"69983C84-317A-4D4F-98B1-5307A34F629A","f3_mode":"A20F4F4C-3495-444C-8723-79842D7BAA5E"}}]}},{"uuid":"D86D5F0D-7A6B-497D-92CB-19F9F7B50F78","name":"Base State","position":[166.4449569745533,-136.32101579128442,-292.4943118617949],"rotation":[-0.515223841716207,-0.8035808813259896,-0.38704408557422565,"XYZ"],"scale":[1.0000000000000018,0.999999999999999,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"23CB8655-8879-40C2-A874-0CE3F840678D","f1_mode":"BF5A0CA5-90C6-4A60-9515-CD2FEA140F3A","f1_shininess":"0B967110-6EEE-431D-8255-88CCB749060A","f1_specular":"E75B3A35-4BC8-451A-B749-FFB398C4DDE5"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"55201A7D-F657-4063-97B4-BC7259E7C1BD","f2_ior":"338C24D5-D670-4403-85A2-8DB5A6E96D65","f2_roughness":"A049D100-EE87-4292-B62A-29E9E822BC0F","f2_transmissionSamplerSize":"42350647-B070-4510-9002-A83F4F768F08","f2_aspectRatio":"35FD02AC-0382-42A6-8075-2EEAF32171B5","f2_alpha":"4E0CED78-6FF6-49F5-80E4-EDCD5C6B2B96","f2_mode":"38348C47-322B-4C48-B47F-D9B556804AD6"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"50A4C54B-B46A-48C7-A547-CA5F92BB7C51","f4_far":"7DE794B1-FA9B-411D-A614-80DF2CEB0D54","f4_isVector":"2D3AC59C-4BC7-496E-B591-E64805BF61A5","f4_isWorldSpace":"2526BCFE-D748-4730-B04C-62D69979802A","f4_origin":"F63B9107-5DB4-4C03-87EE-5B60ECC0F915","f4_colorA":"23987864-DA91-499C-8ADD-F77DC8F8BF4C","f4_colorB":"297ED369-6918-4311-A28C-3969E7C6230B","f4_alpha":"35C958F9-7587-4848-9D6D-431F9ED29D18","f4_mode":"75A4133D-7613-409E-BA3E-74DE4D1BEAE7"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"77240702-3151-447D-B477-8DE5CA7BD17D","f3_bias":"5670DFB3-0A4E-46CB-BACB-DDE5ADCB42F9","f3_scale":"597E7330-574F-4465-92D2-2C5C64F8680B","f3_intensity":"7CDB93E9-8FDD-4925-B167-5B3438E4250D","f3_factor":"0D2F97BF-DB41-4C5C-93E0-28C9EBC72F60","f3_alpha":"7551B413-79FE-474F-A5D2-D06FC7B1B7C4","f3_mode":"BE550D74-26B5-4923-BD0D-FCA85E6F7024"}}]}},{"uuid":"B805F286-540C-4923-9DB9-306A8561C88A","name":"State 1","position":[166.4449569745533,-136.32101579128442,-292.4943118617949],"rotation":[-0.515223841716207,-0.8035808813259896,-0.38704408557422565,"XYZ"],"scale":[1.0000000000000018,0.999999999999999,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"428632AD-3E68-4896-81EC-D57BE282759C","f1_mode":"4527B844-EF73-482F-BC3D-5DD57F9DD545","f1_shininess":"FA3C26ED-BC79-4E76-AAF4-21EE59C93F34","f1_specular":"98719716-99CA-436E-8324-D35AF3347D4D"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"49C25C33-25E1-44ED-91F5-A4362F76E4C3","f2_ior":"799DB449-170A-4386-B03B-8477336F6C3A","f2_roughness":"0E7CF544-3E4A-4261-AD08-F413FC61978C","f2_transmissionSamplerSize":"CD3C28F8-2D74-4F62-A3D6-7AE82B01CC1F","f2_aspectRatio":"039D6F76-95F5-45A3-91D8-59DCF9E3D183","f2_alpha":"6EC0F668-086C-46EF-9D3D-F2096A0EA5D3","f2_mode":"62DB3E6B-DFAC-4FC8-926B-850A364CD7D9"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"633E50E1-EEF9-4ACF-9E89-06E1436F088C","f4_far":"1FD339FD-0785-44F5-8704-C26BA8F23ECA","f4_isVector":"8F7A8DE9-0AA0-4C26-87C8-12CBD0340D85","f4_isWorldSpace":"B25FA297-8CC3-42D4-AF30-7C14C9B98924","f4_origin":"E504FE43-0A90-4962-9A78-A96C14D2AF04","f4_colorA":"A586F83A-97DB-4CF2-9D3E-5EA670C43B6C","f4_colorB":"878A5E8E-E90A-4197-8F7F-19D14067E0E6","f4_alpha":"9548F07C-6861-412E-8481-46B0D8D33272","f4_mode":"B59A4799-C2E6-4F8A-9298-A91A778DA82B"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"BEF1BFEE-BCF9-431B-94AC-5CBF5E2D350B","f3_bias":"22F55725-6E24-4219-9B1C-D931C53637CB","f3_scale":"C52F90CD-9A79-49CB-87CC-4865B41CCEF4","f3_intensity":"1D1F681F-D693-4D00-A0DB-178F93094146","f3_factor":"8E8B0B0E-B1A2-4C10-8215-199FEC7264F9","f3_alpha":"F1D0DF1E-CB5C-4282-ACD3-346A19BA74E5","f3_mode":"0E722988-ABAB-49BB-8A7B-9AB6E4A743FF"}}]}},{"uuid":"AA54E20C-9CAC-49D4-8129-6C593B730710","name":"Base State","position":[-138.165696925378,-13.632103442965462,-157.28079644362225],"rotation":[-0.28746049116178374,0.42050103751990997,0.12010838826100916,"XYZ"],"scale":[0.9999999999999994,1,0.9999999999999996],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"87BFAD8A-9C35-4E54-B093-594677A83229","name":"State 1","position":[-138.165696925378,-13.632103442965462,-157.28079644362225],"rotation":[-0.39778586379970626,0.49413821209522407,0.17270739198835963,"XYZ"],"scale":[0.9999999999999993,1,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}],"nodes":[{"uuid":"97D599E3-2D87-4E4E-BA2F-E1504C18AF38","type":"f","value":1,"nodeType":"Float"},{"uuid":"289392FC-5605-436F-917E-2EDADBECF5DB","type":"i","value":0,"nodeType":"Int"},{"uuid":"F6A68E7A-7F95-4461-B577-CFC0E5E89FD2","type":"f","value":30,"nodeType":"Float"},{"uuid":"7B2B89AF-0030-487D-B919-914E28580627","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"DB499C87-183A-44AC-A630-12187BF93009","type":"f","value":10,"nodeType":"Float"},{"uuid":"7182CE29-724E-4119-B493-97EA34A95A69","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"FEBB8B7C-ECAD-4EE3-9345-5236ABE26783","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"64EC6987-76FB-4BBF-BF1D-52D8E5B09A15","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E49FB43F-6F9E-481D-B7DB-3AFE6F403DD4","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"ED611CDD-F4BB-48F3-B4B6-CE74DF848BE8","type":"f","value":1,"nodeType":"Float"},{"uuid":"FD61BC62-F4B3-4370-B7E5-22EE6B757B2B","type":"i","value":0,"nodeType":"Int"},{"uuid":"0C837D43-30F2-4E70-9245-37DA45714D08","type":"f","value":50,"nodeType":"Float"},{"uuid":"1067115A-9121-479B-B267-08187776ABB8","type":"f","value":118,"nodeType":"Float"},{"uuid":"8031D260-CCD8-41BE-A9AA-AC8AFDB0C64A","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9845EA5-ED81-4F19-9C1F-A3526CA84C7D","type":"f","value":0,"nodeType":"Float"},{"uuid":"37341C34-5506-4062-8D66-92103EB28D52","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A1FA6631-5897-49CF-8790-46FA1FD93BA5","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"56F41374-B012-4489-BA40-C8C0123AFD40","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"C491BB62-5E94-4D0D-A911-E3FA3C3A18E9","type":"f","value":1,"nodeType":"Float"},{"uuid":"5936EE3E-81D5-4917-BB2A-6C1405CDCB81","type":"i","value":2,"nodeType":"Int"},{"uuid":"4859FD31-4236-4E91-8068-30E0881511B5","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"32BC114C-9030-47B1-B081-E5451D57167B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4AAEC51B-8949-42A5-9326-4BF4388E934D","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8463CD5-D0D7-4D70-B3B9-1B7FD449BDE5","type":"f","value":2,"nodeType":"Float"},{"uuid":"E1CC51EA-B0D4-4557-A8A8-8CA9DC9B9C10","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"8B947BFF-F40E-4395-A411-BAF8866544AE","type":"f","value":1,"nodeType":"Float"},{"uuid":"069CD155-1FEF-4A74-8A66-D94467F23403","type":"i","value":2,"nodeType":"Int"},{"uuid":"08994AC3-8CCD-4C06-AA10-D8B076F2A28D","type":"f","value":1,"nodeType":"Float"},{"uuid":"26F0632E-36BB-4538-8B06-4B736599DEF8","type":"i","value":0,"nodeType":"Int"},{"uuid":"DA9811E6-CFC6-4A76-9C1C-10FE83CECACA","type":"f","value":30,"nodeType":"Float"},{"uuid":"330A752D-349C-48FD-8789-F4530615FC2D","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"7E829141-DEB0-4E03-AE46-EE151C5460FE","type":"f","value":10,"nodeType":"Float"},{"uuid":"8E56073A-134C-47CE-A331-E605736AA2F1","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"B32DA12D-5E41-4E73-8192-0A1F066C0B6F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"7994DD4C-C8A1-44C7-AF71-975C740098A1","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2D8E15EA-682F-4BFF-9FBE-4C25767AD4E1","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"06624DC7-0B26-4323-93F9-3C4E62AA035C","type":"f","value":1,"nodeType":"Float"},{"uuid":"38AC740E-EB57-48A7-816A-32891EEF12A1","type":"i","value":0,"nodeType":"Int"},{"uuid":"B99521F5-4BC3-4AF2-B681-84FC52EE6527","type":"f","value":50,"nodeType":"Float"},{"uuid":"DB173E36-C1C7-49F0-9C6B-21484D89E31E","type":"f","value":118,"nodeType":"Float"},{"uuid":"6FD4EE6E-4C93-4ED6-836A-5B9A5E62DA63","type":"f","value":1,"nodeType":"Float"},{"uuid":"660426CA-B602-4AF2-872A-8B5B3D7ECDB6","type":"f","value":0,"nodeType":"Float"},{"uuid":"C7626789-1EED-4CB0-BBF1-59C7EF89798F","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C7EE252C-6BB0-4496-BB54-8984EE1A7265","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"C440BD83-5B53-484B-A58C-FDBB3DEDC16F","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"DEB09ABB-B928-4989-9781-B2DE1E2D6BD8","type":"f","value":1,"nodeType":"Float"},{"uuid":"3442EE1C-89DC-4B81-8C1A-9DFBB29989A3","type":"i","value":2,"nodeType":"Int"},{"uuid":"53A359F2-5E84-457E-BF91-523309AD793A","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"FD227DAF-EBC9-4A60-9858-7C830ADF8F66","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B2B9863C-00C3-4BDA-ACCB-6E50E4C29EF8","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D3B2926-3432-46C4-9871-3B2E95D5A920","type":"f","value":2,"nodeType":"Float"},{"uuid":"5B605423-2316-4812-ACBF-E4E79261F33C","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"CF52E2BC-1174-4E88-A9AE-EA40DAC077A5","type":"f","value":1,"nodeType":"Float"},{"uuid":"D2BDC10C-42B5-4F08-B1EA-B37C9ECE9D3B","type":"i","value":2,"nodeType":"Int"},{"uuid":"C7B2F91D-7FED-478C-959C-449A10D9819E","type":"f","value":1,"nodeType":"Float"},{"uuid":"9184024C-B5B0-4E89-9537-600F47F2E5A2","type":"i","value":0,"nodeType":"Int"},{"uuid":"5CAF24EF-9689-4241-BD52-E9903F19E671","type":"f","value":30,"nodeType":"Float"},{"uuid":"D958C88D-CB96-4E9A-9C6B-65992544B911","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"D181C661-09CB-4AF5-99A9-4A38ABBDF718","type":"f","value":10,"nodeType":"Float"},{"uuid":"2309B2B2-3674-4AB1-A390-5C7267F464F7","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"356F961F-3952-43F5-A112-19DBE950745A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"501F0F29-ED8C-4205-9D03-0E82FC2B6D79","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B012D4A3-4638-49F9-99A8-73368280AF8E","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"0CD9BF3E-2E42-45A7-B6B4-E7C25A540248","project":false,"nodeType":"Texture"},{"uuid":"0CD9BF3E-2E42-45A7-B6B4-E7C25A540248","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0F7F000D-23F9-41D7-B335-FF2316DA13FF","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"DD230832-2007-495D-9899-DAE371109B87","project":false,"nodeType":"Texture"},{"uuid":"DD230832-2007-495D-9899-DAE371109B87","type":"v2","index":0,"nodeType":"UV"},{"uuid":"89184C21-AC8C-40F0-887E-5D95F2597D9C","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"632CB303-39CA-43EF-B83C-D1B0BA894482","type":"f","value":1,"nodeType":"Float"},{"uuid":"0D51CF3B-3D47-40D0-A89C-3BDF5A842122","type":"i","value":0,"nodeType":"Int"},{"uuid":"41BFA695-8447-4A9D-8403-1BEAE65A6A04","type":"f","value":50,"nodeType":"Float"},{"uuid":"A7F9BA3D-AE7B-40EE-9E0E-F19C6FD51AC5","type":"f","value":118,"nodeType":"Float"},{"uuid":"961CD512-9975-471B-B2CB-30B04858218F","type":"f","value":1,"nodeType":"Float"},{"uuid":"26D6692C-CC7C-40C5-BCB5-DA372EEC2FE5","type":"f","value":0,"nodeType":"Float"},{"uuid":"EE0E66A5-4C92-4066-A3DF-5D1229534AE0","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F6974809-65B3-405A-B4B2-1109BB74E60E","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"D3159DED-E504-4490-82D3-8B9C2F5C4F1B","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"BA5466DA-C13A-4FA0-8F61-58F2252925C1","type":"f","value":1,"nodeType":"Float"},{"uuid":"1273EABA-E66F-4888-87DD-5EB6EFCAF946","type":"i","value":2,"nodeType":"Int"},{"uuid":"E4C2A185-4F58-48C6-9E70-1E6CD8BFA546","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6A16FC1F-878F-479A-A5F3-60169E31D143","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4B31F9F3-2C52-40A6-A96F-3DE0D21532AF","type":"f","value":1,"nodeType":"Float"},{"uuid":"BEB75B90-0B15-4BB9-9593-2CC24A72045E","type":"f","value":2,"nodeType":"Float"},{"uuid":"DCAA89F2-9FCC-4AE3-9010-527951BE2BB3","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"C7098429-AA24-44CF-A0D9-C656C1645AF8","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D408CB1-B0B9-4D91-BAA7-649D465D47AF","type":"i","value":2,"nodeType":"Int"},{"uuid":"16470AB3-EFDA-46A2-9C0B-C6FF32B16DC4","type":"phong","color":"44870CFE-BFCD-4B33-8E0C-B3AAD2BBD370","specular":"D958C88D-CB96-4E9A-9C6B-65992544B911","shininess":"5CAF24EF-9689-4241-BD52-E9903F19E671","shadingAlpha":"C7B2F91D-7FED-478C-959C-449A10D9819E","shadingBlend":"9184024C-B5B0-4E89-9537-600F47F2E5A2","afterColor":"FEBB8C77-0AA0-431C-B7D3-CE9721FA8E9A","alpha":"01CA70F4-FED1-40B2-83E5-6AE453BAE7BB","nodeType":"Phong"},{"uuid":"44870CFE-BFCD-4B33-8E0C-B3AAD2BBD370","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"FEBB8C77-0AA0-431C-B7D3-CE9721FA8E9A","type":"v3","a":"7F75EE24-2022-4BD1-A5A6-01E6B1BAC96E","b":"4CC25A14-495E-419E-ACCC-CCBCF1882B5A","alpha":"642636D4-845C-4DCC-ABD0-2E0DDAB07EAC","mode":"3D408CB1-B0B9-4D91-BAA7-649D465D47AF","nodeType":"Blend"},{"uuid":"7F75EE24-2022-4BD1-A5A6-01E6B1BAC96E","type":"v3","a":"4EE5DE05-6619-452B-9F5E-D57E5F5B89E5","b":"1C278B46-C3C6-41BC-A171-502AF69AFBED","alpha":"00C2E7BB-F6F9-4E9C-AE74-BB50A9DAA298","mode":"1273EABA-E66F-4888-87DD-5EB6EFCAF946","nodeType":"Blend"},{"uuid":"4EE5DE05-6619-452B-9F5E-D57E5F5B89E5","type":"v3","a":"E7D8061F-A95F-40B1-A3C1-113F2614AF9D","b":"4ADBE397-5345-45BF-98CE-4F04308A78A3","alpha":"8628F5E4-99D5-488A-8BFF-6CC86CD4B474","mode":"0D51CF3B-3D47-40D0-A89C-3BDF5A842122","nodeType":"Blend"},{"uuid":"E7D8061F-A95F-40B1-A3C1-113F2614AF9D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4ADBE397-5345-45BF-98CE-4F04308A78A3","type":"v3","thickness":"D181C661-09CB-4AF5-99A9-4A38ABBDF718","ior":"2309B2B2-3674-4AB1-A390-5C7267F464F7","roughness":"356F961F-3952-43F5-A112-19DBE950745A","alpha":"632CB303-39CA-43EF-B83C-D1B0BA894482","calpha":"g4ADBE397534545BF98CE4F04308A78A3_calpha","nodeType":"Transmission"},{"uuid":"8628F5E4-99D5-488A-8BFF-6CC86CD4B474","type":"f","src":"g4ADBE397534545BF98CE4F04308A78A3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1C278B46-C3C6-41BC-A171-502AF69AFBED","type":"v3","near":"41BFA695-8447-4A9D-8403-1BEAE65A6A04","far":"A7F9BA3D-AE7B-40EE-9E0E-F19C6FD51AC5","isVector":"961CD512-9975-471B-B2CB-30B04858218F","isWorldSpace":"26D6692C-CC7C-40C5-BCB5-DA372EEC2FE5","origin":"EE0E66A5-4C92-4066-A3DF-5D1229534AE0","colorA":"F6974809-65B3-405A-B4B2-1109BB74E60E","colorB":"D3159DED-E504-4490-82D3-8B9C2F5C4F1B","alpha":"BA5466DA-C13A-4FA0-8F61-58F2252925C1","nodeType":"Depth"},{"uuid":"00C2E7BB-F6F9-4E9C-AE74-BB50A9DAA298","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"BA5466DA-C13A-4FA0-8F61-58F2252925C1"},"nodeType":"Expression"},{"uuid":"4CC25A14-495E-419E-ACCC-CCBCF1882B5A","type":"v3","color":"E4C2A185-4F58-48C6-9E70-1E6CD8BFA546","bias":"6A16FC1F-878F-479A-A5F3-60169E31D143","scale":"4B31F9F3-2C52-40A6-A96F-3DE0D21532AF","intensity":"BEB75B90-0B15-4BB9-9593-2CC24A72045E","factor":"DCAA89F2-9FCC-4AE3-9010-527951BE2BB3","alpha":"C7098429-AA24-44CF-A0D9-C656C1645AF8","mode":"3D408CB1-B0B9-4D91-BAA7-649D465D47AF","calpha":"g4CC25A14495E419EACCCCCBCF1882B5A_calpha","nodeType":"Fresnel"},{"uuid":"642636D4-845C-4DCC-ABD0-2E0DDAB07EAC","type":"f","src":"g4CC25A14495E419EACCCCCBCF1882B5A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"01CA70F4-FED1-40B2-83E5-6AE453BAE7BB","type":"f","value":1,"nodeType":"Float"},{"uuid":"2A756239-6F9E-42CD-A215-8005305F6050","type":"f","value":1,"nodeType":"Float"},{"uuid":"0152E954-6FFF-4ABC-91DD-76215984C9B0","type":"i","value":0,"nodeType":"Int"},{"uuid":"3252B908-C558-4EB9-BB96-1FAF15ACF31D","type":"f","value":30,"nodeType":"Float"},{"uuid":"DC2D985C-ED99-43B6-BBD8-F194FC5114DC","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"532EC462-FB11-4543-BBE4-707CFB792BC1","type":"f","value":10,"nodeType":"Float"},{"uuid":"8442DAFF-9DB1-4CF1-BD39-41F1C6F507E3","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"1243DF9B-B5BE-4322-99B2-9DF4B7276C0D","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A10BFA28-0AE8-4620-ABA9-49DEBE6EA0A1","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"EB18570A-F5DB-4F51-8A26-DC5E190C0403","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"50049675-7202-424F-ABB2-5F0F6C35FDF6","project":false,"nodeType":"Texture"},{"uuid":"50049675-7202-424F-ABB2-5F0F6C35FDF6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"8B6B5F3C-DC0D-4B24-A168-68485CE527C2","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"70BAEEB2-C36D-4991-BACE-B27ECF653E08","project":false,"nodeType":"Texture"},{"uuid":"70BAEEB2-C36D-4991-BACE-B27ECF653E08","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5929A6DB-B273-400A-8C89-6637D7FC2156","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"9B72542F-65ED-49CA-8FE5-8A0274999972","type":"f","value":1,"nodeType":"Float"},{"uuid":"28BACF00-9E60-474C-9A58-5D219B8F07A0","type":"i","value":0,"nodeType":"Int"},{"uuid":"BCC3242C-2C3A-4D6A-A008-8856B3807565","type":"f","value":50,"nodeType":"Float"},{"uuid":"7842F70F-7F82-4755-96A7-2BF18FBA41EC","type":"f","value":130,"nodeType":"Float"},{"uuid":"E871B1E9-6DE6-4833-B0DE-78E210A70059","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC913C5D-2791-4D90-8FD0-348541C16CB4","type":"f","value":0,"nodeType":"Float"},{"uuid":"1A39FCBC-BACE-4755-A570-0BDAC757046C","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"910474FF-08F8-4097-9272-DA61CCA2AE90","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"5F45BE5E-BF15-4711-BB7D-18B103AEDAA2","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"151F2D99-1CEF-46B5-8DE1-40AA7CAF9BA1","type":"f","value":1,"nodeType":"Float"},{"uuid":"A8FAB85F-BEDE-4AA1-B912-36E23CD4215D","type":"i","value":2,"nodeType":"Int"},{"uuid":"4ED800BC-F994-4493-82E7-EBCEAEC3CF8A","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"DF4B3FB4-45EB-419D-A865-879D6047DEB0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6386941C-7CB4-4092-A76A-529DD2D99EE6","type":"f","value":1,"nodeType":"Float"},{"uuid":"BC00FC25-A783-4110-A136-AB05B81B8BC9","type":"f","value":2,"nodeType":"Float"},{"uuid":"0B9D284A-44BB-4221-B383-07D235E52969","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"A9812F6E-5E08-4728-84B4-DE6494B66A06","type":"f","value":1,"nodeType":"Float"},{"uuid":"CDF5A285-1151-440B-A315-1F7F9A8BFEB9","type":"i","value":2,"nodeType":"Int"},{"uuid":"553E99F1-F8DB-41D3-BC17-C1FC5D6F5F80","type":"phong","color":"E87C228B-9E00-4CBA-BFCE-780E16BEB9BF","specular":"DC2D985C-ED99-43B6-BBD8-F194FC5114DC","shininess":"3252B908-C558-4EB9-BB96-1FAF15ACF31D","shadingAlpha":"2A756239-6F9E-42CD-A215-8005305F6050","shadingBlend":"0152E954-6FFF-4ABC-91DD-76215984C9B0","afterColor":"3562F0FF-C692-4B02-A9D1-22498C08210D","alpha":"DE267C52-5E4E-461F-B00F-95B59E59BE65","nodeType":"Phong"},{"uuid":"E87C228B-9E00-4CBA-BFCE-780E16BEB9BF","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"3562F0FF-C692-4B02-A9D1-22498C08210D","type":"v3","a":"D844AE43-83D5-4C1E-8D3E-727AF421D89E","b":"CC2620A0-9B2F-4CD7-9682-A37C71FA4292","alpha":"9E6EB6A1-A4EC-4D61-AD94-76F7469010B5","mode":"CDF5A285-1151-440B-A315-1F7F9A8BFEB9","nodeType":"Blend"},{"uuid":"D844AE43-83D5-4C1E-8D3E-727AF421D89E","type":"v3","a":"807049AE-FA9A-4BCA-AD8B-4BB3CA659E9C","b":"8C151615-D582-4AA6-8276-BDD2CCB6CD12","alpha":"30B50027-591A-4E56-B61A-BA0A0AC1C4D9","mode":"A8FAB85F-BEDE-4AA1-B912-36E23CD4215D","nodeType":"Blend"},{"uuid":"807049AE-FA9A-4BCA-AD8B-4BB3CA659E9C","type":"v3","a":"F533D3F1-7FE8-474E-9084-C7F74125D019","b":"11617FF9-52EB-4022-8922-B2FED8F99630","alpha":"7BB10238-2A9D-41BC-A7C7-C81751F95203","mode":"28BACF00-9E60-474C-9A58-5D219B8F07A0","nodeType":"Blend"},{"uuid":"F533D3F1-7FE8-474E-9084-C7F74125D019","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"11617FF9-52EB-4022-8922-B2FED8F99630","type":"v3","thickness":"532EC462-FB11-4543-BBE4-707CFB792BC1","ior":"8442DAFF-9DB1-4CF1-BD39-41F1C6F507E3","roughness":"1243DF9B-B5BE-4322-99B2-9DF4B7276C0D","alpha":"9B72542F-65ED-49CA-8FE5-8A0274999972","calpha":"g11617FF952EB40228922B2FED8F99630_calpha","nodeType":"Transmission"},{"uuid":"7BB10238-2A9D-41BC-A7C7-C81751F95203","type":"f","src":"g11617FF952EB40228922B2FED8F99630_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8C151615-D582-4AA6-8276-BDD2CCB6CD12","type":"v3","near":"BCC3242C-2C3A-4D6A-A008-8856B3807565","far":"7842F70F-7F82-4755-96A7-2BF18FBA41EC","isVector":"E871B1E9-6DE6-4833-B0DE-78E210A70059","isWorldSpace":"CC913C5D-2791-4D90-8FD0-348541C16CB4","origin":"1A39FCBC-BACE-4755-A570-0BDAC757046C","colorA":"910474FF-08F8-4097-9272-DA61CCA2AE90","colorB":"5F45BE5E-BF15-4711-BB7D-18B103AEDAA2","alpha":"151F2D99-1CEF-46B5-8DE1-40AA7CAF9BA1","nodeType":"Depth"},{"uuid":"30B50027-591A-4E56-B61A-BA0A0AC1C4D9","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"151F2D99-1CEF-46B5-8DE1-40AA7CAF9BA1"},"nodeType":"Expression"},{"uuid":"CC2620A0-9B2F-4CD7-9682-A37C71FA4292","type":"v3","color":"4ED800BC-F994-4493-82E7-EBCEAEC3CF8A","bias":"DF4B3FB4-45EB-419D-A865-879D6047DEB0","scale":"6386941C-7CB4-4092-A76A-529DD2D99EE6","intensity":"BC00FC25-A783-4110-A136-AB05B81B8BC9","factor":"0B9D284A-44BB-4221-B383-07D235E52969","alpha":"A9812F6E-5E08-4728-84B4-DE6494B66A06","mode":"CDF5A285-1151-440B-A315-1F7F9A8BFEB9","calpha":"gCC2620A09B2F4CD79682A37C71FA4292_calpha","nodeType":"Fresnel"},{"uuid":"9E6EB6A1-A4EC-4D61-AD94-76F7469010B5","type":"f","src":"gCC2620A09B2F4CD79682A37C71FA4292_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DE267C52-5E4E-461F-B00F-95B59E59BE65","type":"f","value":1,"nodeType":"Float"},{"uuid":"9CE4A97C-F153-40B5-B21E-6C901620972E","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"AA436B6B-9AE2-4A08-A3B3-B09193B45ED3","nodeType":"Color"},{"uuid":"AA436B6B-9AE2-4A08-A3B3-B09193B45ED3","type":"f","value":1,"nodeType":"Float"},{"uuid":"7D301AF5-EC4F-400C-A15C-FA89C1035965","type":"i","value":0,"nodeType":"Int"},{"uuid":"1A2AAEE5-F060-4C07-A78F-9F760BDFC3F7","type":"f","value":1,"nodeType":"Float"},{"uuid":"0CBAFA87-E7E7-4F84-8E7D-728490F21748","type":"i","value":0,"nodeType":"Int"},{"uuid":"9F518D66-84AF-466F-8D81-D5AEF42F8F3B","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"C95D4170-3E95-4DD4-96A8-2FCF7EA5A7A4","type":"f","value":0,"nodeType":"Float"},{"uuid":"D1BA5403-5C59-4109-A6AB-5D9961536520","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"2906BBFA-D5ED-47C2-9D1B-2BD6FEFF8BEB","type":"standard","color":"9CE4A97C-F153-40B5-B21E-6C901620972E","roughness":"9F518D66-84AF-466F-8D81-D5AEF42F8F3B","metalness":"C95D4170-3E95-4DD4-96A8-2FCF7EA5A7A4","alpha":"189224AE-FC52-4233-9EEE-3ED29CE41BAF","reflectivity":"D1BA5403-5C59-4109-A6AB-5D9961536520","shadingAlpha":"1A2AAEE5-F060-4C07-A78F-9F760BDFC3F7","shadingBlend":"0CBAFA87-E7E7-4F84-8E7D-728490F21748","nodeType":"Standard"},{"uuid":"189224AE-FC52-4233-9EEE-3ED29CE41BAF","type":"f","value":1,"nodeType":"Float"},{"uuid":"801F4FEA-C0CA-41B1-AD51-9FCD00BC267C","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8298C5D-4883-4485-B02B-4A20D1CB9A4C","type":"i","value":0,"nodeType":"Int"},{"uuid":"5CCADEBD-A17D-4B41-A00E-C3AC3509AD77","type":"f","value":30,"nodeType":"Float"},{"uuid":"4B8FA47E-8C03-4BCF-AD42-89E7C9E6594D","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"ED2F275C-9D6A-445F-9051-CACB25C3EE06","type":"f","value":10,"nodeType":"Float"},{"uuid":"CCC297AB-6A34-4F98-8F51-BE9429BCA618","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"9D86EFC2-86BD-4519-8B5A-229EF9A1C47B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"7BF34958-1356-4C2A-A6A3-68E12E8B635C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B445BB67-DC48-4555-898B-28B7754AD4D9","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"FC95A690-7E77-4AF6-8150-C706CD942397","project":false,"nodeType":"Texture"},{"uuid":"FC95A690-7E77-4AF6-8150-C706CD942397","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5D42C6BE-A45C-407B-A52A-E6F682721ECC","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"A8915B23-3FC6-4571-9BBC-FA3FC05AE52E","project":false,"nodeType":"Texture"},{"uuid":"A8915B23-3FC6-4571-9BBC-FA3FC05AE52E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"20A74181-C194-4ECF-AB06-257839C645AA","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"3D5FA44C-CC81-4D00-A46A-8D7E43EB7CDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"CF320FA1-FC14-45F5-892A-32103300C9FF","type":"i","value":0,"nodeType":"Int"},{"uuid":"6FB43F4F-3C15-4AF2-8F54-DDF5FBFCA27A","type":"f","value":50,"nodeType":"Float"},{"uuid":"28D73D1B-5521-41CA-8714-2E92EB0BA7AE","type":"f","value":130,"nodeType":"Float"},{"uuid":"243936AE-7E75-4CBF-9A4D-E8DC5BC4ED4D","type":"f","value":1,"nodeType":"Float"},{"uuid":"57A811BD-6F90-4EC8-A78E-AF21DBC58E04","type":"f","value":0,"nodeType":"Float"},{"uuid":"131AD92C-DFBE-4947-9503-0CE0F84B505B","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"71BE4882-D1C9-4F31-9B75-A17DA1A4B81C","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"997DE9AD-1DA2-46BE-9D28-EB3CC8FF8666","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"23765059-3A9C-4BCE-A013-C207BF2ED396","type":"f","value":1,"nodeType":"Float"},{"uuid":"872BAD52-229D-4655-801B-0C87EF39022A","type":"i","value":2,"nodeType":"Int"},{"uuid":"48022D5D-55AC-4E4C-B1F8-7449DFE7E8F5","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"EEFA56CB-7FCF-43FE-9604-D95E5D8C3D8F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"D6BB813A-BA40-48E8-AFAC-E88ACF49FE8A","type":"f","value":1,"nodeType":"Float"},{"uuid":"1454940A-094E-4D84-845E-538C1D7BD987","type":"f","value":2,"nodeType":"Float"},{"uuid":"68DCA73F-B202-43E1-AAB8-FB8B02D986EB","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"D0BE2F08-CF59-4B0B-9B9D-BFAD1B7BFA2B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7E6B9E5-2ED8-45D9-82C0-0C7DCDE77E42","type":"i","value":2,"nodeType":"Int"},{"uuid":"730312A9-7B4A-4E2E-9479-312D4AA50CA6","type":"phong","color":"A139802A-38F1-48C9-8B5B-1C06FF78674F","specular":"4B8FA47E-8C03-4BCF-AD42-89E7C9E6594D","shininess":"5CCADEBD-A17D-4B41-A00E-C3AC3509AD77","shadingAlpha":"801F4FEA-C0CA-41B1-AD51-9FCD00BC267C","shadingBlend":"D8298C5D-4883-4485-B02B-4A20D1CB9A4C","afterColor":"B0AC8760-ECAA-48E5-A99D-93715ADD0B39","alpha":"0A1DE926-B1CB-4F7B-A129-B8ED5E1F9E39","nodeType":"Phong"},{"uuid":"A139802A-38F1-48C9-8B5B-1C06FF78674F","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"B0AC8760-ECAA-48E5-A99D-93715ADD0B39","type":"v3","a":"98F35304-51BF-4418-AD85-27CB404EC4F3","b":"E510904D-E4C4-427D-ABD7-178514990772","alpha":"9BCACF0C-2FE3-416D-A53F-30B27F897360","mode":"C7E6B9E5-2ED8-45D9-82C0-0C7DCDE77E42","nodeType":"Blend"},{"uuid":"98F35304-51BF-4418-AD85-27CB404EC4F3","type":"v3","a":"CD85905C-7D7C-486C-97E6-E87C47A590B4","b":"74B1B155-C756-4546-A4FF-A7A131CA04FE","alpha":"E71456D9-4CC1-4255-A640-539F748BCC70","mode":"872BAD52-229D-4655-801B-0C87EF39022A","nodeType":"Blend"},{"uuid":"CD85905C-7D7C-486C-97E6-E87C47A590B4","type":"v3","a":"8C03159C-B2A8-41AE-8CF1-46B429D62D0E","b":"E47B5450-D7E5-4067-AE7D-DBC0678AC994","alpha":"5C3C447A-2BBE-4DF8-8362-2FE36260382A","mode":"CF320FA1-FC14-45F5-892A-32103300C9FF","nodeType":"Blend"},{"uuid":"8C03159C-B2A8-41AE-8CF1-46B429D62D0E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E47B5450-D7E5-4067-AE7D-DBC0678AC994","type":"v3","thickness":"ED2F275C-9D6A-445F-9051-CACB25C3EE06","ior":"CCC297AB-6A34-4F98-8F51-BE9429BCA618","roughness":"9D86EFC2-86BD-4519-8B5A-229EF9A1C47B","alpha":"3D5FA44C-CC81-4D00-A46A-8D7E43EB7CDC","calpha":"gE47B5450D7E54067AE7DDBC0678AC994_calpha","nodeType":"Transmission"},{"uuid":"5C3C447A-2BBE-4DF8-8362-2FE36260382A","type":"f","src":"gE47B5450D7E54067AE7DDBC0678AC994_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"74B1B155-C756-4546-A4FF-A7A131CA04FE","type":"v3","near":"6FB43F4F-3C15-4AF2-8F54-DDF5FBFCA27A","far":"28D73D1B-5521-41CA-8714-2E92EB0BA7AE","isVector":"243936AE-7E75-4CBF-9A4D-E8DC5BC4ED4D","isWorldSpace":"57A811BD-6F90-4EC8-A78E-AF21DBC58E04","origin":"131AD92C-DFBE-4947-9503-0CE0F84B505B","colorA":"71BE4882-D1C9-4F31-9B75-A17DA1A4B81C","colorB":"997DE9AD-1DA2-46BE-9D28-EB3CC8FF8666","alpha":"23765059-3A9C-4BCE-A013-C207BF2ED396","nodeType":"Depth"},{"uuid":"E71456D9-4CC1-4255-A640-539F748BCC70","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"23765059-3A9C-4BCE-A013-C207BF2ED396"},"nodeType":"Expression"},{"uuid":"E510904D-E4C4-427D-ABD7-178514990772","type":"v3","color":"48022D5D-55AC-4E4C-B1F8-7449DFE7E8F5","bias":"EEFA56CB-7FCF-43FE-9604-D95E5D8C3D8F","scale":"D6BB813A-BA40-48E8-AFAC-E88ACF49FE8A","intensity":"1454940A-094E-4D84-845E-538C1D7BD987","factor":"68DCA73F-B202-43E1-AAB8-FB8B02D986EB","alpha":"D0BE2F08-CF59-4B0B-9B9D-BFAD1B7BFA2B","mode":"C7E6B9E5-2ED8-45D9-82C0-0C7DCDE77E42","calpha":"gE510904DE4C4427DABD7178514990772_calpha","nodeType":"Fresnel"},{"uuid":"9BCACF0C-2FE3-416D-A53F-30B27F897360","type":"f","src":"gE510904DE4C4427DABD7178514990772_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0A1DE926-B1CB-4F7B-A129-B8ED5E1F9E39","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7875B40-FDC3-4744-9751-7CE84A1B2E09","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"843FD723-6CE2-441C-ABDB-12E93E9C75EA","nodeType":"Color"},{"uuid":"843FD723-6CE2-441C-ABDB-12E93E9C75EA","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE360A35-3DFC-4C3A-845D-1DED5DE37879","type":"i","value":0,"nodeType":"Int"},{"uuid":"D799B087-FEB4-495D-915A-9BB255F1B745","type":"f","value":1,"nodeType":"Float"},{"uuid":"C61C9594-320B-4248-B181-D944590510A1","type":"i","value":0,"nodeType":"Int"},{"uuid":"0258A1EC-DF7B-4ED9-BEEF-25EA8F789974","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"6D88A5A9-665F-436E-A236-79D6074B3F3C","type":"f","value":0,"nodeType":"Float"},{"uuid":"0E9CA7ED-22DA-4BC0-A42E-345FEE70AEE8","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FB8D74F7-D45D-4E0F-94B8-B2B2AAF617E8","type":"standard","color":"C7875B40-FDC3-4744-9751-7CE84A1B2E09","roughness":"0258A1EC-DF7B-4ED9-BEEF-25EA8F789974","metalness":"6D88A5A9-665F-436E-A236-79D6074B3F3C","alpha":"82650CAF-556B-475A-B6F1-7970AD0BD387","reflectivity":"0E9CA7ED-22DA-4BC0-A42E-345FEE70AEE8","shadingAlpha":"D799B087-FEB4-495D-915A-9BB255F1B745","shadingBlend":"C61C9594-320B-4248-B181-D944590510A1","nodeType":"Standard"},{"uuid":"82650CAF-556B-475A-B6F1-7970AD0BD387","type":"f","value":1,"nodeType":"Float"},{"uuid":"C0A2AA84-2D3C-43A6-9401-ACE89E7A1D01","type":"f","value":1,"nodeType":"Float"},{"uuid":"233A9CFB-6E9E-42CD-B9E9-908A125DD4CE","type":"i","value":0,"nodeType":"Int"},{"uuid":"A21C5A15-6C30-47ED-A49E-D4AA61069276","type":"f","value":30,"nodeType":"Float"},{"uuid":"CFE287DB-00A0-412D-A971-BB424138ED4F","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"8E9A064A-D472-4E6F-8190-3A055B4CB344","type":"f","value":10,"nodeType":"Float"},{"uuid":"3A96255C-4F9B-48B0-9E8D-FA23F7EC4BEF","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F13E4CB4-D2DB-40B2-983C-874AEFD21B80","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B9E36D16-C9BA-47F3-96CC-CFEE58A06931","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"776CADE3-BD21-420C-8BD7-2D4A7C7C4078","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"807EF072-2E03-409D-94C2-82C516E7A7D3","type":"f","value":1,"nodeType":"Float"},{"uuid":"8A89F1D3-CB12-4765-9CE5-39380379FFDF","type":"i","value":0,"nodeType":"Int"},{"uuid":"B4B666BD-E5E5-4D91-9C31-CC82F4B08669","type":"f","value":50,"nodeType":"Float"},{"uuid":"2E7EF4FC-4C7B-4533-AA57-F15A55101943","type":"f","value":118,"nodeType":"Float"},{"uuid":"3DF27407-96F8-4D0F-829F-E0E93E226BF9","type":"f","value":1,"nodeType":"Float"},{"uuid":"5DD7DDBF-4DFD-47E1-8038-737E078B351C","type":"f","value":0,"nodeType":"Float"},{"uuid":"4CD7EFC4-81DB-4E18-A4E1-352E0021C2B6","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"35670302-430E-4495-A6EA-59C4FE3122AE","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"0CCE096C-CD85-4825-9512-9563FEC70CB9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"3D1CAEC5-B6D9-45A7-A66C-F451EE4EB081","type":"f","value":1,"nodeType":"Float"},{"uuid":"6267F202-E60F-4894-8B22-949035C3309E","type":"i","value":2,"nodeType":"Int"},{"uuid":"51C04126-9C78-41F6-A794-E0C45727279E","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"A8E1A38E-B53B-46CB-8252-E1240290AAEE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F4669BB0-464A-427D-845F-550F94AD86B8","type":"f","value":1,"nodeType":"Float"},{"uuid":"0B9DC131-A1FF-4B59-9DFF-ECA674A54B45","type":"f","value":2,"nodeType":"Float"},{"uuid":"9F6690B3-5B46-4FDB-ADEB-60BE7A9C1B58","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"6B741CD0-54D9-4722-92B7-D43B3E380706","type":"f","value":1,"nodeType":"Float"},{"uuid":"EB9EC14B-C7EE-452E-976C-160EE9DB02D5","type":"i","value":2,"nodeType":"Int"},{"uuid":"B0466183-ACD9-4580-B8EF-43FFB282AB26","type":"f","value":1,"nodeType":"Float"},{"uuid":"62A636E8-F312-40B4-8056-3A7C000A5EC8","type":"i","value":0,"nodeType":"Int"},{"uuid":"67B1B407-D4F3-4625-BAE1-809FE4B061C8","type":"f","value":30,"nodeType":"Float"},{"uuid":"B4D6C10D-2CCD-4553-B6CD-AAA5FC257808","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"12655624-DE63-45C3-B2F2-AF9EDD142B32","type":"f","value":10,"nodeType":"Float"},{"uuid":"D4E637C6-32C4-44ED-9876-BF272BB9335C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"8F139FB3-FDE1-4D11-8B4A-D4C4E3A6C6A7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"BA25A6BE-62E4-4028-A7E7-7945379792F6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A5B19FE4-02D1-4B9E-BEDB-9F854CDB65BD","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"8B05A9FE-BB1C-451E-9865-A52CB0B121EA","type":"f","value":1,"nodeType":"Float"},{"uuid":"1FC8DED6-8B26-4B79-9C72-8E81C7C7761B","type":"i","value":0,"nodeType":"Int"},{"uuid":"133CE290-555D-4021-98F5-EF7D3C70A542","type":"f","value":50,"nodeType":"Float"},{"uuid":"F5CAA045-C490-4865-B0B6-9A38EFCFFAA5","type":"f","value":118,"nodeType":"Float"},{"uuid":"5CC34833-08D2-4C92-8A50-06E4EFC63C01","type":"f","value":1,"nodeType":"Float"},{"uuid":"572C15C9-C638-48AB-886C-E106E53038DE","type":"f","value":0,"nodeType":"Float"},{"uuid":"555027F2-ECEE-485A-8AB7-112D351F8FEC","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"8FB90206-0177-4B6A-9861-7580FC055514","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"967DA95F-0B27-4BCD-9038-D59A9A6FDA9A","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"01C09800-C118-4FFB-8FEE-C1D379166314","type":"f","value":1,"nodeType":"Float"},{"uuid":"84F99C05-1E2E-4A1E-A7B1-CD88100EE39E","type":"i","value":2,"nodeType":"Int"},{"uuid":"5A6591BB-7829-4199-ACBC-185496402786","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"27BECCC1-494F-4CE3-A5DF-FEB15503F4F9","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"816FFA88-9A28-453C-8247-3B7595AD4A82","type":"f","value":1,"nodeType":"Float"},{"uuid":"931B663D-06E0-4DBC-ADDA-E0D61EDA3A65","type":"f","value":2,"nodeType":"Float"},{"uuid":"DA1D99F5-0F94-4FAF-B1E2-FF623C4EE6D3","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"69983C84-317A-4D4F-98B1-5307A34F629A","type":"f","value":1,"nodeType":"Float"},{"uuid":"A20F4F4C-3495-444C-8723-79842D7BAA5E","type":"i","value":2,"nodeType":"Int"},{"uuid":"B567DA9C-F981-453E-BBD1-CD3F42ABA4A0","type":"f","value":1,"nodeType":"Float"},{"uuid":"E10457EE-AE9A-4919-9AD0-399A4EB863A4","type":"i","value":0,"nodeType":"Int"},{"uuid":"E48477BD-6849-4C3A-A72C-F9F380F57809","type":"f","value":30,"nodeType":"Float"},{"uuid":"2D66F1ED-CB0F-4201-B1DB-A655CDFED233","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"22AFD2F7-BE2B-4D1B-9B03-454124703F48","type":"f","value":10,"nodeType":"Float"},{"uuid":"B5A981D3-6F54-4DA3-8E49-87976C074B82","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"16F1B09E-881B-4FD8-A791-33B250B2F942","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C237AC5B-6976-4891-B448-7DB052C86E08","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"C9A457DD-4CA0-45F3-87C9-3B8D06CAEE7D","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"BCE9832E-0278-4452-ADBC-7B6AD8CA3D54","project":false,"nodeType":"Texture"},{"uuid":"BCE9832E-0278-4452-ADBC-7B6AD8CA3D54","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5F61A991-59A5-4A69-92D5-BD71F5CA7562","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"28F28407-B48F-44BF-8BE9-AF3ECD4AE4E6","project":false,"nodeType":"Texture"},{"uuid":"28F28407-B48F-44BF-8BE9-AF3ECD4AE4E6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"7255CC61-EBEC-43F1-9393-7719745F2C52","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"FF63B2B4-59E7-4C4B-8ACD-155A2BB57384","type":"f","value":1,"nodeType":"Float"},{"uuid":"A47E475B-1B2E-49ED-B00D-512E66EA58F0","type":"i","value":0,"nodeType":"Int"},{"uuid":"36E57C84-6C36-4259-B2C6-41844F42B9F5","type":"f","value":50,"nodeType":"Float"},{"uuid":"89FB03B5-7E97-4AFF-9FE7-1DDAA1803974","type":"f","value":118,"nodeType":"Float"},{"uuid":"6CEF2A18-F449-4B96-94E4-1884E2979EE3","type":"f","value":1,"nodeType":"Float"},{"uuid":"4487B2C6-A00F-4378-A6FB-AF6D190A3F19","type":"f","value":0,"nodeType":"Float"},{"uuid":"28CE1160-A55F-4EAA-9679-02412471D079","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"E064FE48-4D83-4397-B845-4B63CB8B4A11","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"F2314A8B-2B06-4C8C-8D96-FE2160A1841D","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"21BD2AAD-D6EF-445B-976C-269DB754C09A","type":"f","value":1,"nodeType":"Float"},{"uuid":"1E2ED708-C4DC-4EF0-B495-7742F869F74E","type":"i","value":2,"nodeType":"Int"},{"uuid":"EFF4DF44-381E-4EC3-B3B8-D1DEE7C938E9","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"E2E69446-F67A-41D4-A9EC-C7E7323AB92A","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"348097D7-6398-45CF-ABC3-C4AED70A130A","type":"f","value":1,"nodeType":"Float"},{"uuid":"4AB84981-F846-4EF7-A724-3D4599FAE7FF","type":"f","value":2,"nodeType":"Float"},{"uuid":"7E09CBC7-F95B-45DF-AD02-F46E81852770","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"6026E22E-E7C0-452D-A52C-965095B9C1B6","type":"f","value":1,"nodeType":"Float"},{"uuid":"55FC15CD-AF70-472C-A812-D2D5877049BA","type":"i","value":2,"nodeType":"Int"},{"uuid":"C97B84A1-A0F5-4A52-9266-32DAF8511774","type":"phong","color":"0FF9F083-F567-4049-B2D9-687359834097","specular":"2D66F1ED-CB0F-4201-B1DB-A655CDFED233","shininess":"E48477BD-6849-4C3A-A72C-F9F380F57809","shadingAlpha":"B567DA9C-F981-453E-BBD1-CD3F42ABA4A0","shadingBlend":"E10457EE-AE9A-4919-9AD0-399A4EB863A4","afterColor":"F92DBB09-853C-4AA0-9E1B-E6064ED3D701","alpha":"1C2CC6DA-CF10-4E41-870A-74BF6191724E","nodeType":"Phong"},{"uuid":"0FF9F083-F567-4049-B2D9-687359834097","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"F92DBB09-853C-4AA0-9E1B-E6064ED3D701","type":"v3","a":"F75309D9-C0CC-4341-8FCD-871F68F19AEA","b":"F1386F17-9C02-4BE3-AD14-97C323139EB1","alpha":"E1A4F602-0CE8-43B5-BCF8-6389B8401760","mode":"55FC15CD-AF70-472C-A812-D2D5877049BA","nodeType":"Blend"},{"uuid":"F75309D9-C0CC-4341-8FCD-871F68F19AEA","type":"v3","a":"8535F448-3696-4688-B3EE-CCDA54D92AF8","b":"AA5ED77A-1D68-47FC-A85B-C9126E310859","alpha":"9AC2C841-930E-4145-84AF-21A6D4B84689","mode":"1E2ED708-C4DC-4EF0-B495-7742F869F74E","nodeType":"Blend"},{"uuid":"8535F448-3696-4688-B3EE-CCDA54D92AF8","type":"v3","a":"F37DA72D-6ABB-43A8-A99F-A95144C6BCDB","b":"AFDC4586-58E7-4AAE-B982-98343F1F0205","alpha":"49AE4415-2464-4802-8C83-AAB115DEB5B8","mode":"A47E475B-1B2E-49ED-B00D-512E66EA58F0","nodeType":"Blend"},{"uuid":"F37DA72D-6ABB-43A8-A99F-A95144C6BCDB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AFDC4586-58E7-4AAE-B982-98343F1F0205","type":"v3","thickness":"22AFD2F7-BE2B-4D1B-9B03-454124703F48","ior":"B5A981D3-6F54-4DA3-8E49-87976C074B82","roughness":"16F1B09E-881B-4FD8-A791-33B250B2F942","alpha":"FF63B2B4-59E7-4C4B-8ACD-155A2BB57384","calpha":"gAFDC458658E74AAEB98298343F1F0205_calpha","nodeType":"Transmission"},{"uuid":"49AE4415-2464-4802-8C83-AAB115DEB5B8","type":"f","src":"gAFDC458658E74AAEB98298343F1F0205_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AA5ED77A-1D68-47FC-A85B-C9126E310859","type":"v3","near":"36E57C84-6C36-4259-B2C6-41844F42B9F5","far":"89FB03B5-7E97-4AFF-9FE7-1DDAA1803974","isVector":"6CEF2A18-F449-4B96-94E4-1884E2979EE3","isWorldSpace":"4487B2C6-A00F-4378-A6FB-AF6D190A3F19","origin":"28CE1160-A55F-4EAA-9679-02412471D079","colorA":"E064FE48-4D83-4397-B845-4B63CB8B4A11","colorB":"F2314A8B-2B06-4C8C-8D96-FE2160A1841D","alpha":"21BD2AAD-D6EF-445B-976C-269DB754C09A","nodeType":"Depth"},{"uuid":"9AC2C841-930E-4145-84AF-21A6D4B84689","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"21BD2AAD-D6EF-445B-976C-269DB754C09A"},"nodeType":"Expression"},{"uuid":"F1386F17-9C02-4BE3-AD14-97C323139EB1","type":"v3","color":"EFF4DF44-381E-4EC3-B3B8-D1DEE7C938E9","bias":"E2E69446-F67A-41D4-A9EC-C7E7323AB92A","scale":"348097D7-6398-45CF-ABC3-C4AED70A130A","intensity":"4AB84981-F846-4EF7-A724-3D4599FAE7FF","factor":"7E09CBC7-F95B-45DF-AD02-F46E81852770","alpha":"6026E22E-E7C0-452D-A52C-965095B9C1B6","mode":"55FC15CD-AF70-472C-A812-D2D5877049BA","calpha":"gF1386F179C024BE3AD1497C323139EB1_calpha","nodeType":"Fresnel"},{"uuid":"E1A4F602-0CE8-43B5-BCF8-6389B8401760","type":"f","src":"gF1386F179C024BE3AD1497C323139EB1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1C2CC6DA-CF10-4E41-870A-74BF6191724E","type":"f","value":1,"nodeType":"Float"},{"uuid":"23CB8655-8879-40C2-A874-0CE3F840678D","type":"f","value":1,"nodeType":"Float"},{"uuid":"BF5A0CA5-90C6-4A60-9515-CD2FEA140F3A","type":"i","value":0,"nodeType":"Int"},{"uuid":"0B967110-6EEE-431D-8255-88CCB749060A","type":"f","value":30,"nodeType":"Float"},{"uuid":"E75B3A35-4BC8-451A-B749-FFB398C4DDE5","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"55201A7D-F657-4063-97B4-BC7259E7C1BD","type":"f","value":10,"nodeType":"Float"},{"uuid":"338C24D5-D670-4403-85A2-8DB5A6E96D65","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A049D100-EE87-4292-B62A-29E9E822BC0F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"42350647-B070-4510-9002-A83F4F768F08","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"35FD02AC-0382-42A6-8075-2EEAF32171B5","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4E0CED78-6FF6-49F5-80E4-EDCD5C6B2B96","type":"f","value":1,"nodeType":"Float"},{"uuid":"38348C47-322B-4C48-B47F-D9B556804AD6","type":"i","value":0,"nodeType":"Int"},{"uuid":"50A4C54B-B46A-48C7-A547-CA5F92BB7C51","type":"f","value":50,"nodeType":"Float"},{"uuid":"7DE794B1-FA9B-411D-A614-80DF2CEB0D54","type":"f","value":168,"nodeType":"Float"},{"uuid":"2D3AC59C-4BC7-496E-B591-E64805BF61A5","type":"f","value":1,"nodeType":"Float"},{"uuid":"2526BCFE-D748-4730-B04C-62D69979802A","type":"f","value":0,"nodeType":"Float"},{"uuid":"F63B9107-5DB4-4C03-87EE-5B60ECC0F915","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"23987864-DA91-499C-8ADD-F77DC8F8BF4C","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"297ED369-6918-4311-A28C-3969E7C6230B","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"35C958F9-7587-4848-9D6D-431F9ED29D18","type":"f","value":1,"nodeType":"Float"},{"uuid":"75A4133D-7613-409E-BA3E-74DE4D1BEAE7","type":"i","value":2,"nodeType":"Int"},{"uuid":"77240702-3151-447D-B477-8DE5CA7BD17D","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"5670DFB3-0A4E-46CB-BACB-DDE5ADCB42F9","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"597E7330-574F-4465-92D2-2C5C64F8680B","type":"f","value":1,"nodeType":"Float"},{"uuid":"7CDB93E9-8FDD-4925-B167-5B3438E4250D","type":"f","value":2,"nodeType":"Float"},{"uuid":"0D2F97BF-DB41-4C5C-93E0-28C9EBC72F60","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"7551B413-79FE-474F-A5D2-D06FC7B1B7C4","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE550D74-26B5-4923-BD0D-FCA85E6F7024","type":"i","value":2,"nodeType":"Int"},{"uuid":"428632AD-3E68-4896-81EC-D57BE282759C","type":"f","value":1,"nodeType":"Float"},{"uuid":"4527B844-EF73-482F-BC3D-5DD57F9DD545","type":"i","value":0,"nodeType":"Int"},{"uuid":"FA3C26ED-BC79-4E76-AAF4-21EE59C93F34","type":"f","value":30,"nodeType":"Float"},{"uuid":"98719716-99CA-436E-8324-D35AF3347D4D","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"49C25C33-25E1-44ED-91F5-A4362F76E4C3","type":"f","value":10,"nodeType":"Float"},{"uuid":"799DB449-170A-4386-B03B-8477336F6C3A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0E7CF544-3E4A-4261-AD08-F413FC61978C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CD3C28F8-2D74-4F62-A3D6-7AE82B01CC1F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"039D6F76-95F5-45A3-91D8-59DCF9E3D183","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"6EC0F668-086C-46EF-9D3D-F2096A0EA5D3","type":"f","value":1,"nodeType":"Float"},{"uuid":"62DB3E6B-DFAC-4FC8-926B-850A364CD7D9","type":"i","value":0,"nodeType":"Int"},{"uuid":"633E50E1-EEF9-4ACF-9E89-06E1436F088C","type":"f","value":50,"nodeType":"Float"},{"uuid":"1FD339FD-0785-44F5-8704-C26BA8F23ECA","type":"f","value":168,"nodeType":"Float"},{"uuid":"8F7A8DE9-0AA0-4C26-87C8-12CBD0340D85","type":"f","value":1,"nodeType":"Float"},{"uuid":"B25FA297-8CC3-42D4-AF30-7C14C9B98924","type":"f","value":0,"nodeType":"Float"},{"uuid":"E504FE43-0A90-4962-9A78-A96C14D2AF04","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A586F83A-97DB-4CF2-9D3E-5EA670C43B6C","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"878A5E8E-E90A-4197-8F7F-19D14067E0E6","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"9548F07C-6861-412E-8481-46B0D8D33272","type":"f","value":1,"nodeType":"Float"},{"uuid":"B59A4799-C2E6-4F8A-9298-A91A778DA82B","type":"i","value":2,"nodeType":"Int"},{"uuid":"BEF1BFEE-BCF9-431B-94AC-5CBF5E2D350B","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"22F55725-6E24-4219-9B1C-D931C53637CB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C52F90CD-9A79-49CB-87CC-4865B41CCEF4","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D1F681F-D693-4D00-A0DB-178F93094146","type":"f","value":2,"nodeType":"Float"},{"uuid":"8E8B0B0E-B1A2-4C10-8215-199FEC7264F9","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"F1D0DF1E-CB5C-4282-ACD3-346A19BA74E5","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E722988-ABAB-49BB-8A7B-9AB6E4A743FF","type":"i","value":2,"nodeType":"Int"},{"uuid":"E00AB7FA-54E0-40F3-A334-DF7BA15FBB59","type":"f","value":1,"nodeType":"Float"},{"uuid":"D09CE24A-DF83-43E3-AE6C-489E5BF768D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"CAE5EFC3-BE2C-4779-A723-7B6E454E3335","type":"f","value":30,"nodeType":"Float"},{"uuid":"F88523A7-185A-459E-A030-F229257E82A5","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"403ECCAC-F880-4075-AB20-1F8CE7B18D0A","type":"f","value":10,"nodeType":"Float"},{"uuid":"173AA08A-4C3B-4C26-9C00-9BA26CF87DB2","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"FD525C6E-BC0B-4A02-8953-F2C818A03BC6","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"E9E01B7A-0614-4FBF-8B24-D1E35FD906EC","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9AABB8C2-C043-40CE-A646-443F1AA3287C","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"6F53511C-E398-4D14-8E2C-2A2F9ACAB576","project":false,"nodeType":"Texture"},{"uuid":"6F53511C-E398-4D14-8E2C-2A2F9ACAB576","type":"v2","index":0,"nodeType":"UV"},{"uuid":"F3324220-C688-4735-91D0-5C3DE3843079","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"3EF8ED5B-352D-47B9-A5C5-C57007702DCD","project":false,"nodeType":"Texture"},{"uuid":"3EF8ED5B-352D-47B9-A5C5-C57007702DCD","type":"v2","index":0,"nodeType":"UV"},{"uuid":"D4A274D7-324F-4683-9A6E-C7794CCB655C","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"5E84EC0A-7CC5-49E8-A5CA-A8B14DA2C87E","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA9EE373-1ADF-420D-9A41-A5B3C75403DA","type":"i","value":0,"nodeType":"Int"},{"uuid":"78665D6C-08DD-4FF3-8869-1E7B3A55B015","type":"f","value":50,"nodeType":"Float"},{"uuid":"ABD150BB-9C45-4A60-B5CD-6D01C7551382","type":"f","value":168,"nodeType":"Float"},{"uuid":"64112331-4AD7-4316-AB4D-78916123F637","type":"f","value":1,"nodeType":"Float"},{"uuid":"EFCA8ADE-0F4F-4861-9132-8AB61B1B2C5A","type":"f","value":0,"nodeType":"Float"},{"uuid":"CBEA7389-2E8A-45C4-981B-3CC1556940AF","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"89EAA588-CB39-4FFA-ADCA-5B443A7006A3","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"6E0F0350-96CD-4838-BA52-E355C663308E","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"DC235A35-0644-40B8-A7CD-F879C1D262A0","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D8D2047-712B-4E5E-A629-2BCABAD894C9","type":"i","value":2,"nodeType":"Int"},{"uuid":"CE18C29F-8532-461E-A54B-8F52A7882C1F","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"E6F704BE-078A-48A2-A2FC-8D4D58932343","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FA68CE73-DF0E-425F-A34D-CCDE2BA41A94","type":"f","value":1,"nodeType":"Float"},{"uuid":"06A28249-2189-424D-B5EE-561EA59F6D80","type":"f","value":2,"nodeType":"Float"},{"uuid":"91700CD7-CEB9-40B0-B53F-8CFCF56393B6","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"61AB44FB-33BA-4154-B902-6BD2FF35B479","type":"f","value":1,"nodeType":"Float"},{"uuid":"AEABAD3D-FF54-4123-964E-0935EE2971E1","type":"i","value":2,"nodeType":"Int"},{"uuid":"9BEEBFF9-03CB-4691-9B2F-47E5F95B6B89","type":"phong","color":"C4D3A091-7A67-464F-9377-CD17D127E0B0","specular":"F88523A7-185A-459E-A030-F229257E82A5","shininess":"CAE5EFC3-BE2C-4779-A723-7B6E454E3335","shadingAlpha":"E00AB7FA-54E0-40F3-A334-DF7BA15FBB59","shadingBlend":"D09CE24A-DF83-43E3-AE6C-489E5BF768D3","afterColor":"D723323B-756E-4F3C-8C87-9AA176AEE2A6","alpha":"2EB1A8E4-3E5E-4AE6-A95D-A0D7E0E2C741","nodeType":"Phong"},{"uuid":"C4D3A091-7A67-464F-9377-CD17D127E0B0","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D723323B-756E-4F3C-8C87-9AA176AEE2A6","type":"v3","a":"E8845F92-F057-41E7-B029-20ED6EECA23D","b":"EE815B23-7B8A-4FFC-B49B-1505CFB3C11E","alpha":"71D7E1A2-5ACD-4F11-97C5-AC7F8739C7AA","mode":"AEABAD3D-FF54-4123-964E-0935EE2971E1","nodeType":"Blend"},{"uuid":"E8845F92-F057-41E7-B029-20ED6EECA23D","type":"v3","a":"F5BA13E0-592C-44D7-B838-A16B62EE3C8D","b":"A1751930-D1C8-4A94-B05B-5B1CE1F78978","alpha":"FC04C97D-25DF-4926-ADBE-E12D8BDD26CD","mode":"3D8D2047-712B-4E5E-A629-2BCABAD894C9","nodeType":"Blend"},{"uuid":"F5BA13E0-592C-44D7-B838-A16B62EE3C8D","type":"v3","a":"25E6AEAE-052A-490E-82F0-95812B6F921A","b":"55719B65-11A5-4893-BD64-58E9559F39D0","alpha":"934764F3-0A96-4C26-8F44-BCDD0F200CF3","mode":"BA9EE373-1ADF-420D-9A41-A5B3C75403DA","nodeType":"Blend"},{"uuid":"25E6AEAE-052A-490E-82F0-95812B6F921A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"55719B65-11A5-4893-BD64-58E9559F39D0","type":"v3","thickness":"403ECCAC-F880-4075-AB20-1F8CE7B18D0A","ior":"173AA08A-4C3B-4C26-9C00-9BA26CF87DB2","roughness":"FD525C6E-BC0B-4A02-8953-F2C818A03BC6","alpha":"5E84EC0A-7CC5-49E8-A5CA-A8B14DA2C87E","calpha":"g55719B6511A54893BD6458E9559F39D0_calpha","nodeType":"Transmission"},{"uuid":"934764F3-0A96-4C26-8F44-BCDD0F200CF3","type":"f","src":"g55719B6511A54893BD6458E9559F39D0_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A1751930-D1C8-4A94-B05B-5B1CE1F78978","type":"v3","near":"78665D6C-08DD-4FF3-8869-1E7B3A55B015","far":"ABD150BB-9C45-4A60-B5CD-6D01C7551382","isVector":"64112331-4AD7-4316-AB4D-78916123F637","isWorldSpace":"EFCA8ADE-0F4F-4861-9132-8AB61B1B2C5A","origin":"CBEA7389-2E8A-45C4-981B-3CC1556940AF","colorA":"89EAA588-CB39-4FFA-ADCA-5B443A7006A3","colorB":"6E0F0350-96CD-4838-BA52-E355C663308E","alpha":"DC235A35-0644-40B8-A7CD-F879C1D262A0","nodeType":"Depth"},{"uuid":"FC04C97D-25DF-4926-ADBE-E12D8BDD26CD","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"DC235A35-0644-40B8-A7CD-F879C1D262A0"},"nodeType":"Expression"},{"uuid":"EE815B23-7B8A-4FFC-B49B-1505CFB3C11E","type":"v3","color":"CE18C29F-8532-461E-A54B-8F52A7882C1F","bias":"E6F704BE-078A-48A2-A2FC-8D4D58932343","scale":"FA68CE73-DF0E-425F-A34D-CCDE2BA41A94","intensity":"06A28249-2189-424D-B5EE-561EA59F6D80","factor":"91700CD7-CEB9-40B0-B53F-8CFCF56393B6","alpha":"61AB44FB-33BA-4154-B902-6BD2FF35B479","mode":"AEABAD3D-FF54-4123-964E-0935EE2971E1","calpha":"gEE815B237B8A4FFCB49B1505CFB3C11E_calpha","nodeType":"Fresnel"},{"uuid":"71D7E1A2-5ACD-4F11-97C5-AC7F8739C7AA","type":"f","src":"gEE815B237B8A4FFCB49B1505CFB3C11E_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2EB1A8E4-3E5E-4AE6-A95D-A0D7E0E2C741","type":"f","value":1,"nodeType":"Float"},{"uuid":"2ABE374D-B591-4F63-9656-5405362CF87D","type":"f","value":1,"nodeType":"Float"},{"uuid":"AAFF39AD-A590-4982-8FB1-2AC780862905","type":"i","value":0,"nodeType":"Int"},{"uuid":"D8A5AD4D-6F16-4811-B9A9-BFE10DDCBDF7","type":"f","value":30,"nodeType":"Float"},{"uuid":"17F8FC1D-93DC-42A0-A2FF-CE2C1904CE81","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"BCAF7273-E35D-4803-B21E-0049A4D5DD98","type":"f","value":10,"nodeType":"Float"},{"uuid":"7639406A-4F5A-4BDA-885E-36F4D45AA344","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"5E1A099F-709F-4663-9A94-E79114A66FF8","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C244CF08-7B85-4E4D-B1F4-447D773BFA8B","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9968B4BB-7D31-4B8F-B62D-54CF9B00880D","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"3B9EE5DC-5422-4BFB-A3F1-7ED521AB38BE","project":false,"nodeType":"Texture"},{"uuid":"3B9EE5DC-5422-4BFB-A3F1-7ED521AB38BE","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B55973B0-0DA0-4208-ABE6-8BCE1FBE36D6","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"7B7EC66D-A678-4F72-ABC3-19C96C3F8D0D","project":false,"nodeType":"Texture"},{"uuid":"7B7EC66D-A678-4F72-ABC3-19C96C3F8D0D","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5A0857E9-16F3-456F-9471-2B0C6F4F96D4","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"6B6ACFEE-F214-4343-805C-CA8DE599D93C","type":"f","value":1,"nodeType":"Float"},{"uuid":"83FA1124-2B0C-4202-9474-1F2C198375A3","type":"i","value":0,"nodeType":"Int"},{"uuid":"274821BB-B487-4B45-8F16-89F6FB4054CD","type":"f","value":50,"nodeType":"Float"},{"uuid":"44A1B599-EA26-4321-94D1-19126AA8E006","type":"f","value":118,"nodeType":"Float"},{"uuid":"507ABD3C-B169-48E3-9D54-A490D17DD09A","type":"f","value":1,"nodeType":"Float"},{"uuid":"66A63639-E2BF-4A52-90DF-61A3A44633A3","type":"f","value":0,"nodeType":"Float"},{"uuid":"579184AB-0437-4E8A-B033-4FD950F0C57B","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"474A9D86-644D-494F-87BC-6CEDD5B2D5C9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"FD1BE0DB-F8F7-46EE-8451-9C9704AF87FB","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"5936ADB5-9804-48BF-88F5-658ED14CCA59","type":"f","value":1,"nodeType":"Float"},{"uuid":"B53AB88C-8029-4C15-A4BD-8F2B18C0FA32","type":"i","value":2,"nodeType":"Int"},{"uuid":"F4E654E3-BE0D-4F34-BB53-C16A7BB25A63","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"85D6924A-A118-4F78-8BEA-A1573E7FCBB0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DD35BE09-24CF-442B-BD59-D8BD5CA10F38","type":"f","value":1,"nodeType":"Float"},{"uuid":"9321F44F-F091-448F-83B4-9CE206533AEE","type":"f","value":2,"nodeType":"Float"},{"uuid":"AE8568DB-9875-4EF9-AEAC-64351F6D1443","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"2EEE3061-C647-46C1-8494-EBA2C9FB4586","type":"f","value":1,"nodeType":"Float"},{"uuid":"C1D86344-8387-4A03-9121-CECE3C9C88D3","type":"i","value":2,"nodeType":"Int"},{"uuid":"8520BBB9-50EB-4DD5-AF68-A77B0C8B6E67","type":"phong","color":"9EC9DFC0-7202-49FE-8E8A-A839B5C8D89C","specular":"17F8FC1D-93DC-42A0-A2FF-CE2C1904CE81","shininess":"D8A5AD4D-6F16-4811-B9A9-BFE10DDCBDF7","shadingAlpha":"2ABE374D-B591-4F63-9656-5405362CF87D","shadingBlend":"AAFF39AD-A590-4982-8FB1-2AC780862905","afterColor":"C1F80D7C-39A3-4DD1-91D8-F2C437751D89","alpha":"6C4F14BC-F921-4D36-9254-3BC309B6A8F0","nodeType":"Phong"},{"uuid":"9EC9DFC0-7202-49FE-8E8A-A839B5C8D89C","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"C1F80D7C-39A3-4DD1-91D8-F2C437751D89","type":"v3","a":"37F90CC6-1E2F-464D-8E61-642CA3E69F30","b":"BC8FD0C3-400D-47B0-987E-E31FC7833F4C","alpha":"2C8C4991-8F3B-4347-BDE1-036965334F9D","mode":"C1D86344-8387-4A03-9121-CECE3C9C88D3","nodeType":"Blend"},{"uuid":"37F90CC6-1E2F-464D-8E61-642CA3E69F30","type":"v3","a":"2F0ABE83-6C5F-4AC7-BAB8-BC5934AB4D04","b":"D4BF3E4B-9CB0-4DDB-8B49-37154B7D8E68","alpha":"53F29030-96B9-4DC9-8C9D-147FD0B44BDE","mode":"B53AB88C-8029-4C15-A4BD-8F2B18C0FA32","nodeType":"Blend"},{"uuid":"2F0ABE83-6C5F-4AC7-BAB8-BC5934AB4D04","type":"v3","a":"79645468-1B89-489F-A233-346616E046F2","b":"9224AFF8-C7E8-4AA7-934F-1CD55FE3BDC2","alpha":"D72F90FB-64E4-4D0B-8D01-0856DD6CDD33","mode":"83FA1124-2B0C-4202-9474-1F2C198375A3","nodeType":"Blend"},{"uuid":"79645468-1B89-489F-A233-346616E046F2","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9224AFF8-C7E8-4AA7-934F-1CD55FE3BDC2","type":"v3","thickness":"BCAF7273-E35D-4803-B21E-0049A4D5DD98","ior":"7639406A-4F5A-4BDA-885E-36F4D45AA344","roughness":"5E1A099F-709F-4663-9A94-E79114A66FF8","alpha":"6B6ACFEE-F214-4343-805C-CA8DE599D93C","calpha":"g9224AFF8C7E84AA7934F1CD55FE3BDC2_calpha","nodeType":"Transmission"},{"uuid":"D72F90FB-64E4-4D0B-8D01-0856DD6CDD33","type":"f","src":"g9224AFF8C7E84AA7934F1CD55FE3BDC2_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D4BF3E4B-9CB0-4DDB-8B49-37154B7D8E68","type":"v3","near":"274821BB-B487-4B45-8F16-89F6FB4054CD","far":"44A1B599-EA26-4321-94D1-19126AA8E006","isVector":"507ABD3C-B169-48E3-9D54-A490D17DD09A","isWorldSpace":"66A63639-E2BF-4A52-90DF-61A3A44633A3","origin":"579184AB-0437-4E8A-B033-4FD950F0C57B","colorA":"474A9D86-644D-494F-87BC-6CEDD5B2D5C9","colorB":"FD1BE0DB-F8F7-46EE-8451-9C9704AF87FB","alpha":"5936ADB5-9804-48BF-88F5-658ED14CCA59","nodeType":"Depth"},{"uuid":"53F29030-96B9-4DC9-8C9D-147FD0B44BDE","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"5936ADB5-9804-48BF-88F5-658ED14CCA59"},"nodeType":"Expression"},{"uuid":"BC8FD0C3-400D-47B0-987E-E31FC7833F4C","type":"v3","color":"F4E654E3-BE0D-4F34-BB53-C16A7BB25A63","bias":"85D6924A-A118-4F78-8BEA-A1573E7FCBB0","scale":"DD35BE09-24CF-442B-BD59-D8BD5CA10F38","intensity":"9321F44F-F091-448F-83B4-9CE206533AEE","factor":"AE8568DB-9875-4EF9-AEAC-64351F6D1443","alpha":"2EEE3061-C647-46C1-8494-EBA2C9FB4586","mode":"C1D86344-8387-4A03-9121-CECE3C9C88D3","calpha":"gBC8FD0C3400D47B0987EE31FC7833F4C_calpha","nodeType":"Fresnel"},{"uuid":"2C8C4991-8F3B-4347-BDE1-036965334F9D","type":"f","src":"gBC8FD0C3400D47B0987EE31FC7833F4C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6C4F14BC-F921-4D36-9254-3BC309B6A8F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"0793EC50-F08F-41A8-9724-F0D332F25262","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"649BFA03-B69B-46BA-97D8-BA95548CC305","nodeType":"Color"},{"uuid":"649BFA03-B69B-46BA-97D8-BA95548CC305","type":"f","value":1,"nodeType":"Float"},{"uuid":"455B4622-B132-45DB-86C8-379AF25115B8","type":"i","value":0,"nodeType":"Int"},{"uuid":"A3BEEEDA-88A0-420F-A9F8-69A0C4A3A74D","type":"f","value":1,"nodeType":"Float"},{"uuid":"108F6F65-DD6D-4DC6-8EFC-3C84ECD95CB4","type":"i","value":0,"nodeType":"Int"},{"uuid":"FB77B62D-7341-49E8-B3F3-DC7CB085294C","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"67AE7F03-F15B-44B6-80F2-C695083148A7","type":"f","value":0,"nodeType":"Float"},{"uuid":"88C15CF6-045F-43D3-83EA-4A44364A738C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C2B8C630-1FB7-4AA4-B56F-8B6E3BC21ED4","type":"standard","color":"0793EC50-F08F-41A8-9724-F0D332F25262","roughness":"FB77B62D-7341-49E8-B3F3-DC7CB085294C","metalness":"67AE7F03-F15B-44B6-80F2-C695083148A7","alpha":"1B2F6C98-D161-4F1B-B54A-E1F81DD450EC","reflectivity":"88C15CF6-045F-43D3-83EA-4A44364A738C","shadingAlpha":"A3BEEEDA-88A0-420F-A9F8-69A0C4A3A74D","shadingBlend":"108F6F65-DD6D-4DC6-8EFC-3C84ECD95CB4","nodeType":"Standard"},{"uuid":"1B2F6C98-D161-4F1B-B54A-E1F81DD450EC","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[2560,1297],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/icon_light/index.html b/site/spline/design/icon_light/index.html deleted file mode 100644 index 19a8a91aa..000000000 --- a/site/spline/design/icon_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/icon_light/runtime.js b/site/spline/design/icon_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/icon_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQ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zm4CwQ9hWIFgBTK0gQHiIAJddKq0ELQh+KL1qUR4MvSEsoENIKrgALHNiMox+94K7tl9qnnMio8MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/icon_light/scene.json b/site/spline/design/icon_light/scene.json deleted file mode 100644 index 225d73d13..000000000 --- a/site/spline/design/icon_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"D41E2A23-2EB8-49EC-9A12-BE822BE48E78","objectType":"Mesh3D","name":"Cube copy 12","matrix":[0.9063317966392347,-0.00001354807954235401,-0.4225667689456309,0,-0.10935720975744877,0.9659253552104146,-0.2345830531724103,0,0.4081711345437908,0.25882080283098335,0.8754473810270726,0,141.02183525332993,-296.6187429733143,-721.0597147499648,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"interaction":{"uuid":"56D10C51-5733-4D82-9947-BB1F86426ADE","selectedState":0,"states":["AE06BDD2-E0CF-426B-BE04-B4868334EBAC","8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"D41E2A23-2EB8-49EC-9A12-BE822BE48E78","state":"8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6"}]}]},"geometry":"FE756607-4E63-4AE8-A1BF-B31F89294A33","material":"EF4A7DF3-73A6-4601-AED9-6165EEF19B93"},{"uuid":"6AEA82BA-1415-4E85-B12A-D8274F42C085","objectType":"EmptyObject","name":"Empty Object copy","matrix":[0.9622501868990567,-0.017453591614906838,0.27160624063608585,0,0.08418598282936908,0.968088514620299,-0.2360452248093846,0,-0.25881904510252063,0.24999999999999986,0.9330127018922185,0,168.69965599500395,135.95632075884583,-197.92637657361064,1],"layers":1,"children":[{"uuid":"21A87820-888A-4715-A26F-AEE4D5F9471B","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,296.990014827501,56.150706714317494,26.606201283083465,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-297.9010727611103,0,-21.303100641541732,1],"interaction":{"uuid":"0A8413FA-FCE6-419F-9FE6-190A401AA2B5"},"geometry":"7EEB59BA-7971-48C2-B2D6-DB41E40B4071","material":"0890550B-310F-4BDA-83EF-EE53492CBDAD"},{"uuid":"C5E630E5-0E6E-4447-945B-BE68CE484048","objectType":"Mesh2D","name":"Rectangle copy","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,297.9010727611103,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-297.9010727611103,0,-21.303100641541732,1],"interaction":{"uuid":"156FDCAB-3692-4AF8-9793-DF9FE1DBDF96"},"geometry":"44CEDE4D-089D-4BC0-982F-49613B56CEBF","material":"EC093243-E09E-4353-B4A1-D9EA1B18C1B7"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1],"interaction":{"uuid":"40836C02-ACB2-48D1-AD56-1F849A787D18","selectedState":0,"states":["208984AD-68A2-4B5F-984F-D25E0AC0E004","62180D6B-6FBA-4458-8CE6-715559EF9BA1"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6AEA82BA-1415-4E85-B12A-D8274F42C085","state":"62180D6B-6FBA-4458-8CE6-715559EF9BA1"}]}]},"enableHelper":true},{"uuid":"68C97D46-8DDA-4395-9B92-2A9DAED535DF","objectType":"EmptyObject","name":"Empty Object 2","matrix":[0.7251800530091804,3.486235457115772e-17,0.4186828988157972,0,0.17694303891808935,0.7589111429916692,-0.30647433345176817,0,-0.37945557149583503,0.3538860778361794,0.6572363290458711,0,114.72632135694906,-20.522380316571702,-156.39426960988678,1],"layers":1,"children":[{"uuid":"924DAB5F-0F69-4C48-88C4-8313CACC363E","objectType":"Mesh3D","name":"Cylinder","matrix":[1,4.163336342344336e-17,-2.7755575615628907e-17,0,2.775557561562892e-17,2.2204460492503146e-16,1.0000000000000007,0,4.163336342344338e-17,-1.0000000000000004,2.220446049250314e-16,0,-1.4210854715202004e-14,-2.2302414469596096e-14,35.52916395788273,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,1.3877787807814457e-17,0,0,-1.3877787807814457e-17,1,-2.7755575615628914e-17,0,0,2.7755575615628914e-17,1,0,1.4210854715202004e-14,0,-21.76458197894137,0.9999999999999999],"interaction":{"uuid":"59659180-4A77-4131-995A-DA43CD0F6F94"},"geometry":"377A15C6-6F1F-45E7-9E5B-0FAE5DF66567","material":"915FD3AC-7757-4B60-BA30-BFD17D77CF0F"},{"uuid":"7B7CE997-97F8-40F5-A297-BDF3CD754BE1","objectType":"Mesh2D","name":"Rectangle","matrix":[1,-1.3877787807814457e-17,-2.7755575615628914e-17,0,1.387778780781446e-17,1.0000000000000002,1.387778780781447e-17,0,2.7755575615628914e-17,-1.3877787807814466e-17,1,0,-1.5987211554602254e-14,-1.0658141036401503e-14,1.0658141036401503e-14,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,1.3877787807814457e-17,0,0,-1.3877787807814457e-17,1,-2.7755575615628914e-17,0,0,2.7755575615628914e-17,1,0,1.4210854715202004e-14,0,-21.76458197894137,0.9999999999999999],"interaction":{"uuid":"10954B9A-6956-4C4F-BAFE-FCA8F2D2A39E"},"geometry":"A9320118-92ED-4E18-B14B-BCB9B3FE2AFB","material":"A9A11A9D-3208-4E51-AA9A-50B95C68AAC6"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"6AAF9AF7-57F1-4165-993C-128A4B35554A","selectedState":0,"states":["4596904D-B29F-4CBD-A90A-4F84B0F2FB61","61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"68C97D46-8DDA-4395-9B92-2A9DAED535DF","state":"61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA"}]}]},"enableHelper":true},{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.9322951073772445,-6.938893903907228e-18,-0.36169853851025185,0,-0.10178047655012812,0.9595917683126233,-0.2623439970342023,0,0.34708294016514385,0.2813958745018353,0.8946227106773366,0,444.38606073462046,243.0966737275686,868.4452950553914,1],"visible":false,"layers":9,"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000022,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[0.9063077870366525,1.5265566588595947e-16,0.4226182617407008,0,0.21130913087035008,0.8660254037844399,-0.45315389351832575,0,-0.3659981507706667,0.49999999999999983,0.7848855672213952,0,145.26433001757783,109.51028322658746,-44.57193952147844,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["C0E7FD0E-F8A5-43AC-9256-DFEB7453BAFD","5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"A804D79A-F359-4BBE-9882-7D48470A81D5"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[0.6427876096865397,-5.551115123125793e-17,0.76604444311898,0,0.26200263022938497,0.9396926207859075,-0.21984631039295366,0,-0.7198463103929549,0.3420201433256688,0.6040227735550531,0,166.4449569745533,-136.32101579128442,-292.4943118617949,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["D86D5F0D-7A6B-497D-92CB-19F9F7B50F78","B805F286-540C-4923-9DB9-306A8561C88A"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"B805F286-540C-4923-9DB9-306A8561C88A"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"230A302E-951C-48A0-B378-5A974DF60A11"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.039613253960852e-17,0,0,6.039613253960852e-17,1,0,-577.1907485741461,17.353568813240468,1000,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"B67A428C-3219-40AA-8E97-5EC1EDBAC51D","objectType":"EmptyObject","name":"Empty Object","matrix":[0.9063077870366492,-8.326672684688669e-17,-0.4226182617406998,0,-0.1093816549466151,0.9659258262890683,-0.23456971600980445,0,0.4082178936767352,0.2588190451025206,0.8754260980655924,0,-138.165696925378,-13.632103442965462,-157.28079644362225,1],"layers":1,"children":[{"uuid":"3BFFF4B1-9751-469B-AABD-5C4759CB1070","objectType":"Mesh2D","name":"Triangle","matrix":[2.2204460492503195e-16,-1.0000000000000029,0,0,1.0000000000000029,2.2204460492503195e-16,0,0,0,0,1,0,-219.44300360880783,-2.6151466922991817,24.19639750570466,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,225,0,-20.50066360952973,1],"interaction":{"uuid":"E268C046-B449-47EC-A120-B0BBBFB11588"},"geometry":"63190C12-0343-4771-9324-412A23B4BE49","material":"E83E1F09-66DE-4586-BE8F-F110658A6EA5"},{"uuid":"6E67B843-2E8D-467D-A268-474FDD00D55C","objectType":"Mesh2D","name":"Rectangle copy 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-225,0,0,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,225,0,-20.50066360952973,1],"interaction":{"uuid":"0CD8CF15-EFD4-4731-BCD2-5F1AC9C6684E"},"geometry":"84922242-9D7F-4E40-AC3E-6F54D1BF27FD","material":"C1116B4B-4F56-4C1B-A6C2-14435F850FE8"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"8B488D9A-5FEA-46B7-84F8-932FDFBF4E77","selectedState":0,"states":["AA54E20C-9CAC-49D4-8129-6C593B730710","87BFAD8A-9C35-4E54-B093-594677A83229"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"B67A428C-3219-40AA-8E97-5EC1EDBAC51D","state":"87BFAD8A-9C35-4E54-B093-594677A83229"}]}]},"enableHelper":true}],"activeCamera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"FE756607-4E63-4AE8-A1BF-B31F89294A33","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":50,"depth":20},"type":"CubeGeometry"}},{"uuid":"7EEB59BA-7971-48C2-B2D6-DB41E40B4071","userData":{"parameters":{"width":61,"subdivisions":40,"roundness":0,"extrudeDepth":16,"surfaceMaxCount":1855,"extrudeBevelSize":8,"extrudeBevelSegments":3,"height":61,"depth":16},"shape":{"points":[-0.4876749791154644,-5.6019483429302115,-0.4876749791154644,-5.6019483429302115,-0.4876749791154644,-5.6019483429302115,10,-56.59892340558349,-60.25892340558359,-56.59892340558349,-60.25892340558359,-56.59892340558349,-60.25892340558359,200,-32.964911396250386,-60.25892340558359,-32.964911396250386,-60.25892340558359,-32.964911396250386,-60.25892340558359,0,-32.964911396250386,-100.29308038110426,-32.964911396250386,-100.29308038110426,-32.964911396250386,-100.29308038110426,10,32.94000000000002,-100.29308038110426,32.94000000000002,-100.29308038110426,32.94000000000002,-100.29308038110426,10,32.94000000000002,-60.25892340558359,32.94000000000002,-60.25892340558359,32.94000000000002,-60.25892340558359,0,57.95000000000012,-60.25892340558359,57.95000000000012,-60.25892340558359,57.95000000000012,-60.25892340558359,200],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"44CEDE4D-089D-4BC0-982F-49613B56CEBF","userData":{"shape":{"points":[-85,85,-85,85,-85,85,50,85,85,85,85,85,85,50,85,-85,85,-85,85,-85,50,-85,-85,-85,-85,-85,-85,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":170,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":170},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}},{"uuid":"377A15C6-6F1F-45E7-9E5B-0FAE5DF66567","userData":{"parameters":{"width":110,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":8,"cornerSegments":8,"hollow":0.58,"height":16,"depth":110,"radiusTop":55,"radiusBottom":55},"type":"CylinderGeometry"}},{"uuid":"A9320118-92ED-4E18-B14B-BCB9B3FE2AFB","userData":{"shape":{"points":[-90,90,-90,90,-90,90,50,90,90,90,90,90,90,50,90,-90,90,-90,90,-90,50,-90,-90,-90,-90,-90,-90,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":180,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":180},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}},{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":50,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"63190C12-0343-4771-9324-412A23B4BE49","userData":{"shape":{"points":[0,32.5,0,32.5,0,32.5,12,38.5,-32.5,38.5,-32.5,38.5,-32.5,12,-38.5,-32.5,-38.5,-32.5,-38.5,-32.5,12],"shapeHoles":[],"isClosed":true,"roundness":12},"parameters":{"width":77,"depth":16,"spikes":5,"cornerRadius":12,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":5,"isRect":false,"surfaceMaxCount":1000,"height":65},"type":"TriangleGeometry"}},{"uuid":"84922242-9D7F-4E40-AC3E-6F54D1BF27FD","userData":{"shape":{"points":[-75,75,-75,75,-75,75,50,75,75,75,75,75,75,50,75,-75,75,-75,75,-75,50,-75,-75,-75,-75,-75,-75,50],"shapeHoles":[],"isClosed":true,"roundness":50},"parameters":{"width":150,"depth":32,"cornerRadius":[50,50,50,50],"cornerType":1,"extrudeDepth":0,"extrudeBevelSize":8,"extrudeBevelSegments":3,"surfaceMaxCount":1000,"height":150},"ui":{"enabledIndieCorners":false},"type":"RectangleGeometry"}}],"materials":[{"uuid":"EF4A7DF3-73A6-4601-AED9-6165EEF19B93","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"7B9BD91C-4034-4E1F-A7A9-8B97586C15A4","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F60E3CA5-8E9D-4BCA-ACED-10B97F6FD5B3","f1_mode":"169DBE81-E9E4-4846-9348-D38EFD678336","f1_shininess":"36C016C3-7CFB-40BB-AEC6-D64FF300858D","f1_specular":"F3241EB8-E8C7-4EC1-9FC8-4956964F2A5C"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"D8ECEA66-850B-4BF9-AB66-97AAEF012FAB","f2_ior":"0C17C987-0A3C-4929-B496-8B942BAC5AAB","f2_roughness":"68A4B00B-5619-4F0B-961E-2D2B4A48D405","f2_transmissionSamplerSize":"4AEC7B0B-DF79-47E1-94D6-51A080A1B081","f2_transmissionSamplerMap":"E79AE355-29A4-4EC1-8249-BD358279DF35","f2_transmissionDepthMap":"4B5A26AA-F750-4696-8239-2ADD75FE5571","f2_aspectRatio":"5E7E31A2-7007-495A-8407-B61AFC55A3BE","f2_alpha":"50DA4C8C-F9DC-474F-86D7-AC00A8FA7D1B","f2_mode":"865CBA0E-B48D-4954-9AF4-2B37E1536B93"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D4CF1172-4C9B-4221-97AF-48DFEEA91A09","f4_far":"0F7F4A5E-9812-4B1B-915B-A0AD8E6F9771","f4_isVector":"F308CBA5-CBDD-4E31-8BC7-EC11D9E340CD","f4_isWorldSpace":"E48A6EAE-7B40-4E5D-A9A8-55E6B5779E61","f4_origin":"65133935-3342-484D-B43D-2D8287B29B8C","f4_colorA":"C986646A-3AB9-447B-8153-39D1593F3B06","f4_colorB":"AAD29F82-9FE0-4FCB-9C4B-AC878D82100A","f4_alpha":"467E34AE-A4A3-4476-A42F-A0D438847254","f4_mode":"F6B19D7B-EE63-4CD8-A561-5411CE8D222E"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6B084082-6D87-43B9-8B6F-38FDA86FFE90","f3_bias":"E95B3D99-7272-4D30-A129-2B3981898CC8","f3_scale":"BB9B092C-DB9A-468A-9AFE-3BEB86133CA2","f3_intensity":"BACD5F94-E575-4BC5-A6F3-97E29A6DABEA","f3_factor":"641A103A-FE4F-442F-B0D0-EE4DEF71BE95","f3_alpha":"96473B13-4CC7-4720-BA94-F60EE424555C","f3_mode":"DAE6CC3F-AA8F-4BB6-AAEC-E3FC08D85F4E"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"DE67880C-EDDB-4985-92B9-D860E9369FF7","fragment":"DE67880C-EDDB-4985-92B9-D860E9369FF7"},{"uuid":"0890550B-310F-4BDA-83EF-EE53492CBDAD","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"DF263674-C6FB-46FA-B9BD-D432F33D1C31","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8100B6D2-7428-46A5-992B-6BFA2AC8EB4A","f1_mode":"218655A0-5D4D-4D44-ADC9-94126B8C4F63","f1_shininess":"74CFEC5F-18AB-42CF-93D5-427AB4A052EF","f1_specular":"53A2F3BC-05C0-4350-8DC2-7AAB6A0B444E"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"AD826DB2-3435-4A66-B09A-ABCCEB03E55F","f2_ior":"F9545DEE-BAE5-4C6C-B8C4-18DEBF6B016D","f2_roughness":"ED58E7C5-9775-4963-AA6B-A73394A7DB9A","f2_transmissionSamplerSize":"39619135-0794-4EAB-91CB-3B761821C651","f2_transmissionSamplerMap":"4B944302-0677-4DD0-85A9-37104AB95A65","f2_transmissionDepthMap":"E5B1EEB6-5688-48F4-ACD8-7114EF53DA18","f2_aspectRatio":"DB835047-0250-4F17-AC57-9DC6D797663A","f2_alpha":"DF1AD68C-425A-4C97-8883-98D38F5EBC92","f2_mode":"5740DD94-C3C4-4CAA-BEAD-EBC1B6AABE30"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"72321F59-0C6C-49B5-BD5B-3112F285F95E","f4_far":"FD85DCB3-EB96-449B-B31E-4F11B2B8E9D3","f4_isVector":"6A750A77-DC7B-4C4A-B71A-0D266438515E","f4_isWorldSpace":"39C64B65-719E-4003-9C5E-FF28A1E8CD7B","f4_origin":"49C4CF77-6989-4AB8-BFA6-D8B0403A5628","f4_colorA":"A8F633CC-9D8D-442A-9F55-592973641C3A","f4_colorB":"B004734B-31A0-4F68-BC46-5D3D0C0FDBD3","f4_alpha":"B63EE0B5-C1A4-4706-9CAE-94FDBB1DB126","f4_mode":"7AD5B866-AC64-4416-91AB-C5B9F875AB53"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D20579E5-8F6B-4756-8A47-137659143D0C","f3_bias":"D5A50E91-2604-4C8E-AF44-DA28AF0ED7FE","f3_scale":"2FCE39CE-6E22-4407-973B-01221E3B24AA","f3_intensity":"ACFCC2DE-C117-4B95-9DC9-DEA537B91BAC","f3_factor":"1FF04B06-9C9A-49E4-8D12-A5A52AA07254","f3_alpha":"2FC96066-9EA7-44FD-BB3E-D5851CA01576","f3_mode":"6D7C98C4-FA95-4A4F-BABC-3CB6CF554A1E"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A7777C03-7512-4C44-B2FC-131EB5589C00","fragment":"A7777C03-7512-4C44-B2FC-131EB5589C00"},{"uuid":"EC093243-E09E-4353-B4A1-D9EA1B18C1B7","type":"ShaderMaterial","emissiveIntensity":{"uuid":"4B5A6658-9DEB-441A-B374-8A7BBA9306BC","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"0D333E8C-49AB-439E-8369-2CD0CD58C328","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BE75346A-5990-4B1A-A23C-30616636F548","f0_alpha":"6F938391-BCF3-4207-81ED-5636BD7D79EE","f0_mode":"8FCBA02D-04DE-4023-97E2-7E62521D6DE8"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"45B0DBE7-C4FA-40FA-B2A4-5204867D733D","f1_mode":"1B9C8134-D589-47E2-8B8D-8433838C1293","f1_emissive":"0C1A695A-8975-406D-A994-3863909E9146"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"2E4C9632-4D21-41D3-924F-B64870C867A3","f2_bias":"74CAA2D1-C225-4E93-830B-3EC0F090C22B","f2_scale":"50EE44C3-06F4-48EB-A6F8-515B68514004","f2_intensity":"C37EFD3E-E6DE-4949-A75B-3E8300D655CA","f2_factor":"3BFE9C54-420B-4F3F-9127-24E2C8E07EB9","f2_alpha":"E2A5D3AA-0FA0-4C14-9C40-C8905E15D02B","f2_mode":"82C6F9FA-09A7-4F55-85D7-196C9A324B74"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"313E81F3-8BDE-435A-9055-524110CD5793","fragment":"313E81F3-8BDE-435A-9055-524110CD5793"},{"uuid":"915FD3AC-7757-4B60-BA30-BFD17D77CF0F","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"DF263674-C6FB-46FA-B9BD-D432F33D1C31","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8AA3CC73-07FD-452E-BE8E-5A02DC08B742","f1_mode":"AAD54595-58F8-46FB-824B-7E8F2336D265","f1_shininess":"07D410E3-4132-4D15-97C0-2E9A2C0D1719","f1_specular":"F0D3457B-C4C8-4000-AED5-A802B4972AD1"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"554F5979-EB45-425D-800E-5164B0CD4DE1","f2_ior":"CF553B6D-D1AA-46E5-B4C1-A7726D2A7CA1","f2_roughness":"01E088D2-08EF-4AF7-8687-D6A640E07C71","f2_transmissionSamplerSize":"51C9B87E-26E9-439C-B57B-FB18B1EE7BDD","f2_transmissionSamplerMap":"AEF2DE92-5D24-4160-A3A4-3BE03723601B","f2_transmissionDepthMap":"55DCF4C7-EBE6-4AE2-BC8F-7B9BE0B5F889","f2_aspectRatio":"822A0594-A386-487B-8A92-A7CAAD57ED66","f2_alpha":"349D6036-57D0-4F7B-A597-06DEFA31D758","f2_mode":"F3BD3AF6-D26B-4A25-A804-89E7540854E8"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"2F6556E2-D377-42E3-A757-1AD5C8B5A4D2","f4_far":"ED1EB770-A864-4FF6-AD25-B050091FD822","f4_isVector":"ADF75EA5-DF9F-4E77-B8D8-728E88A863BD","f4_isWorldSpace":"EB3327C5-EFD5-428F-932F-A980D3F7C6E6","f4_origin":"2881CAF2-9FBC-4D5B-ABB2-A79C8B17A602","f4_colorA":"9531F954-B983-438B-900C-48F7B39BF9A5","f4_colorB":"EC129424-B9F5-4D5D-9BC2-3317FA841937","f4_alpha":"8A26AE65-2865-48C6-B696-EA98C6E0443D","f4_mode":"ECDA23D3-757F-4F54-8D17-7241C9223171"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"2BF5E8FC-7A72-4B09-86D9-ADB01F98F48D","f3_bias":"04FFD6BF-FF9A-4EB2-AC81-47FBB3119490","f3_scale":"940F17A1-0151-40B0-97B9-AADD2F7B6EF5","f3_intensity":"812E0468-31C4-4E85-9072-D8A5C7757AC4","f3_factor":"902AB429-E78F-411E-945A-107D82501322","f3_alpha":"4078587F-F0FE-4925-B191-53E3055D7645","f3_mode":"55A20D8D-14D0-45C2-83FE-2C4E1C89AA02"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"97388A41-EE62-40A3-B344-ABB8AE34F04C","fragment":"97388A41-EE62-40A3-B344-ABB8AE34F04C"},{"uuid":"A9A11A9D-3208-4E51-AA9A-50B95C68AAC6","type":"ShaderMaterial","emissiveIntensity":{"uuid":"D89D9745-9B47-44D3-99D7-C51A8346208B","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"0D333E8C-49AB-439E-8369-2CD0CD58C328","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"DC02C5B6-CE70-437D-9305-E761414ED43D","f0_alpha":"F74B77A0-A269-414C-A9B1-B439C71C9716","f0_mode":"C380CF81-EAC1-49A3-9D82-242DCB13166B"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"217F4432-3015-43A3-99D4-6B9D9AAB4BF3","f1_mode":"4415F0CC-8F07-4BF7-8507-5CF8AE9F98D8","f1_emissive":"5576C436-B198-4B6F-AD99-8E8E052FE762"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"2D816D7B-5471-45B3-A3C9-54D4F973BAFC","f2_bias":"9DFA0F66-1DEB-4014-9964-EA3EDA009247","f2_scale":"75B53DC2-99E4-4BC8-ABFB-339FF42966AD","f2_intensity":"314B7FAB-B3ED-47DC-89EF-56D2841E194C","f2_factor":"8DCA7FD9-342B-440F-85E9-47559983AC96","f2_alpha":"C3871F22-268C-44A7-9FD0-F2AAD9E7A2E0","f2_mode":"530F4AE0-23F9-4792-9E7A-1E3D556B3105"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"B9B0B732-0C0D-4F77-899D-6DE05E0C33B8","fragment":"B9B0B732-0C0D-4F77-899D-6DE05E0C33B8"},{"uuid":"A804D79A-F359-4BBE-9882-7D48470A81D5","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"E015A58B-C4CA-43DE-BBF5-8BCB7CC354AB","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5AA70D54-CFE4-41EA-92FD-CE3745A60EFE","f1_mode":"6E39627E-EA0F-4975-8413-27C9B7DE36E7","f1_shininess":"748D6849-5B6F-4955-A157-FDAD5AA8DAD5","f1_specular":"B2C6A021-9792-43B8-B6D6-58A24FEBE5BD"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"FBD191E1-4B03-4DFA-B615-77E0C605EEF9","f2_ior":"36389102-4A0E-40DE-8973-99397415315D","f2_roughness":"A4B963B6-024D-406A-BDCB-81422C3756BE","f2_transmissionSamplerSize":"4D65655A-6D55-4752-9D5D-DDC7F42EF7EF","f2_transmissionSamplerMap":"A0D66F78-C8B5-4573-8ECD-06EC1AB66B92","f2_transmissionDepthMap":"F29A7BA3-2E10-4259-81C7-3D7B173ED629","f2_aspectRatio":"C014419E-EB16-4639-A19C-199638E00CB3","f2_alpha":"3EFDCDBA-DCFA-4C67-8852-DEF965D7F52C","f2_mode":"5367B246-6C58-4489-8A7D-D04AC322CDA1"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C110D377-07AE-4C20-9CA6-6C796838FE6D","f4_far":"13256D9D-55E9-425A-98F2-23CBE583CC63","f4_isVector":"92DC54E1-25EC-4291-91E6-261807C0B68D","f4_isWorldSpace":"93D88CDF-90BD-459A-8839-4CE1BA55ACA6","f4_origin":"3D5DE1D8-8207-4BBF-84AE-4B65B4F5A900","f4_colorA":"FCB1759B-00F6-459B-9F7C-52C762BDE69A","f4_colorB":"98E8E511-2190-449A-BB35-C635C156B2CE","f4_alpha":"4BB55C5D-5FA8-48A3-808D-D53E622F722C","f4_mode":"3D6BE68D-1D70-41AE-B3E8-7279953D311D"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B095B2CD-7D97-451F-B56F-564836C21E4C","f3_bias":"0FAF098C-AA6A-4995-A9CE-BB0DDACDB375","f3_scale":"E5DECD0A-D873-4893-8C37-621F742C65B6","f3_intensity":"E667645A-EC96-4E9A-91D4-07A8B29944EB","f3_factor":"EE063E34-83A3-4D1E-A37B-8AD80EB2D1C1","f3_alpha":"2FAC960E-09AC-42CA-A156-CAF584E8077D","f3_mode":"22198919-CF37-4E83-BAF5-C956D9E2A80F"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"39E11A7E-DFB6-4382-8E1A-6BFB7F6A6746","fragment":"39E11A7E-DFB6-4382-8E1A-6BFB7F6A6746"},{"uuid":"230A302E-951C-48A0-B378-5A974DF60A11","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"5AD8A8EC-06B7-4944-A211-3919F97BD4A0","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4610044B-2888-4D50-8A53-619EA3ECFD9C","f1_mode":"95246B48-5D56-45FB-A1AB-7C23BFF63487","f1_shininess":"CC55209F-D081-4E5F-80B4-898093B36116","f1_specular":"610BE127-6961-4A85-906C-65CA39D48053"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B48467C3-05D5-4012-A1DB-9641A1680C03","f2_ior":"F5C18EB9-62BE-4D8B-85AF-14D134574DC0","f2_roughness":"C92364F4-7BA7-488A-B7DB-5782C20ECC69","f2_transmissionSamplerSize":"19CCDEE6-011C-418E-BEE5-41D72F09AACE","f2_transmissionSamplerMap":"F2997AE0-3A12-4033-A7C2-DC87B880AFE8","f2_transmissionDepthMap":"803FE0BC-0796-4B2E-B5BA-F9A97C3F6539","f2_aspectRatio":"CCCBA1D0-B08D-4E87-8DCB-A2D0519C977E","f2_alpha":"09B23DAB-5858-40F9-A976-444731CAD6A6","f2_mode":"71C3FD9B-DC92-47F6-B31E-731789595F25"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E8D2B6B4-00F5-432A-94AA-02B434CC6F84","f4_far":"D544DC5A-64E2-4BEC-B8CA-25CA74D26A1C","f4_isVector":"43DC1AF4-DE2A-4487-9924-E25E08D99D5D","f4_isWorldSpace":"38A9179F-64DE-45F0-A9DD-FA9BB52C5431","f4_origin":"9027EA62-F987-4FAE-AE40-98BB0FC6A512","f4_colorA":"2F79F83E-AF46-487B-BBD8-B0183D3D4DFC","f4_colorB":"61D6F1D5-907B-4CE1-B91C-4C28ABE3CF1C","f4_alpha":"ABE77AE1-41BC-4CDC-8EC3-C8B813BC8982","f4_mode":"ED417DCD-7F69-478F-9D32-126CAF6DC63B"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"DA6A7767-6C5F-4923-A779-DCD0DD12149C","f3_bias":"7901C7F1-CA98-4B08-84E4-A2DB0BF80ED5","f3_scale":"EBE2B978-E4ED-405F-B6F3-EBDC0D41FF05","f3_intensity":"DEDB8536-90BB-47FB-94B8-18870AFEB879","f3_factor":"16AF2E75-C2C5-4CED-93CD-AE5119BB5D30","f3_alpha":"A9283735-DAB5-46E8-8D4F-8F5A9D270B7D","f3_mode":"38B4B73B-E830-4832-A755-35FD8549350D"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"FEF34DEC-46CB-47B8-96A9-61BFC4576EE5","fragment":"FEF34DEC-46CB-47B8-96A9-61BFC4576EE5"},{"uuid":"E83E1F09-66DE-4586-BE8F-F110658A6EA5","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"DF263674-C6FB-46FA-B9BD-D432F33D1C31","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"58785330-195F-46F6-9AF8-74CB4187BA9C","f1_mode":"8220B616-AE5C-42DD-86F2-CCE8F7E8CC4E","f1_shininess":"3824E690-E278-4BAB-BD34-C7257F9FDA31","f1_specular":"6C8366A2-6F8A-4CAB-AE9F-11FE89542811"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"25B059FC-0E89-466A-87B3-B3553858C923","f2_ior":"C6A5BA95-9802-45FA-9E94-EB40F66B1341","f2_roughness":"D5A7D3EA-116B-4C23-890D-5A4D78057AD2","f2_transmissionSamplerSize":"70036027-0F8F-4C7D-BFD1-A3A5D42BE832","f2_transmissionSamplerMap":"973DAF5C-6A8E-455B-88A3-7DA3C21ABF99","f2_transmissionDepthMap":"A9C1EBE0-0F7E-4EA9-BF3C-2F560438C9FD","f2_aspectRatio":"1E234E3C-5FBD-419C-838B-2141A0A7B30D","f2_alpha":"878E790F-B132-455B-AD5A-3B5FAE356D9A","f2_mode":"086526B7-C449-4D81-AF4E-AA2EF90A38D2"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"87AA9EB3-2EA9-400D-90E3-EA364CA3A49D","f4_far":"C1FDAC4B-5E10-47F9-BB72-19AC5AE0F778","f4_isVector":"ADA93B02-A8DC-412E-B533-F2F7BD1DC507","f4_isWorldSpace":"0DBFCD76-AAD0-4224-900B-8CDA2AD630EB","f4_origin":"F517E8CA-F473-48DB-97A5-FB9DFF402239","f4_colorA":"4962D881-17E8-41B4-AC52-35230AFE8A92","f4_colorB":"70D19E09-062E-4B98-A30F-BE406F11E56F","f4_alpha":"4B517B89-388E-43FA-914B-BFBB31CE4759","f4_mode":"97B95129-5377-49DA-B03A-36CB7D1510AE"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3A00FDC2-F258-4FD1-A9D4-1346148A989D","f3_bias":"6EFD146C-25FA-4BE2-8041-9E2E5F3249FC","f3_scale":"474FED76-6E72-42BD-B236-01F28289938E","f3_intensity":"82D2CC3D-9049-437B-B415-5A9C72A6A2DE","f3_factor":"0EC136C5-3C89-4E85-A40E-8E32BD597769","f3_alpha":"511DBBF2-AA85-494E-80EF-217C1AFD06BF","f3_mode":"4BC21BE5-014D-45DB-AECA-6B290F0609FA"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"E4806741-9C0A-4097-A05B-11068CE6A6D7","fragment":"E4806741-9C0A-4097-A05B-11068CE6A6D7"},{"uuid":"C1116B4B-4F56-4C1B-A6C2-14435F850FE8","type":"ShaderMaterial","emissiveIntensity":{"uuid":"2E0D39D2-5E6B-4446-B7F6-29E8F65DAC55","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"0D333E8C-49AB-439E-8369-2CD0CD58C328","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"F5B9325D-FBB8-4F43-B45A-BC04DE7AAB28","f0_alpha":"EDCC3D5B-C68C-4510-9BD5-D8E5604D2F45","f0_mode":"44A17CF7-CA73-4747-9E43-491F9F12C817"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"EABFB3AC-203B-459F-BDDB-1CACB5A188E8","f1_mode":"D6EC182F-E337-4536-AF77-4BE144592275","f1_emissive":"34322962-A2EF-4992-A472-94C232E126C9"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"91E61A43-E991-497E-B69D-BD86BFC3D027","f2_bias":"7ACCEE9C-D1E5-4952-8570-A1EDAE37B168","f2_scale":"757E3BBE-1B67-4E5B-A9A9-EB111530B641","f2_intensity":"319E4F49-6B7F-47BE-A6A4-3B84216A672A","f2_factor":"9F1E7DFE-283A-46C0-AAEA-F20B61A7937B","f2_alpha":"9C4BA8BE-92B8-4E8C-A5F4-E54018A689C0","f2_mode":"318A6499-FC7B-4AA7-B2E4-7827495F2B24"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"188C0EA7-11B4-468F-8FD4-6F0FC7C53B63","fragment":"188C0EA7-11B4-468F-8FD4-6F0FC7C53B63"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"AE06BDD2-E0CF-426B-BE04-B4868334EBAC","name":"Base State","position":[141.02183525332993,-296.6187429733143,-721.0597147499648],"rotation":[-0.2874557278034662,0.42044981680543386,0.12007865253721106,"XYZ"],"scale":[1.0000000000000018,0.999999999999995,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"geometry":{"width":50,"height":50,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"79E55497-6F19-418C-BD6A-1524698ABA9C","f1_mode":"77C2B184-6562-452A-B48A-A694707E0086","f1_shininess":"711BACAB-6120-4B1D-BDEA-F6A97BDC8A8A","f1_specular":"DF0D58D3-F78A-4D22-BFFB-69F19D883E9C"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CB838788-80ED-40D4-A23D-E4ADDB56F217","f2_ior":"50775312-9BE0-404B-BEEC-7B66C4F6A74F","f2_roughness":"93DACF63-23A6-493D-BD81-E0C0C229741C","f2_transmissionSamplerSize":"F60DB027-9D34-4275-9A1F-48FF255C6C99","f2_aspectRatio":"3414B07C-7616-4EDE-8353-A6601893F232","f2_alpha":"42DCDD73-3E1C-4C5E-9525-78E64C9D841E","f2_mode":"24F41DEA-6F62-4ACC-8B43-6AC34EC787A8"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"10B8D763-00FE-4ECB-8AF7-796DB28B3E7F","f4_far":"C5D15BF1-03CC-4A8C-AE11-C3EA26FE3F75","f4_isVector":"ED87F068-815D-42DC-9BDA-AFD9CF74D662","f4_isWorldSpace":"A57A17E8-A410-4ED8-93D1-89A8B4249D3B","f4_origin":"3C094A0D-4253-4197-BB7E-C2A72DE66226","f4_colorA":"F9DD987C-6576-4B68-B61D-26CF9CFEBFE9","f4_colorB":"28A2CA32-32F1-4842-B5B5-B98BB04FAB11","f4_alpha":"52BD4733-A957-4BF7-8C74-6A829FA21E3A","f4_mode":"AE10C7EF-F1A2-4DAC-BDBF-64BC484D33B4"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6B075ABE-B6E9-45D1-B5BB-6CD5C2EBD0E5","f3_bias":"8DB84E76-D161-457A-ABB1-129975E76D59","f3_scale":"16FF444B-F1D8-4B6A-B444-F51B6E77C2C6","f3_intensity":"24DF954F-5A3A-49A4-80C3-980BF8E13453","f3_factor":"57507173-20BE-4930-8C0C-09651A5C1558","f3_alpha":"9251D1F4-FCDF-4F52-AEEE-CCD154FD4329","f3_mode":"84D31F3A-CDF0-4C75-9294-166635E81809"}}]}},{"uuid":"8EFB7FA8-D6C1-4C4A-9921-BD6F26A182B6","name":"State 1","position":[141.02183525332993,-296.6187429733143,-721.0597147499648],"rotation":[-0.2874557278034662,0.42044981680543386,0.12007865253721106,"XYZ"],"scale":[1.0000000000000018,0.999999999999995,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-366.4449569745533,280.8210157912845,291.0967883977079,1],"geometry":{"width":50,"height":50,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"00E2A6D9-A355-4EBD-9A17-3CC99E7CA83B","f1_mode":"E22BEC03-CCE4-475E-A73C-0E0E0C5AAC56","f1_shininess":"268DD8CB-6F4D-4F2A-B352-CE823BAEC88A","f1_specular":"71DCBC30-2DBB-4C2C-82D5-FE9D072025B5"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5BFDD786-9012-4C7B-97C2-9096240481FF","f2_ior":"CDF2D70F-D862-489C-AE90-49A48448057A","f2_roughness":"9545A014-30F7-44F6-8192-B98364709A47","f2_transmissionSamplerSize":"5D59036B-C279-46CD-AC96-42D0FEA0E762","f2_aspectRatio":"30A9EC2A-F64F-47B3-9030-19B1D7D164E9","f2_alpha":"4F02B37F-6863-4522-BCFE-7003F8D70DDD","f2_mode":"4A84C4FB-84B2-4D64-9B7B-B971BEF35ACA"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"07D1F03F-8E6D-4E32-AA89-1CD8E292F49B","f4_far":"5A7E8C6E-5619-465E-9D24-7E1ECF855BA8","f4_isVector":"BC64F4E8-70CB-49F8-8FE1-8ED8CDC7FAC7","f4_isWorldSpace":"167FDE94-A02E-4003-B4A2-61CDC59FDD2C","f4_origin":"251B9372-D9DC-4832-80AC-5960B264E10B","f4_colorA":"476C7148-68A3-47F7-A29B-5E4E51F52D10","f4_colorB":"4F469E79-112F-42E0-A47F-276B8FCDEB43","f4_alpha":"809D71E8-C4AC-42C9-B290-19B0F1C67D51","f4_mode":"DB4A588F-FD1F-4B20-8683-426CBF540C13"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"35EB17E4-3A9B-426A-BDED-AD71F092BB63","f3_bias":"7DB0D82C-66B1-41FC-A1E1-CB60D8DE80F0","f3_scale":"B9CC09CD-CEEB-41DA-BCF8-4809AD878205","f3_intensity":"50FD62A4-A185-4271-BF3E-83AA5E5FE174","f3_factor":"6063D06E-7496-4020-8693-8AEDFDA0ABB2","f3_alpha":"2DAB7FC8-CAD5-4E9F-B6CF-ACCC795E266F","f3_mode":"7358769A-19E3-4A78-9A0F-816F26677184"}}]}},{"uuid":"208984AD-68A2-4B5F-984F-D25E0AC0E004","name":"Base State","position":[168.69965599500395,135.95632075884583,-197.92637657361064],"rotation":[-0.26179938779914946,-0.2617993877991495,-0.08726646259971652,"XYZ"],"scale":[0.9999999999999984,0.9999999999999982,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1]},{"uuid":"62180D6B-6FBA-4458-8CE6-715559EF9BA1","name":"State 1","position":[168.69965599500395,135.95632075884583,-197.92637657361064],"rotation":[-0.36207427520465874,-0.3395493729251824,-0.12082205594174805,"XYZ"],"scale":[0.9999999999999984,0.9999999999999982,0.9999999999999992],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-173.54134318402117,-98.34582894110488,196.15275552634117,1]},{"uuid":"4596904D-B29F-4CBD-A90A-4F84B0F2FB61","name":"Base State","position":[114.72632135694906,-20.522380316571702,-156.39426960988678],"rotation":[-0.4939290934384833,-0.4703001772840014,-0.2393225174477351,"XYZ"],"scale":[0.8373657976315947,0.837365797631594,0.8373657976315954],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"61D2D6D4-9F9F-4C65-9930-DB9C263E9AEA","name":"State 1","position":[114.72632135694906,-20.522380316571702,-156.39426960988678],"rotation":[-0.6163023083427105,-0.5311053580547312,-0.3019630117629061,"XYZ"],"scale":[0.8373657976315948,0.8373657976315941,0.8373657976315957],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"C0E7FD0E-F8A5-43AC-9256-DFEB7453BAFD","name":"Base State","position":[145.26433001757783,109.51028322658746,-44.57193952147844],"rotation":[-0.5672073082371434,-0.3747051476082441,-0.22906169065725074,"XYZ"],"scale":[1.0000000000000029,1.0000000000000016,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":50,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6978CF22-0835-495B-BFBC-A0F95CA3C60C","f1_mode":"29BD8F61-E9CE-4619-991D-22D5F0331134","f1_shininess":"18A3A76D-5479-48F3-81ED-835FA3A5837E","f1_specular":"F75D1ADD-95E9-4369-8F46-02DC0EE7FB32"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"FD7B2010-A8DB-45F6-B141-F13ED645D623","f2_ior":"10545415-EB85-42C3-810D-C236CEF42392","f2_roughness":"45F2C887-795A-4829-886E-AF8A303FE43B","f2_transmissionSamplerSize":"1131A739-B208-4A5B-8A8A-DD474D1CFB3B","f2_aspectRatio":"B1DFCCA4-81E3-435F-ADC9-8E2DB4E9FCA8","f2_alpha":"DEEFE66A-1512-47C9-96F4-38E85E8C120E","f2_mode":"688F5252-A8C2-4F08-A370-CA8CF4F0CA25"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D70A1FC5-B3F7-4B39-B743-2D40D4C97893","f4_far":"2BF3AD46-E73E-40A6-85AC-BBC3FCBDD49B","f4_isVector":"B74CD503-902A-46D0-9C48-DDBDDA543A00","f4_isWorldSpace":"003269BD-BA79-4E60-BE53-6D4261C3D892","f4_origin":"ECE60FA6-9CD6-447A-923F-353556C171E4","f4_colorA":"EB078524-D7AB-4B2B-9E78-930091B06863","f4_colorB":"BCD0C83D-9356-4517-A0D8-587A0F137BE5","f4_alpha":"79001FA2-2443-48D5-A5FD-FCE57F1D2B8F","f4_mode":"D74C1401-2810-449A-9452-DCB1FF7CB2AB"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7DD68524-5D73-4721-A50A-A4170B08A933","f3_bias":"BFFF1EC4-255E-46E4-B827-339C85E9DBBB","f3_scale":"1E5379A8-3023-438B-9937-66CE37ACD55E","f3_intensity":"D142BBF9-0985-4722-BAFC-4CC6B8BF5838","f3_factor":"2AA89EEB-C459-4731-B8B9-5D4642E8BA56","f3_alpha":"92555DD9-6CEA-4CB9-83E2-1F4110AA0FF0","f3_mode":"916F1178-EC29-4A7E-8553-88954E647BDA"}}]}},{"uuid":"5EEE9E60-6AC0-448F-A78E-01BBFE0E1D4B","name":"State 1","position":[145.26433001757783,109.51028322658746,-44.57193952147844],"rotation":[-0.5672073082371434,-0.3747051476082441,-0.22906169065725074,"XYZ"],"scale":[1.0000000000000029,1.0000000000000016,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":50,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"170618FC-3E61-4F28-8F66-2BBC490E22B1","f1_mode":"370BD396-7BF9-4B9A-99C0-30205DEA0595","f1_shininess":"CF59355D-EB7B-4F3E-A7D4-2E5773ACEA50","f1_specular":"B8E50BDB-8E1A-4BCC-866C-ED34F2962C81"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"19EB0639-E7D7-454C-BC5F-4EEB14ABED2D","f2_ior":"C9171B22-CBA2-446A-A69B-77BB43DDAA70","f2_roughness":"016B674B-CA6F-41DE-8730-3A91F4D66235","f2_transmissionSamplerSize":"89499160-40E8-4F75-8FE6-9212FAC61E1A","f2_aspectRatio":"62E745B9-7F32-4EE3-A1C2-5B6B3982B194","f2_alpha":"4CA14859-045E-4DCF-AC84-98C00E3A8708","f2_mode":"D341AA21-BB8B-48F7-9C83-A75893BD0466"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4BC74D9B-7A2E-43C0-80DA-EA7B226CB3AA","f4_far":"1B118C5C-6F82-42CE-A200-1983152303C6","f4_isVector":"581A6169-FC28-44D1-8C48-50DE8173E6CE","f4_isWorldSpace":"FDC64B6E-E6B0-40D3-95A0-BC5A9EEF434D","f4_origin":"8FDC0350-BD69-49C3-BD6A-978C6E86B778","f4_colorA":"E8C53600-7DE7-44C7-A38D-80554DF1BB34","f4_colorB":"EED22316-163E-4629-A43C-BF2D217F4794","f4_alpha":"4C77BB1F-8491-4F49-A73B-57E2DE7C1AC4","f4_mode":"4FC6F001-DE48-43AA-B7A8-D4D7869EBB3E"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"74335853-5F29-4BC2-869A-F3F2A3961B61","f3_bias":"69A0F9A6-D83D-4D2B-80AD-FA0DD46C034C","f3_scale":"169B86CA-521E-41AF-9FB1-9F8AF861A6D9","f3_intensity":"6C0C0F65-5D0D-4712-9074-097F1CECD163","f3_factor":"D2584475-A2BF-4DC7-8658-B8911B41B2D8","f3_alpha":"57A41265-7858-4581-BE1D-181BF418D4E0","f3_mode":"238DE969-2710-499D-96A5-797FB2771D3B"}}]}},{"uuid":"D86D5F0D-7A6B-497D-92CB-19F9F7B50F78","name":"Base State","position":[166.4449569745533,-136.32101579128442,-292.4943118617949],"rotation":[-0.515223841716207,-0.8035808813259896,-0.38704408557422565,"XYZ"],"scale":[1.0000000000000018,0.999999999999999,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0DF5CF07-6F18-4647-9AB8-416DAA0CF17F","f1_mode":"3E7D708D-AC03-4324-8E95-B32E7EF5E1B5","f1_shininess":"A9F7714E-FA3E-4386-9387-8461A5293B35","f1_specular":"59C1D3F9-D2FD-4B25-98B4-ADB03DC99C0B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"1D4A7EB4-B30A-41E6-8ADC-ED57E14208C1","f2_ior":"FE4E22E9-434A-4909-8028-47C0651ED5FA","f2_roughness":"95589371-FB10-41F5-B118-A03E9E74BFCD","f2_transmissionSamplerSize":"A8D845A7-6021-42DA-BFA3-159D9BC8DC0A","f2_aspectRatio":"E1DB2E67-8B0A-432B-A182-097CC3485636","f2_alpha":"18583F46-09E0-4F74-A5F1-C9A118B2F2D9","f2_mode":"8D7579BF-1966-416A-810B-23344A78117B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"B7F0B914-0E94-4168-BC5C-B54274D10390","f4_far":"17C95359-E0D3-4439-9E86-184F2815FFE2","f4_isVector":"1E9FFB22-BB37-441D-AA7B-A9EADDEC6298","f4_isWorldSpace":"C669AB91-4E46-412E-87C5-163C203BD282","f4_origin":"37BBC822-58AB-470C-9B5A-350353956AA5","f4_colorA":"45326985-6C10-4816-9709-F5381676A425","f4_colorB":"A59DBDCF-311A-42F3-B385-ED863D63E4EA","f4_alpha":"04DBCEEE-F6E9-4DFF-A788-2E65FEC5FE65","f4_mode":"3B973A9D-9F2F-4D37-9F3D-E765F8149B2E"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4BE54AED-0193-4043-A5C3-9B5C1A4D0492","f3_bias":"F435FA34-0F84-4CAE-A1EA-18CB70A2545D","f3_scale":"43078E37-8BBE-402F-8149-3E3E3321C282","f3_intensity":"2EEBBF2B-1AE8-4FA4-A6E1-9B5C68A050CC","f3_factor":"2CCBBD06-F8AC-4FB6-A90A-2CA4E64B8BE1","f3_alpha":"B1126F1D-0B58-4BFA-B3C6-92BDC5E5D0A5","f3_mode":"9D0ABF56-0F34-40FB-AF7A-D4D543417D8F"}}]}},{"uuid":"B805F286-540C-4923-9DB9-306A8561C88A","name":"State 1","position":[166.4449569745533,-136.32101579128442,-292.4943118617949],"rotation":[-0.515223841716207,-0.8035808813259896,-0.38704408557422565,"XYZ"],"scale":[1.0000000000000018,0.999999999999999,1.0000000000000002],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9F27632F-857E-4DE6-AE40-51FE62A179A9","f1_mode":"7EFC7068-C527-4D23-922D-CCE2276DAB52","f1_shininess":"65B58602-F319-49AA-AE2E-3E9F05D09F37","f1_specular":"4636C98B-5A2D-4011-93C5-15535782A069"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"A373AAE8-900E-4EC9-A159-FBD172222B21","f2_ior":"161658FB-FD6F-4424-BA77-8022E3CD2DF4","f2_roughness":"95427A9C-68A9-41DC-981E-CD2C17005FFC","f2_transmissionSamplerSize":"C5619A33-E81E-49BB-8391-8509F229664B","f2_aspectRatio":"FF2CFDC2-DD2D-4567-BC28-0CDBB4051866","f2_alpha":"92A15474-B932-454E-B477-5FC0870888CA","f2_mode":"1F01CA9A-D87B-49BC-908E-36123D5FFF84"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"447BAC34-F09B-4A48-88FA-4F18A0BE0D00","f4_far":"03FE441A-1DB2-4414-8D4F-FDE9D1005D94","f4_isVector":"81EC423D-6C8F-491F-9694-2329EC342740","f4_isWorldSpace":"86FA8C2A-1633-49E1-B17A-E0F2BDF63E4D","f4_origin":"3C218021-6E54-4A5B-B91F-5AE764BFC60E","f4_colorA":"AF9AA3B1-FEFF-4840-A777-F262268BDAB1","f4_colorB":"D7123BBF-5841-4FA2-9CB3-20B3F1E0A968","f4_alpha":"272AADCF-8268-47E6-979F-D482E4993396","f4_mode":"FCD36DEA-4F0E-4C5B-A236-26C027AA6E88"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"CEB1E5AF-F6A9-44DC-8BE5-1E967B932FF4","f3_bias":"2D6F5AF5-A096-4151-8CAC-0A8217E30758","f3_scale":"07FBE759-6A73-48B4-B76B-103656592329","f3_intensity":"455FC8BD-48F7-4C30-A505-DD5F5BA59CC2","f3_factor":"732A13A7-D58C-4C0F-9971-CC04DC9349E5","f3_alpha":"8B971324-C484-4BA3-A12D-6B37F2AFAE6D","f3_mode":"447130F8-6659-4426-9F00-A02927781D44"}}]}},{"uuid":"AA54E20C-9CAC-49D4-8129-6C593B730710","name":"Base State","position":[-138.165696925378,-13.632103442965462,-157.28079644362225],"rotation":[-0.28746049116178374,0.42050103751990997,0.12010838826100916,"XYZ"],"scale":[0.9999999999999994,1,0.9999999999999996],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"87BFAD8A-9C35-4E54-B093-594677A83229","name":"State 1","position":[-138.165696925378,-13.632103442965462,-157.28079644362225],"rotation":[-0.39778586379970626,0.49413821209522407,0.17270739198835963,"XYZ"],"scale":[0.9999999999999993,1,0.9999999999999994],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}],"nodes":[{"uuid":"79E55497-6F19-418C-BD6A-1524698ABA9C","type":"f","value":1,"nodeType":"Float"},{"uuid":"77C2B184-6562-452A-B48A-A694707E0086","type":"i","value":0,"nodeType":"Int"},{"uuid":"711BACAB-6120-4B1D-BDEA-F6A97BDC8A8A","type":"f","value":30,"nodeType":"Float"},{"uuid":"DF0D58D3-F78A-4D22-BFFB-69F19D883E9C","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"CB838788-80ED-40D4-A23D-E4ADDB56F217","type":"f","value":10,"nodeType":"Float"},{"uuid":"50775312-9BE0-404B-BEEC-7B66C4F6A74F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"93DACF63-23A6-493D-BD81-E0C0C229741C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F60DB027-9D34-4275-9A1F-48FF255C6C99","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"3414B07C-7616-4EDE-8353-A6601893F232","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"42DCDD73-3E1C-4C5E-9525-78E64C9D841E","type":"f","value":1,"nodeType":"Float"},{"uuid":"24F41DEA-6F62-4ACC-8B43-6AC34EC787A8","type":"i","value":0,"nodeType":"Int"},{"uuid":"10B8D763-00FE-4ECB-8AF7-796DB28B3E7F","type":"f","value":50,"nodeType":"Float"},{"uuid":"C5D15BF1-03CC-4A8C-AE11-C3EA26FE3F75","type":"f","value":117,"nodeType":"Float"},{"uuid":"ED87F068-815D-42DC-9BDA-AFD9CF74D662","type":"f","value":1,"nodeType":"Float"},{"uuid":"A57A17E8-A410-4ED8-93D1-89A8B4249D3B","type":"f","value":0,"nodeType":"Float"},{"uuid":"3C094A0D-4253-4197-BB7E-C2A72DE66226","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F9DD987C-6576-4B68-B61D-26CF9CFEBFE9","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"28A2CA32-32F1-4842-B5B5-B98BB04FAB11","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"52BD4733-A957-4BF7-8C74-6A829FA21E3A","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE10C7EF-F1A2-4DAC-BDBF-64BC484D33B4","type":"i","value":1,"nodeType":"Int"},{"uuid":"6B075ABE-B6E9-45D1-B5BB-6CD5C2EBD0E5","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"8DB84E76-D161-457A-ABB1-129975E76D59","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"16FF444B-F1D8-4B6A-B444-F51B6E77C2C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"24DF954F-5A3A-49A4-80C3-980BF8E13453","type":"f","value":2,"nodeType":"Float"},{"uuid":"57507173-20BE-4930-8C0C-09651A5C1558","type":"f","value":1,"nodeType":"Float"},{"uuid":"9251D1F4-FCDF-4F52-AEEE-CCD154FD4329","type":"f","value":1,"nodeType":"Float"},{"uuid":"84D31F3A-CDF0-4C75-9294-166635E81809","type":"i","value":2,"nodeType":"Int"},{"uuid":"00E2A6D9-A355-4EBD-9A17-3CC99E7CA83B","type":"f","value":1,"nodeType":"Float"},{"uuid":"E22BEC03-CCE4-475E-A73C-0E0E0C5AAC56","type":"i","value":0,"nodeType":"Int"},{"uuid":"268DD8CB-6F4D-4F2A-B352-CE823BAEC88A","type":"f","value":30,"nodeType":"Float"},{"uuid":"71DCBC30-2DBB-4C2C-82D5-FE9D072025B5","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"5BFDD786-9012-4C7B-97C2-9096240481FF","type":"f","value":10,"nodeType":"Float"},{"uuid":"CDF2D70F-D862-489C-AE90-49A48448057A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"9545A014-30F7-44F6-8192-B98364709A47","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"5D59036B-C279-46CD-AC96-42D0FEA0E762","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"30A9EC2A-F64F-47B3-9030-19B1D7D164E9","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4F02B37F-6863-4522-BCFE-7003F8D70DDD","type":"f","value":1,"nodeType":"Float"},{"uuid":"4A84C4FB-84B2-4D64-9B7B-B971BEF35ACA","type":"i","value":0,"nodeType":"Int"},{"uuid":"07D1F03F-8E6D-4E32-AA89-1CD8E292F49B","type":"f","value":50,"nodeType":"Float"},{"uuid":"5A7E8C6E-5619-465E-9D24-7E1ECF855BA8","type":"f","value":117,"nodeType":"Float"},{"uuid":"BC64F4E8-70CB-49F8-8FE1-8ED8CDC7FAC7","type":"f","value":1,"nodeType":"Float"},{"uuid":"167FDE94-A02E-4003-B4A2-61CDC59FDD2C","type":"f","value":0,"nodeType":"Float"},{"uuid":"251B9372-D9DC-4832-80AC-5960B264E10B","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"476C7148-68A3-47F7-A29B-5E4E51F52D10","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"4F469E79-112F-42E0-A47F-276B8FCDEB43","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"809D71E8-C4AC-42C9-B290-19B0F1C67D51","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB4A588F-FD1F-4B20-8683-426CBF540C13","type":"i","value":1,"nodeType":"Int"},{"uuid":"35EB17E4-3A9B-426A-BDED-AD71F092BB63","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"7DB0D82C-66B1-41FC-A1E1-CB60D8DE80F0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B9CC09CD-CEEB-41DA-BCF8-4809AD878205","type":"f","value":1,"nodeType":"Float"},{"uuid":"50FD62A4-A185-4271-BF3E-83AA5E5FE174","type":"f","value":2,"nodeType":"Float"},{"uuid":"6063D06E-7496-4020-8693-8AEDFDA0ABB2","type":"f","value":1,"nodeType":"Float"},{"uuid":"2DAB7FC8-CAD5-4E9F-B6CF-ACCC795E266F","type":"f","value":1,"nodeType":"Float"},{"uuid":"7358769A-19E3-4A78-9A0F-816F26677184","type":"i","value":2,"nodeType":"Int"},{"uuid":"F60E3CA5-8E9D-4BCA-ACED-10B97F6FD5B3","type":"f","value":1,"nodeType":"Float"},{"uuid":"169DBE81-E9E4-4846-9348-D38EFD678336","type":"i","value":0,"nodeType":"Int"},{"uuid":"36C016C3-7CFB-40BB-AEC6-D64FF300858D","type":"f","value":30,"nodeType":"Float"},{"uuid":"F3241EB8-E8C7-4EC1-9FC8-4956964F2A5C","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"D8ECEA66-850B-4BF9-AB66-97AAEF012FAB","type":"f","value":10,"nodeType":"Float"},{"uuid":"0C17C987-0A3C-4929-B496-8B942BAC5AAB","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"68A4B00B-5619-4F0B-961E-2D2B4A48D405","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4AEC7B0B-DF79-47E1-94D6-51A080A1B081","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E79AE355-29A4-4EC1-8249-BD358279DF35","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"B0F3C4D8-1B6D-4860-A5B2-15CBD9977847","project":false,"nodeType":"Texture"},{"uuid":"B0F3C4D8-1B6D-4860-A5B2-15CBD9977847","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4B5A26AA-F750-4696-8239-2ADD75FE5571","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"A7942DF8-843C-41CB-B10B-4ACD03142340","project":false,"nodeType":"Texture"},{"uuid":"A7942DF8-843C-41CB-B10B-4ACD03142340","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5E7E31A2-7007-495A-8407-B61AFC55A3BE","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"50DA4C8C-F9DC-474F-86D7-AC00A8FA7D1B","type":"f","value":1,"nodeType":"Float"},{"uuid":"865CBA0E-B48D-4954-9AF4-2B37E1536B93","type":"i","value":0,"nodeType":"Int"},{"uuid":"D4CF1172-4C9B-4221-97AF-48DFEEA91A09","type":"f","value":50,"nodeType":"Float"},{"uuid":"0F7F4A5E-9812-4B1B-915B-A0AD8E6F9771","type":"f","value":117,"nodeType":"Float"},{"uuid":"F308CBA5-CBDD-4E31-8BC7-EC11D9E340CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"E48A6EAE-7B40-4E5D-A9A8-55E6B5779E61","type":"f","value":0,"nodeType":"Float"},{"uuid":"65133935-3342-484D-B43D-2D8287B29B8C","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C986646A-3AB9-447B-8153-39D1593F3B06","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"AAD29F82-9FE0-4FCB-9C4B-AC878D82100A","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"467E34AE-A4A3-4476-A42F-A0D438847254","type":"f","value":1,"nodeType":"Float"},{"uuid":"F6B19D7B-EE63-4CD8-A561-5411CE8D222E","type":"i","value":1,"nodeType":"Int"},{"uuid":"6B084082-6D87-43B9-8B6F-38FDA86FFE90","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"E95B3D99-7272-4D30-A129-2B3981898CC8","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BB9B092C-DB9A-468A-9AFE-3BEB86133CA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"BACD5F94-E575-4BC5-A6F3-97E29A6DABEA","type":"f","value":2,"nodeType":"Float"},{"uuid":"641A103A-FE4F-442F-B0D0-EE4DEF71BE95","type":"f","value":1,"nodeType":"Float"},{"uuid":"96473B13-4CC7-4720-BA94-F60EE424555C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DAE6CC3F-AA8F-4BB6-AAEC-E3FC08D85F4E","type":"i","value":2,"nodeType":"Int"},{"uuid":"DE67880C-EDDB-4985-92B9-D860E9369FF7","type":"phong","color":"BFF87084-BB67-4252-9476-C6BCB9F71532","specular":"F3241EB8-E8C7-4EC1-9FC8-4956964F2A5C","shininess":"36C016C3-7CFB-40BB-AEC6-D64FF300858D","shadingAlpha":"F60E3CA5-8E9D-4BCA-ACED-10B97F6FD5B3","shadingBlend":"169DBE81-E9E4-4846-9348-D38EFD678336","afterColor":"3E3B244F-91FF-43E2-B7E8-67F18940DE57","alpha":"B70AC291-BC20-4CA6-AAF7-F382EED01A53","nodeType":"Phong"},{"uuid":"BFF87084-BB67-4252-9476-C6BCB9F71532","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"3E3B244F-91FF-43E2-B7E8-67F18940DE57","type":"v3","a":"C3D175E9-8FB7-4E17-9306-04B48E217564","b":"58A2259E-4165-4C71-8F68-41E795DF135D","alpha":"04FEC1B8-D1B4-4C8C-AB58-ABCCE109BF43","mode":"DAE6CC3F-AA8F-4BB6-AAEC-E3FC08D85F4E","nodeType":"Blend"},{"uuid":"C3D175E9-8FB7-4E17-9306-04B48E217564","type":"v3","a":"BC78D394-34A9-4465-8707-DD32DD348239","b":"E7D0D00D-3674-4058-B70B-35E90DC4F8B6","alpha":"2E6DBEA8-BDFA-4ED9-8272-05304E21784E","mode":"F6B19D7B-EE63-4CD8-A561-5411CE8D222E","nodeType":"Blend"},{"uuid":"BC78D394-34A9-4465-8707-DD32DD348239","type":"v3","a":"16BAC2B9-AEA6-4450-910A-38A13419546B","b":"04C96F99-8AD4-4AC7-93C8-CA375120E6D9","alpha":"DB4D8B03-C010-49BA-A85E-3ACDEE939580","mode":"865CBA0E-B48D-4954-9AF4-2B37E1536B93","nodeType":"Blend"},{"uuid":"16BAC2B9-AEA6-4450-910A-38A13419546B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"04C96F99-8AD4-4AC7-93C8-CA375120E6D9","type":"v3","thickness":"D8ECEA66-850B-4BF9-AB66-97AAEF012FAB","ior":"0C17C987-0A3C-4929-B496-8B942BAC5AAB","roughness":"68A4B00B-5619-4F0B-961E-2D2B4A48D405","alpha":"50DA4C8C-F9DC-474F-86D7-AC00A8FA7D1B","calpha":"g04C96F998AD44AC793C8CA375120E6D9_calpha","nodeType":"Transmission"},{"uuid":"DB4D8B03-C010-49BA-A85E-3ACDEE939580","type":"f","src":"g04C96F998AD44AC793C8CA375120E6D9_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E7D0D00D-3674-4058-B70B-35E90DC4F8B6","type":"v3","near":"D4CF1172-4C9B-4221-97AF-48DFEEA91A09","far":"0F7F4A5E-9812-4B1B-915B-A0AD8E6F9771","isVector":"F308CBA5-CBDD-4E31-8BC7-EC11D9E340CD","isWorldSpace":"E48A6EAE-7B40-4E5D-A9A8-55E6B5779E61","origin":"65133935-3342-484D-B43D-2D8287B29B8C","colorA":"C986646A-3AB9-447B-8153-39D1593F3B06","colorB":"AAD29F82-9FE0-4FCB-9C4B-AC878D82100A","alpha":"467E34AE-A4A3-4476-A42F-A0D438847254","nodeType":"Depth"},{"uuid":"2E6DBEA8-BDFA-4ED9-8272-05304E21784E","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"467E34AE-A4A3-4476-A42F-A0D438847254"},"nodeType":"Expression"},{"uuid":"58A2259E-4165-4C71-8F68-41E795DF135D","type":"v3","color":"6B084082-6D87-43B9-8B6F-38FDA86FFE90","bias":"E95B3D99-7272-4D30-A129-2B3981898CC8","scale":"BB9B092C-DB9A-468A-9AFE-3BEB86133CA2","intensity":"BACD5F94-E575-4BC5-A6F3-97E29A6DABEA","factor":"641A103A-FE4F-442F-B0D0-EE4DEF71BE95","alpha":"96473B13-4CC7-4720-BA94-F60EE424555C","mode":"DAE6CC3F-AA8F-4BB6-AAEC-E3FC08D85F4E","calpha":"g58A2259E41654C718F6841E795DF135D_calpha","nodeType":"Fresnel"},{"uuid":"04FEC1B8-D1B4-4C8C-AB58-ABCCE109BF43","type":"f","src":"g58A2259E41654C718F6841E795DF135D_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B70AC291-BC20-4CA6-AAF7-F382EED01A53","type":"f","value":1,"nodeType":"Float"},{"uuid":"8100B6D2-7428-46A5-992B-6BFA2AC8EB4A","type":"f","value":1,"nodeType":"Float"},{"uuid":"218655A0-5D4D-4D44-ADC9-94126B8C4F63","type":"i","value":0,"nodeType":"Int"},{"uuid":"74CFEC5F-18AB-42CF-93D5-427AB4A052EF","type":"f","value":30,"nodeType":"Float"},{"uuid":"53A2F3BC-05C0-4350-8DC2-7AAB6A0B444E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"AD826DB2-3435-4A66-B09A-ABCCEB03E55F","type":"f","value":10,"nodeType":"Float"},{"uuid":"F9545DEE-BAE5-4C6C-B8C4-18DEBF6B016D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"ED58E7C5-9775-4963-AA6B-A73394A7DB9A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"39619135-0794-4EAB-91CB-3B761821C651","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"4B944302-0677-4DD0-85A9-37104AB95A65","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"3D0137EA-514D-4327-83BF-0D2CC3BAFB69","project":false,"nodeType":"Texture"},{"uuid":"3D0137EA-514D-4327-83BF-0D2CC3BAFB69","type":"v2","index":0,"nodeType":"UV"},{"uuid":"E5B1EEB6-5688-48F4-ACD8-7114EF53DA18","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"F53787F7-BD99-4E31-BB30-59F830570551","project":false,"nodeType":"Texture"},{"uuid":"F53787F7-BD99-4E31-BB30-59F830570551","type":"v2","index":0,"nodeType":"UV"},{"uuid":"DB835047-0250-4F17-AC57-9DC6D797663A","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"DF1AD68C-425A-4C97-8883-98D38F5EBC92","type":"f","value":1,"nodeType":"Float"},{"uuid":"5740DD94-C3C4-4CAA-BEAD-EBC1B6AABE30","type":"i","value":0,"nodeType":"Int"},{"uuid":"72321F59-0C6C-49B5-BD5B-3112F285F95E","type":"f","value":50,"nodeType":"Float"},{"uuid":"FD85DCB3-EB96-449B-B31E-4F11B2B8E9D3","type":"f","value":145,"nodeType":"Float"},{"uuid":"6A750A77-DC7B-4C4A-B71A-0D266438515E","type":"f","value":1,"nodeType":"Float"},{"uuid":"39C64B65-719E-4003-9C5E-FF28A1E8CD7B","type":"f","value":0,"nodeType":"Float"},{"uuid":"49C4CF77-6989-4AB8-BFA6-D8B0403A5628","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A8F633CC-9D8D-442A-9F55-592973641C3A","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"B004734B-31A0-4F68-BC46-5D3D0C0FDBD3","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"B63EE0B5-C1A4-4706-9CAE-94FDBB1DB126","type":"f","value":1,"nodeType":"Float"},{"uuid":"7AD5B866-AC64-4416-91AB-C5B9F875AB53","type":"i","value":1,"nodeType":"Int"},{"uuid":"D20579E5-8F6B-4756-8A47-137659143D0C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"D5A50E91-2604-4C8E-AF44-DA28AF0ED7FE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2FCE39CE-6E22-4407-973B-01221E3B24AA","type":"f","value":1,"nodeType":"Float"},{"uuid":"ACFCC2DE-C117-4B95-9DC9-DEA537B91BAC","type":"f","value":2,"nodeType":"Float"},{"uuid":"1FF04B06-9C9A-49E4-8D12-A5A52AA07254","type":"f","value":1,"nodeType":"Float"},{"uuid":"2FC96066-9EA7-44FD-BB3E-D5851CA01576","type":"f","value":1,"nodeType":"Float"},{"uuid":"6D7C98C4-FA95-4A4F-BABC-3CB6CF554A1E","type":"i","value":2,"nodeType":"Int"},{"uuid":"A7777C03-7512-4C44-B2FC-131EB5589C00","type":"phong","color":"E5BA6FD8-7F3F-45BA-9F99-16D227B4A97B","specular":"53A2F3BC-05C0-4350-8DC2-7AAB6A0B444E","shininess":"74CFEC5F-18AB-42CF-93D5-427AB4A052EF","shadingAlpha":"8100B6D2-7428-46A5-992B-6BFA2AC8EB4A","shadingBlend":"218655A0-5D4D-4D44-ADC9-94126B8C4F63","afterColor":"D6617CE8-EC31-468D-A49A-53374B9A969F","alpha":"922EDE28-EB65-41C2-9BD6-A9E7F282A05C","nodeType":"Phong"},{"uuid":"E5BA6FD8-7F3F-45BA-9F99-16D227B4A97B","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D6617CE8-EC31-468D-A49A-53374B9A969F","type":"v3","a":"977B0872-758F-4F95-AE58-8B902CD30593","b":"A605CF7B-A497-41B7-B1DD-7914AE933174","alpha":"1A24046D-ECA0-496F-AD06-A6743CCD7685","mode":"6D7C98C4-FA95-4A4F-BABC-3CB6CF554A1E","nodeType":"Blend"},{"uuid":"977B0872-758F-4F95-AE58-8B902CD30593","type":"v3","a":"994061B5-88CC-45DA-9A21-D8E2C8D4F25C","b":"4B7C8518-4B66-4C01-8D72-611FEA65EDEB","alpha":"85D828A9-BB50-4CA4-B2BD-6601B52F743C","mode":"7AD5B866-AC64-4416-91AB-C5B9F875AB53","nodeType":"Blend"},{"uuid":"994061B5-88CC-45DA-9A21-D8E2C8D4F25C","type":"v3","a":"3AB9855A-54B5-4B10-AFF3-28D2D2C3AB2B","b":"5D363B6E-F990-4680-A8E0-EEBACA8CE45F","alpha":"CA235100-C58E-473C-BD6D-A2E306639F5C","mode":"5740DD94-C3C4-4CAA-BEAD-EBC1B6AABE30","nodeType":"Blend"},{"uuid":"3AB9855A-54B5-4B10-AFF3-28D2D2C3AB2B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5D363B6E-F990-4680-A8E0-EEBACA8CE45F","type":"v3","thickness":"AD826DB2-3435-4A66-B09A-ABCCEB03E55F","ior":"F9545DEE-BAE5-4C6C-B8C4-18DEBF6B016D","roughness":"ED58E7C5-9775-4963-AA6B-A73394A7DB9A","alpha":"DF1AD68C-425A-4C97-8883-98D38F5EBC92","calpha":"g5D363B6EF9904680A8E0EEBACA8CE45F_calpha","nodeType":"Transmission"},{"uuid":"CA235100-C58E-473C-BD6D-A2E306639F5C","type":"f","src":"g5D363B6EF9904680A8E0EEBACA8CE45F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4B7C8518-4B66-4C01-8D72-611FEA65EDEB","type":"v3","near":"72321F59-0C6C-49B5-BD5B-3112F285F95E","far":"FD85DCB3-EB96-449B-B31E-4F11B2B8E9D3","isVector":"6A750A77-DC7B-4C4A-B71A-0D266438515E","isWorldSpace":"39C64B65-719E-4003-9C5E-FF28A1E8CD7B","origin":"49C4CF77-6989-4AB8-BFA6-D8B0403A5628","colorA":"A8F633CC-9D8D-442A-9F55-592973641C3A","colorB":"B004734B-31A0-4F68-BC46-5D3D0C0FDBD3","alpha":"B63EE0B5-C1A4-4706-9CAE-94FDBB1DB126","nodeType":"Depth"},{"uuid":"85D828A9-BB50-4CA4-B2BD-6601B52F743C","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"B63EE0B5-C1A4-4706-9CAE-94FDBB1DB126"},"nodeType":"Expression"},{"uuid":"A605CF7B-A497-41B7-B1DD-7914AE933174","type":"v3","color":"D20579E5-8F6B-4756-8A47-137659143D0C","bias":"D5A50E91-2604-4C8E-AF44-DA28AF0ED7FE","scale":"2FCE39CE-6E22-4407-973B-01221E3B24AA","intensity":"ACFCC2DE-C117-4B95-9DC9-DEA537B91BAC","factor":"1FF04B06-9C9A-49E4-8D12-A5A52AA07254","alpha":"2FC96066-9EA7-44FD-BB3E-D5851CA01576","mode":"6D7C98C4-FA95-4A4F-BABC-3CB6CF554A1E","calpha":"gA605CF7BA49741B7B1DD7914AE933174_calpha","nodeType":"Fresnel"},{"uuid":"1A24046D-ECA0-496F-AD06-A6743CCD7685","type":"f","src":"gA605CF7BA49741B7B1DD7914AE933174_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"922EDE28-EB65-41C2-9BD6-A9E7F282A05C","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE75346A-5990-4B1A-A23C-30616636F548","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"6F938391-BCF3-4207-81ED-5636BD7D79EE","nodeType":"Color"},{"uuid":"6F938391-BCF3-4207-81ED-5636BD7D79EE","type":"f","value":1,"nodeType":"Float"},{"uuid":"8FCBA02D-04DE-4023-97E2-7E62521D6DE8","type":"i","value":0,"nodeType":"Int"},{"uuid":"45B0DBE7-C4FA-40FA-B2A4-5204867D733D","type":"f","value":1,"nodeType":"Float"},{"uuid":"1B9C8134-D589-47E2-8B8D-8433838C1293","type":"i","value":0,"nodeType":"Int"},{"uuid":"0C1A695A-8975-406D-A994-3863909E9146","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"2E4C9632-4D21-41D3-924F-B64870C867A3","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"74CAA2D1-C225-4E93-830B-3EC0F090C22B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"50EE44C3-06F4-48EB-A6F8-515B68514004","type":"f","value":1,"nodeType":"Float"},{"uuid":"C37EFD3E-E6DE-4949-A75B-3E8300D655CA","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"3BFE9C54-420B-4F3F-9127-24E2C8E07EB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2A5D3AA-0FA0-4C14-9C40-C8905E15D02B","type":"f","value":1,"nodeType":"Float"},{"uuid":"82C6F9FA-09A7-4F55-85D7-196C9A324B74","type":"i","value":0,"nodeType":"Int"},{"uuid":"313E81F3-8BDE-435A-9055-524110CD5793","type":"lambert","color":"BE75346A-5990-4B1A-A23C-30616636F548","emissiveIntensity":"4B5A6658-9DEB-441A-B374-8A7BBA9306BC","shadingAlpha":"45B0DBE7-C4FA-40FA-B2A4-5204867D733D","shadingBlend":"1B9C8134-D589-47E2-8B8D-8433838C1293","afterColor":"39983ECF-BE60-4793-8077-6C9C3F887F10","alpha":"65A0BE0E-57D0-4731-B27E-1366BD5F5368","emissive":"0C1A695A-8975-406D-A994-3863909E9146","nodeType":"Lambert"},{"uuid":"4B5A6658-9DEB-441A-B374-8A7BBA9306BC","type":"f","value":1,"nodeType":"Float"},{"uuid":"39983ECF-BE60-4793-8077-6C9C3F887F10","type":"v3","a":"5D835EAE-F32F-45A0-BD13-07D1E41C5C03","b":"5CFA6436-49CC-4666-B762-736B90A6E545","alpha":"6FBA4219-EAE8-4A29-838A-B771886B349C","mode":"82C6F9FA-09A7-4F55-85D7-196C9A324B74","nodeType":"Blend"},{"uuid":"5D835EAE-F32F-45A0-BD13-07D1E41C5C03","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5CFA6436-49CC-4666-B762-736B90A6E545","type":"v3","color":"2E4C9632-4D21-41D3-924F-B64870C867A3","bias":"74CAA2D1-C225-4E93-830B-3EC0F090C22B","scale":"50EE44C3-06F4-48EB-A6F8-515B68514004","intensity":"C37EFD3E-E6DE-4949-A75B-3E8300D655CA","factor":"3BFE9C54-420B-4F3F-9127-24E2C8E07EB9","alpha":"E2A5D3AA-0FA0-4C14-9C40-C8905E15D02B","mode":"82C6F9FA-09A7-4F55-85D7-196C9A324B74","calpha":"g5CFA643649CC4666B762736B90A6E545_calpha","nodeType":"Fresnel"},{"uuid":"6FBA4219-EAE8-4A29-838A-B771886B349C","type":"f","src":"g5CFA643649CC4666B762736B90A6E545_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"65A0BE0E-57D0-4731-B27E-1366BD5F5368","type":"f","value":1,"nodeType":"Float"},{"uuid":"8AA3CC73-07FD-452E-BE8E-5A02DC08B742","type":"f","value":1,"nodeType":"Float"},{"uuid":"AAD54595-58F8-46FB-824B-7E8F2336D265","type":"i","value":0,"nodeType":"Int"},{"uuid":"07D410E3-4132-4D15-97C0-2E9A2C0D1719","type":"f","value":30,"nodeType":"Float"},{"uuid":"F0D3457B-C4C8-4000-AED5-A802B4972AD1","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"554F5979-EB45-425D-800E-5164B0CD4DE1","type":"f","value":10,"nodeType":"Float"},{"uuid":"CF553B6D-D1AA-46E5-B4C1-A7726D2A7CA1","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"01E088D2-08EF-4AF7-8687-D6A640E07C71","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"51C9B87E-26E9-439C-B57B-FB18B1EE7BDD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"AEF2DE92-5D24-4160-A3A4-3BE03723601B","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"0238F4FA-4B7D-4B44-81A4-99BF50DF6C53","project":false,"nodeType":"Texture"},{"uuid":"0238F4FA-4B7D-4B44-81A4-99BF50DF6C53","type":"v2","index":0,"nodeType":"UV"},{"uuid":"55DCF4C7-EBE6-4AE2-BC8F-7B9BE0B5F889","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"525D2FBB-C069-4FD2-84C2-096B0D56AEBE","project":false,"nodeType":"Texture"},{"uuid":"525D2FBB-C069-4FD2-84C2-096B0D56AEBE","type":"v2","index":0,"nodeType":"UV"},{"uuid":"822A0594-A386-487B-8A92-A7CAAD57ED66","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"349D6036-57D0-4F7B-A597-06DEFA31D758","type":"f","value":1,"nodeType":"Float"},{"uuid":"F3BD3AF6-D26B-4A25-A804-89E7540854E8","type":"i","value":0,"nodeType":"Int"},{"uuid":"2F6556E2-D377-42E3-A757-1AD5C8B5A4D2","type":"f","value":50,"nodeType":"Float"},{"uuid":"ED1EB770-A864-4FF6-AD25-B050091FD822","type":"f","value":145,"nodeType":"Float"},{"uuid":"ADF75EA5-DF9F-4E77-B8D8-728E88A863BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"EB3327C5-EFD5-428F-932F-A980D3F7C6E6","type":"f","value":0,"nodeType":"Float"},{"uuid":"2881CAF2-9FBC-4D5B-ABB2-A79C8B17A602","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"9531F954-B983-438B-900C-48F7B39BF9A5","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"EC129424-B9F5-4D5D-9BC2-3317FA841937","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"8A26AE65-2865-48C6-B696-EA98C6E0443D","type":"f","value":1,"nodeType":"Float"},{"uuid":"ECDA23D3-757F-4F54-8D17-7241C9223171","type":"i","value":1,"nodeType":"Int"},{"uuid":"2BF5E8FC-7A72-4B09-86D9-ADB01F98F48D","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"04FFD6BF-FF9A-4EB2-AC81-47FBB3119490","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"940F17A1-0151-40B0-97B9-AADD2F7B6EF5","type":"f","value":1,"nodeType":"Float"},{"uuid":"812E0468-31C4-4E85-9072-D8A5C7757AC4","type":"f","value":2,"nodeType":"Float"},{"uuid":"902AB429-E78F-411E-945A-107D82501322","type":"f","value":1,"nodeType":"Float"},{"uuid":"4078587F-F0FE-4925-B191-53E3055D7645","type":"f","value":1,"nodeType":"Float"},{"uuid":"55A20D8D-14D0-45C2-83FE-2C4E1C89AA02","type":"i","value":2,"nodeType":"Int"},{"uuid":"97388A41-EE62-40A3-B344-ABB8AE34F04C","type":"phong","color":"5E6A0EC7-7704-4DDC-AA41-398EA87BCD86","specular":"F0D3457B-C4C8-4000-AED5-A802B4972AD1","shininess":"07D410E3-4132-4D15-97C0-2E9A2C0D1719","shadingAlpha":"8AA3CC73-07FD-452E-BE8E-5A02DC08B742","shadingBlend":"AAD54595-58F8-46FB-824B-7E8F2336D265","afterColor":"E3D8C8D7-584E-4A33-B7AC-11DF91F609A5","alpha":"05F44DBF-06E6-4B51-959A-DCE40B3891B3","nodeType":"Phong"},{"uuid":"5E6A0EC7-7704-4DDC-AA41-398EA87BCD86","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"E3D8C8D7-584E-4A33-B7AC-11DF91F609A5","type":"v3","a":"EA4708D8-46D0-4C3F-BC22-326DC8079FC8","b":"B4DD1296-EADC-4CE1-A291-998630195DFF","alpha":"34985063-5591-4737-8270-F675FF9CAFC2","mode":"55A20D8D-14D0-45C2-83FE-2C4E1C89AA02","nodeType":"Blend"},{"uuid":"EA4708D8-46D0-4C3F-BC22-326DC8079FC8","type":"v3","a":"23CDB0CA-282B-4E11-A4B4-0FE977F26AC4","b":"CC3798EE-FDBF-4C98-BFFE-B7F6028B1FEF","alpha":"56A6681B-FCC3-4E94-9C48-D681379FC089","mode":"ECDA23D3-757F-4F54-8D17-7241C9223171","nodeType":"Blend"},{"uuid":"23CDB0CA-282B-4E11-A4B4-0FE977F26AC4","type":"v3","a":"78C06191-0A31-47E5-8106-F4147B2DA34F","b":"A3732157-5574-4B24-8CB3-37F52B050044","alpha":"9222D6F8-7FA0-4F83-9A92-74361D5F583A","mode":"F3BD3AF6-D26B-4A25-A804-89E7540854E8","nodeType":"Blend"},{"uuid":"78C06191-0A31-47E5-8106-F4147B2DA34F","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A3732157-5574-4B24-8CB3-37F52B050044","type":"v3","thickness":"554F5979-EB45-425D-800E-5164B0CD4DE1","ior":"CF553B6D-D1AA-46E5-B4C1-A7726D2A7CA1","roughness":"01E088D2-08EF-4AF7-8687-D6A640E07C71","alpha":"349D6036-57D0-4F7B-A597-06DEFA31D758","calpha":"gA373215755744B248CB337F52B050044_calpha","nodeType":"Transmission"},{"uuid":"9222D6F8-7FA0-4F83-9A92-74361D5F583A","type":"f","src":"gA373215755744B248CB337F52B050044_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CC3798EE-FDBF-4C98-BFFE-B7F6028B1FEF","type":"v3","near":"2F6556E2-D377-42E3-A757-1AD5C8B5A4D2","far":"ED1EB770-A864-4FF6-AD25-B050091FD822","isVector":"ADF75EA5-DF9F-4E77-B8D8-728E88A863BD","isWorldSpace":"EB3327C5-EFD5-428F-932F-A980D3F7C6E6","origin":"2881CAF2-9FBC-4D5B-ABB2-A79C8B17A602","colorA":"9531F954-B983-438B-900C-48F7B39BF9A5","colorB":"EC129424-B9F5-4D5D-9BC2-3317FA841937","alpha":"8A26AE65-2865-48C6-B696-EA98C6E0443D","nodeType":"Depth"},{"uuid":"56A6681B-FCC3-4E94-9C48-D681379FC089","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"8A26AE65-2865-48C6-B696-EA98C6E0443D"},"nodeType":"Expression"},{"uuid":"B4DD1296-EADC-4CE1-A291-998630195DFF","type":"v3","color":"2BF5E8FC-7A72-4B09-86D9-ADB01F98F48D","bias":"04FFD6BF-FF9A-4EB2-AC81-47FBB3119490","scale":"940F17A1-0151-40B0-97B9-AADD2F7B6EF5","intensity":"812E0468-31C4-4E85-9072-D8A5C7757AC4","factor":"902AB429-E78F-411E-945A-107D82501322","alpha":"4078587F-F0FE-4925-B191-53E3055D7645","mode":"55A20D8D-14D0-45C2-83FE-2C4E1C89AA02","calpha":"gB4DD1296EADC4CE1A291998630195DFF_calpha","nodeType":"Fresnel"},{"uuid":"34985063-5591-4737-8270-F675FF9CAFC2","type":"f","src":"gB4DD1296EADC4CE1A291998630195DFF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"05F44DBF-06E6-4B51-959A-DCE40B3891B3","type":"f","value":1,"nodeType":"Float"},{"uuid":"DC02C5B6-CE70-437D-9305-E761414ED43D","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"F74B77A0-A269-414C-A9B1-B439C71C9716","nodeType":"Color"},{"uuid":"F74B77A0-A269-414C-A9B1-B439C71C9716","type":"f","value":1,"nodeType":"Float"},{"uuid":"C380CF81-EAC1-49A3-9D82-242DCB13166B","type":"i","value":0,"nodeType":"Int"},{"uuid":"217F4432-3015-43A3-99D4-6B9D9AAB4BF3","type":"f","value":1,"nodeType":"Float"},{"uuid":"4415F0CC-8F07-4BF7-8507-5CF8AE9F98D8","type":"i","value":0,"nodeType":"Int"},{"uuid":"5576C436-B198-4B6F-AD99-8E8E052FE762","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"2D816D7B-5471-45B3-A3C9-54D4F973BAFC","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"9DFA0F66-1DEB-4014-9964-EA3EDA009247","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"75B53DC2-99E4-4BC8-ABFB-339FF42966AD","type":"f","value":1,"nodeType":"Float"},{"uuid":"314B7FAB-B3ED-47DC-89EF-56D2841E194C","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"8DCA7FD9-342B-440F-85E9-47559983AC96","type":"f","value":1,"nodeType":"Float"},{"uuid":"C3871F22-268C-44A7-9FD0-F2AAD9E7A2E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"530F4AE0-23F9-4792-9E7A-1E3D556B3105","type":"i","value":0,"nodeType":"Int"},{"uuid":"B9B0B732-0C0D-4F77-899D-6DE05E0C33B8","type":"lambert","color":"DC02C5B6-CE70-437D-9305-E761414ED43D","emissiveIntensity":"D89D9745-9B47-44D3-99D7-C51A8346208B","shadingAlpha":"217F4432-3015-43A3-99D4-6B9D9AAB4BF3","shadingBlend":"4415F0CC-8F07-4BF7-8507-5CF8AE9F98D8","afterColor":"BE3E6035-BF1E-4D2E-9266-E172414F57FD","alpha":"B58D8B35-A5ED-4899-B9E0-FB91E50FF2FB","emissive":"5576C436-B198-4B6F-AD99-8E8E052FE762","nodeType":"Lambert"},{"uuid":"D89D9745-9B47-44D3-99D7-C51A8346208B","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE3E6035-BF1E-4D2E-9266-E172414F57FD","type":"v3","a":"DDA0A0FA-6682-44A6-A38E-542E99BD4E44","b":"381DE7A4-7A81-471C-BB80-5185B1723AC0","alpha":"7B729D78-EA0E-4ECD-B689-A50ECF3C6FA4","mode":"530F4AE0-23F9-4792-9E7A-1E3D556B3105","nodeType":"Blend"},{"uuid":"DDA0A0FA-6682-44A6-A38E-542E99BD4E44","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"381DE7A4-7A81-471C-BB80-5185B1723AC0","type":"v3","color":"2D816D7B-5471-45B3-A3C9-54D4F973BAFC","bias":"9DFA0F66-1DEB-4014-9964-EA3EDA009247","scale":"75B53DC2-99E4-4BC8-ABFB-339FF42966AD","intensity":"314B7FAB-B3ED-47DC-89EF-56D2841E194C","factor":"8DCA7FD9-342B-440F-85E9-47559983AC96","alpha":"C3871F22-268C-44A7-9FD0-F2AAD9E7A2E0","mode":"530F4AE0-23F9-4792-9E7A-1E3D556B3105","calpha":"g381DE7A47A81471CBB805185B1723AC0_calpha","nodeType":"Fresnel"},{"uuid":"7B729D78-EA0E-4ECD-B689-A50ECF3C6FA4","type":"f","src":"g381DE7A47A81471CBB805185B1723AC0_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B58D8B35-A5ED-4899-B9E0-FB91E50FF2FB","type":"f","value":1,"nodeType":"Float"},{"uuid":"6978CF22-0835-495B-BFBC-A0F95CA3C60C","type":"f","value":1,"nodeType":"Float"},{"uuid":"29BD8F61-E9CE-4619-991D-22D5F0331134","type":"i","value":0,"nodeType":"Int"},{"uuid":"18A3A76D-5479-48F3-81ED-835FA3A5837E","type":"f","value":30,"nodeType":"Float"},{"uuid":"F75D1ADD-95E9-4369-8F46-02DC0EE7FB32","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"FD7B2010-A8DB-45F6-B141-F13ED645D623","type":"f","value":10,"nodeType":"Float"},{"uuid":"10545415-EB85-42C3-810D-C236CEF42392","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"45F2C887-795A-4829-886E-AF8A303FE43B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1131A739-B208-4A5B-8A8A-DD474D1CFB3B","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B1DFCCA4-81E3-435F-ADC9-8E2DB4E9FCA8","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"DEEFE66A-1512-47C9-96F4-38E85E8C120E","type":"f","value":1,"nodeType":"Float"},{"uuid":"688F5252-A8C2-4F08-A370-CA8CF4F0CA25","type":"i","value":0,"nodeType":"Int"},{"uuid":"D70A1FC5-B3F7-4B39-B743-2D40D4C97893","type":"f","value":50,"nodeType":"Float"},{"uuid":"2BF3AD46-E73E-40A6-85AC-BBC3FCBDD49B","type":"f","value":105,"nodeType":"Float"},{"uuid":"B74CD503-902A-46D0-9C48-DDBDDA543A00","type":"f","value":1,"nodeType":"Float"},{"uuid":"003269BD-BA79-4E60-BE53-6D4261C3D892","type":"f","value":0,"nodeType":"Float"},{"uuid":"ECE60FA6-9CD6-447A-923F-353556C171E4","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"EB078524-D7AB-4B2B-9E78-930091B06863","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"BCD0C83D-9356-4517-A0D8-587A0F137BE5","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"79001FA2-2443-48D5-A5FD-FCE57F1D2B8F","type":"f","value":1,"nodeType":"Float"},{"uuid":"D74C1401-2810-449A-9452-DCB1FF7CB2AB","type":"i","value":1,"nodeType":"Int"},{"uuid":"7DD68524-5D73-4721-A50A-A4170B08A933","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"BFFF1EC4-255E-46E4-B827-339C85E9DBBB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1E5379A8-3023-438B-9937-66CE37ACD55E","type":"f","value":1,"nodeType":"Float"},{"uuid":"D142BBF9-0985-4722-BAFC-4CC6B8BF5838","type":"f","value":2,"nodeType":"Float"},{"uuid":"2AA89EEB-C459-4731-B8B9-5D4642E8BA56","type":"f","value":1,"nodeType":"Float"},{"uuid":"92555DD9-6CEA-4CB9-83E2-1F4110AA0FF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"916F1178-EC29-4A7E-8553-88954E647BDA","type":"i","value":2,"nodeType":"Int"},{"uuid":"170618FC-3E61-4F28-8F66-2BBC490E22B1","type":"f","value":1,"nodeType":"Float"},{"uuid":"370BD396-7BF9-4B9A-99C0-30205DEA0595","type":"i","value":0,"nodeType":"Int"},{"uuid":"CF59355D-EB7B-4F3E-A7D4-2E5773ACEA50","type":"f","value":30,"nodeType":"Float"},{"uuid":"B8E50BDB-8E1A-4BCC-866C-ED34F2962C81","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"19EB0639-E7D7-454C-BC5F-4EEB14ABED2D","type":"f","value":10,"nodeType":"Float"},{"uuid":"C9171B22-CBA2-446A-A69B-77BB43DDAA70","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"016B674B-CA6F-41DE-8730-3A91F4D66235","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"89499160-40E8-4F75-8FE6-9212FAC61E1A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"62E745B9-7F32-4EE3-A1C2-5B6B3982B194","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4CA14859-045E-4DCF-AC84-98C00E3A8708","type":"f","value":1,"nodeType":"Float"},{"uuid":"D341AA21-BB8B-48F7-9C83-A75893BD0466","type":"i","value":0,"nodeType":"Int"},{"uuid":"4BC74D9B-7A2E-43C0-80DA-EA7B226CB3AA","type":"f","value":50,"nodeType":"Float"},{"uuid":"1B118C5C-6F82-42CE-A200-1983152303C6","type":"f","value":105,"nodeType":"Float"},{"uuid":"581A6169-FC28-44D1-8C48-50DE8173E6CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"FDC64B6E-E6B0-40D3-95A0-BC5A9EEF434D","type":"f","value":0,"nodeType":"Float"},{"uuid":"8FDC0350-BD69-49C3-BD6A-978C6E86B778","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"E8C53600-7DE7-44C7-A38D-80554DF1BB34","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"EED22316-163E-4629-A43C-BF2D217F4794","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"4C77BB1F-8491-4F49-A73B-57E2DE7C1AC4","type":"f","value":1,"nodeType":"Float"},{"uuid":"4FC6F001-DE48-43AA-B7A8-D4D7869EBB3E","type":"i","value":1,"nodeType":"Int"},{"uuid":"74335853-5F29-4BC2-869A-F3F2A3961B61","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"69A0F9A6-D83D-4D2B-80AD-FA0DD46C034C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"169B86CA-521E-41AF-9FB1-9F8AF861A6D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"6C0C0F65-5D0D-4712-9074-097F1CECD163","type":"f","value":2,"nodeType":"Float"},{"uuid":"D2584475-A2BF-4DC7-8658-B8911B41B2D8","type":"f","value":1,"nodeType":"Float"},{"uuid":"57A41265-7858-4581-BE1D-181BF418D4E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"238DE969-2710-499D-96A5-797FB2771D3B","type":"i","value":2,"nodeType":"Int"},{"uuid":"5AA70D54-CFE4-41EA-92FD-CE3745A60EFE","type":"f","value":1,"nodeType":"Float"},{"uuid":"6E39627E-EA0F-4975-8413-27C9B7DE36E7","type":"i","value":0,"nodeType":"Int"},{"uuid":"748D6849-5B6F-4955-A157-FDAD5AA8DAD5","type":"f","value":30,"nodeType":"Float"},{"uuid":"B2C6A021-9792-43B8-B6D6-58A24FEBE5BD","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"FBD191E1-4B03-4DFA-B615-77E0C605EEF9","type":"f","value":10,"nodeType":"Float"},{"uuid":"36389102-4A0E-40DE-8973-99397415315D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A4B963B6-024D-406A-BDCB-81422C3756BE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4D65655A-6D55-4752-9D5D-DDC7F42EF7EF","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A0D66F78-C8B5-4573-8ECD-06EC1AB66B92","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"20698AEE-069C-4F7F-9A1F-6437B19C6AED","project":false,"nodeType":"Texture"},{"uuid":"20698AEE-069C-4F7F-9A1F-6437B19C6AED","type":"v2","index":0,"nodeType":"UV"},{"uuid":"F29A7BA3-2E10-4259-81C7-3D7B173ED629","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"D68537B9-14C9-4C1A-9EED-D02CC8A3FBD2","project":false,"nodeType":"Texture"},{"uuid":"D68537B9-14C9-4C1A-9EED-D02CC8A3FBD2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"C014419E-EB16-4639-A19C-199638E00CB3","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"3EFDCDBA-DCFA-4C67-8852-DEF965D7F52C","type":"f","value":1,"nodeType":"Float"},{"uuid":"5367B246-6C58-4489-8A7D-D04AC322CDA1","type":"i","value":0,"nodeType":"Int"},{"uuid":"C110D377-07AE-4C20-9CA6-6C796838FE6D","type":"f","value":50,"nodeType":"Float"},{"uuid":"13256D9D-55E9-425A-98F2-23CBE583CC63","type":"f","value":105,"nodeType":"Float"},{"uuid":"92DC54E1-25EC-4291-91E6-261807C0B68D","type":"f","value":1,"nodeType":"Float"},{"uuid":"93D88CDF-90BD-459A-8839-4CE1BA55ACA6","type":"f","value":0,"nodeType":"Float"},{"uuid":"3D5DE1D8-8207-4BBF-84AE-4B65B4F5A900","type":"v3","x":-48,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FCB1759B-00F6-459B-9F7C-52C762BDE69A","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"98E8E511-2190-449A-BB35-C635C156B2CE","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"4BB55C5D-5FA8-48A3-808D-D53E622F722C","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D6BE68D-1D70-41AE-B3E8-7279953D311D","type":"i","value":1,"nodeType":"Int"},{"uuid":"B095B2CD-7D97-451F-B56F-564836C21E4C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"0FAF098C-AA6A-4995-A9CE-BB0DDACDB375","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E5DECD0A-D873-4893-8C37-621F742C65B6","type":"f","value":1,"nodeType":"Float"},{"uuid":"E667645A-EC96-4E9A-91D4-07A8B29944EB","type":"f","value":2,"nodeType":"Float"},{"uuid":"EE063E34-83A3-4D1E-A37B-8AD80EB2D1C1","type":"f","value":1,"nodeType":"Float"},{"uuid":"2FAC960E-09AC-42CA-A156-CAF584E8077D","type":"f","value":1,"nodeType":"Float"},{"uuid":"22198919-CF37-4E83-BAF5-C956D9E2A80F","type":"i","value":2,"nodeType":"Int"},{"uuid":"39E11A7E-DFB6-4382-8E1A-6BFB7F6A6746","type":"phong","color":"8E61A725-B189-4723-9887-3A8A6B577B1C","specular":"B2C6A021-9792-43B8-B6D6-58A24FEBE5BD","shininess":"748D6849-5B6F-4955-A157-FDAD5AA8DAD5","shadingAlpha":"5AA70D54-CFE4-41EA-92FD-CE3745A60EFE","shadingBlend":"6E39627E-EA0F-4975-8413-27C9B7DE36E7","afterColor":"24E01292-108B-4B89-B5D1-F6A1CAAED64D","alpha":"58E84200-B442-4E42-88D0-0546F5C4C87E","nodeType":"Phong"},{"uuid":"8E61A725-B189-4723-9887-3A8A6B577B1C","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"24E01292-108B-4B89-B5D1-F6A1CAAED64D","type":"v3","a":"4A0BCC73-83C0-43B6-ADAB-D1136D2AB493","b":"8A3C5B1C-2E8A-4D04-A92E-1F0CA2939DD9","alpha":"1F9D9045-FD0F-4262-B61A-CA7CCF5D5FF6","mode":"22198919-CF37-4E83-BAF5-C956D9E2A80F","nodeType":"Blend"},{"uuid":"4A0BCC73-83C0-43B6-ADAB-D1136D2AB493","type":"v3","a":"23AE61D2-A2AA-48BF-B97C-8151D2323887","b":"1F31E358-BDDB-4F8D-8CEB-8113E6AFA26D","alpha":"A4EDD2B6-15E7-4820-971C-C1DDEF51950A","mode":"3D6BE68D-1D70-41AE-B3E8-7279953D311D","nodeType":"Blend"},{"uuid":"23AE61D2-A2AA-48BF-B97C-8151D2323887","type":"v3","a":"BC0F4C36-6EE2-432E-88E5-84FCDB67DE3C","b":"037233D7-50B6-43D3-A7D9-FCD7A6ACB157","alpha":"FDD277FF-8477-466A-BFA4-39150D4180F9","mode":"5367B246-6C58-4489-8A7D-D04AC322CDA1","nodeType":"Blend"},{"uuid":"BC0F4C36-6EE2-432E-88E5-84FCDB67DE3C","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"037233D7-50B6-43D3-A7D9-FCD7A6ACB157","type":"v3","thickness":"FBD191E1-4B03-4DFA-B615-77E0C605EEF9","ior":"36389102-4A0E-40DE-8973-99397415315D","roughness":"A4B963B6-024D-406A-BDCB-81422C3756BE","alpha":"3EFDCDBA-DCFA-4C67-8852-DEF965D7F52C","calpha":"g037233D750B643D3A7D9FCD7A6ACB157_calpha","nodeType":"Transmission"},{"uuid":"FDD277FF-8477-466A-BFA4-39150D4180F9","type":"f","src":"g037233D750B643D3A7D9FCD7A6ACB157_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1F31E358-BDDB-4F8D-8CEB-8113E6AFA26D","type":"v3","near":"C110D377-07AE-4C20-9CA6-6C796838FE6D","far":"13256D9D-55E9-425A-98F2-23CBE583CC63","isVector":"92DC54E1-25EC-4291-91E6-261807C0B68D","isWorldSpace":"93D88CDF-90BD-459A-8839-4CE1BA55ACA6","origin":"3D5DE1D8-8207-4BBF-84AE-4B65B4F5A900","colorA":"FCB1759B-00F6-459B-9F7C-52C762BDE69A","colorB":"98E8E511-2190-449A-BB35-C635C156B2CE","alpha":"4BB55C5D-5FA8-48A3-808D-D53E622F722C","nodeType":"Depth"},{"uuid":"A4EDD2B6-15E7-4820-971C-C1DDEF51950A","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"4BB55C5D-5FA8-48A3-808D-D53E622F722C"},"nodeType":"Expression"},{"uuid":"8A3C5B1C-2E8A-4D04-A92E-1F0CA2939DD9","type":"v3","color":"B095B2CD-7D97-451F-B56F-564836C21E4C","bias":"0FAF098C-AA6A-4995-A9CE-BB0DDACDB375","scale":"E5DECD0A-D873-4893-8C37-621F742C65B6","intensity":"E667645A-EC96-4E9A-91D4-07A8B29944EB","factor":"EE063E34-83A3-4D1E-A37B-8AD80EB2D1C1","alpha":"2FAC960E-09AC-42CA-A156-CAF584E8077D","mode":"22198919-CF37-4E83-BAF5-C956D9E2A80F","calpha":"g8A3C5B1C2E8A4D04A92E1F0CA2939DD9_calpha","nodeType":"Fresnel"},{"uuid":"1F9D9045-FD0F-4262-B61A-CA7CCF5D5FF6","type":"f","src":"g8A3C5B1C2E8A4D04A92E1F0CA2939DD9_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"58E84200-B442-4E42-88D0-0546F5C4C87E","type":"f","value":1,"nodeType":"Float"},{"uuid":"0DF5CF07-6F18-4647-9AB8-416DAA0CF17F","type":"f","value":1,"nodeType":"Float"},{"uuid":"3E7D708D-AC03-4324-8E95-B32E7EF5E1B5","type":"i","value":0,"nodeType":"Int"},{"uuid":"A9F7714E-FA3E-4386-9387-8461A5293B35","type":"f","value":30,"nodeType":"Float"},{"uuid":"59C1D3F9-D2FD-4B25-98B4-ADB03DC99C0B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"1D4A7EB4-B30A-41E6-8ADC-ED57E14208C1","type":"f","value":10,"nodeType":"Float"},{"uuid":"FE4E22E9-434A-4909-8028-47C0651ED5FA","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"95589371-FB10-41F5-B118-A03E9E74BFCD","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A8D845A7-6021-42DA-BFA3-159D9BC8DC0A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E1DB2E67-8B0A-432B-A182-097CC3485636","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"18583F46-09E0-4F74-A5F1-C9A118B2F2D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"8D7579BF-1966-416A-810B-23344A78117B","type":"i","value":0,"nodeType":"Int"},{"uuid":"B7F0B914-0E94-4168-BC5C-B54274D10390","type":"f","value":50,"nodeType":"Float"},{"uuid":"17C95359-E0D3-4439-9E86-184F2815FFE2","type":"f","value":145,"nodeType":"Float"},{"uuid":"1E9FFB22-BB37-441D-AA7B-A9EADDEC6298","type":"f","value":1,"nodeType":"Float"},{"uuid":"C669AB91-4E46-412E-87C5-163C203BD282","type":"f","value":0,"nodeType":"Float"},{"uuid":"37BBC822-58AB-470C-9B5A-350353956AA5","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"45326985-6C10-4816-9709-F5381676A425","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"A59DBDCF-311A-42F3-B385-ED863D63E4EA","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"04DBCEEE-F6E9-4DFF-A788-2E65FEC5FE65","type":"f","value":1,"nodeType":"Float"},{"uuid":"3B973A9D-9F2F-4D37-9F3D-E765F8149B2E","type":"i","value":1,"nodeType":"Int"},{"uuid":"4BE54AED-0193-4043-A5C3-9B5C1A4D0492","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"F435FA34-0F84-4CAE-A1EA-18CB70A2545D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"43078E37-8BBE-402F-8149-3E3E3321C282","type":"f","value":1,"nodeType":"Float"},{"uuid":"2EEBBF2B-1AE8-4FA4-A6E1-9B5C68A050CC","type":"f","value":2,"nodeType":"Float"},{"uuid":"2CCBBD06-F8AC-4FB6-A90A-2CA4E64B8BE1","type":"f","value":1,"nodeType":"Float"},{"uuid":"B1126F1D-0B58-4BFA-B3C6-92BDC5E5D0A5","type":"f","value":1,"nodeType":"Float"},{"uuid":"9D0ABF56-0F34-40FB-AF7A-D4D543417D8F","type":"i","value":2,"nodeType":"Int"},{"uuid":"9F27632F-857E-4DE6-AE40-51FE62A179A9","type":"f","value":1,"nodeType":"Float"},{"uuid":"7EFC7068-C527-4D23-922D-CCE2276DAB52","type":"i","value":0,"nodeType":"Int"},{"uuid":"65B58602-F319-49AA-AE2E-3E9F05D09F37","type":"f","value":30,"nodeType":"Float"},{"uuid":"4636C98B-5A2D-4011-93C5-15535782A069","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"A373AAE8-900E-4EC9-A159-FBD172222B21","type":"f","value":10,"nodeType":"Float"},{"uuid":"161658FB-FD6F-4424-BA77-8022E3CD2DF4","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"95427A9C-68A9-41DC-981E-CD2C17005FFC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C5619A33-E81E-49BB-8391-8509F229664B","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"FF2CFDC2-DD2D-4567-BC28-0CDBB4051866","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"92A15474-B932-454E-B477-5FC0870888CA","type":"f","value":1,"nodeType":"Float"},{"uuid":"1F01CA9A-D87B-49BC-908E-36123D5FFF84","type":"i","value":0,"nodeType":"Int"},{"uuid":"447BAC34-F09B-4A48-88FA-4F18A0BE0D00","type":"f","value":50,"nodeType":"Float"},{"uuid":"03FE441A-1DB2-4414-8D4F-FDE9D1005D94","type":"f","value":145,"nodeType":"Float"},{"uuid":"81EC423D-6C8F-491F-9694-2329EC342740","type":"f","value":1,"nodeType":"Float"},{"uuid":"86FA8C2A-1633-49E1-B17A-E0F2BDF63E4D","type":"f","value":0,"nodeType":"Float"},{"uuid":"3C218021-6E54-4A5B-B91F-5AE764BFC60E","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AF9AA3B1-FEFF-4840-A777-F262268BDAB1","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"D7123BBF-5841-4FA2-9CB3-20B3F1E0A968","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"272AADCF-8268-47E6-979F-D482E4993396","type":"f","value":1,"nodeType":"Float"},{"uuid":"FCD36DEA-4F0E-4C5B-A236-26C027AA6E88","type":"i","value":1,"nodeType":"Int"},{"uuid":"CEB1E5AF-F6A9-44DC-8BE5-1E967B932FF4","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"2D6F5AF5-A096-4151-8CAC-0A8217E30758","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"07FBE759-6A73-48B4-B76B-103656592329","type":"f","value":1,"nodeType":"Float"},{"uuid":"455FC8BD-48F7-4C30-A505-DD5F5BA59CC2","type":"f","value":2,"nodeType":"Float"},{"uuid":"732A13A7-D58C-4C0F-9971-CC04DC9349E5","type":"f","value":1,"nodeType":"Float"},{"uuid":"8B971324-C484-4BA3-A12D-6B37F2AFAE6D","type":"f","value":1,"nodeType":"Float"},{"uuid":"447130F8-6659-4426-9F00-A02927781D44","type":"i","value":2,"nodeType":"Int"},{"uuid":"4610044B-2888-4D50-8A53-619EA3ECFD9C","type":"f","value":1,"nodeType":"Float"},{"uuid":"95246B48-5D56-45FB-A1AB-7C23BFF63487","type":"i","value":0,"nodeType":"Int"},{"uuid":"CC55209F-D081-4E5F-80B4-898093B36116","type":"f","value":30,"nodeType":"Float"},{"uuid":"610BE127-6961-4A85-906C-65CA39D48053","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B48467C3-05D5-4012-A1DB-9641A1680C03","type":"f","value":10,"nodeType":"Float"},{"uuid":"F5C18EB9-62BE-4D8B-85AF-14D134574DC0","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"C92364F4-7BA7-488A-B7DB-5782C20ECC69","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"19CCDEE6-011C-418E-BEE5-41D72F09AACE","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F2997AE0-3A12-4033-A7C2-DC87B880AFE8","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"BECBECB0-A108-4D08-AA2A-A6EDE8283291","project":false,"nodeType":"Texture"},{"uuid":"BECBECB0-A108-4D08-AA2A-A6EDE8283291","type":"v2","index":0,"nodeType":"UV"},{"uuid":"803FE0BC-0796-4B2E-B5BA-F9A97C3F6539","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"38F2058C-E733-4A41-9BA8-CBB924F4E38F","project":false,"nodeType":"Texture"},{"uuid":"38F2058C-E733-4A41-9BA8-CBB924F4E38F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"CCCBA1D0-B08D-4E87-8DCB-A2D0519C977E","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"09B23DAB-5858-40F9-A976-444731CAD6A6","type":"f","value":1,"nodeType":"Float"},{"uuid":"71C3FD9B-DC92-47F6-B31E-731789595F25","type":"i","value":0,"nodeType":"Int"},{"uuid":"E8D2B6B4-00F5-432A-94AA-02B434CC6F84","type":"f","value":50,"nodeType":"Float"},{"uuid":"D544DC5A-64E2-4BEC-B8CA-25CA74D26A1C","type":"f","value":145,"nodeType":"Float"},{"uuid":"43DC1AF4-DE2A-4487-9924-E25E08D99D5D","type":"f","value":1,"nodeType":"Float"},{"uuid":"38A9179F-64DE-45F0-A9DD-FA9BB52C5431","type":"f","value":0,"nodeType":"Float"},{"uuid":"9027EA62-F987-4FAE-AE40-98BB0FC6A512","type":"v3","x":-60,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"2F79F83E-AF46-487B-BBD8-B0183D3D4DFC","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"61D6F1D5-907B-4CE1-B91C-4C28ABE3CF1C","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"ABE77AE1-41BC-4CDC-8EC3-C8B813BC8982","type":"f","value":1,"nodeType":"Float"},{"uuid":"ED417DCD-7F69-478F-9D32-126CAF6DC63B","type":"i","value":1,"nodeType":"Int"},{"uuid":"DA6A7767-6C5F-4923-A779-DCD0DD12149C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"7901C7F1-CA98-4B08-84E4-A2DB0BF80ED5","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"EBE2B978-E4ED-405F-B6F3-EBDC0D41FF05","type":"f","value":1,"nodeType":"Float"},{"uuid":"DEDB8536-90BB-47FB-94B8-18870AFEB879","type":"f","value":2,"nodeType":"Float"},{"uuid":"16AF2E75-C2C5-4CED-93CD-AE5119BB5D30","type":"f","value":1,"nodeType":"Float"},{"uuid":"A9283735-DAB5-46E8-8D4F-8F5A9D270B7D","type":"f","value":1,"nodeType":"Float"},{"uuid":"38B4B73B-E830-4832-A755-35FD8549350D","type":"i","value":2,"nodeType":"Int"},{"uuid":"FEF34DEC-46CB-47B8-96A9-61BFC4576EE5","type":"phong","color":"76EA7485-EAE1-48A8-80FF-6B8D90A5D8ED","specular":"610BE127-6961-4A85-906C-65CA39D48053","shininess":"CC55209F-D081-4E5F-80B4-898093B36116","shadingAlpha":"4610044B-2888-4D50-8A53-619EA3ECFD9C","shadingBlend":"95246B48-5D56-45FB-A1AB-7C23BFF63487","afterColor":"5C69B017-C372-48D3-9D2B-7B2AC40F7D1B","alpha":"1B601B36-63B8-47DE-AAB4-399D2D42BA54","nodeType":"Phong"},{"uuid":"76EA7485-EAE1-48A8-80FF-6B8D90A5D8ED","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"5C69B017-C372-48D3-9D2B-7B2AC40F7D1B","type":"v3","a":"4FC4299B-FCA9-43F8-B75A-1A1F8338CEA6","b":"0EC8ABF7-C79C-4C9E-A0E7-A9D9BC441919","alpha":"66D05FF3-9D25-4724-B735-714BF6154DFE","mode":"38B4B73B-E830-4832-A755-35FD8549350D","nodeType":"Blend"},{"uuid":"4FC4299B-FCA9-43F8-B75A-1A1F8338CEA6","type":"v3","a":"3285825D-1FFE-42C3-BF07-2821FFBEE89D","b":"F988E9CB-DF1A-4956-9B3A-D1B0448D8D44","alpha":"014729D7-683C-47D8-9670-4D44DC38F7F2","mode":"ED417DCD-7F69-478F-9D32-126CAF6DC63B","nodeType":"Blend"},{"uuid":"3285825D-1FFE-42C3-BF07-2821FFBEE89D","type":"v3","a":"A9389FFD-50B2-4575-B983-9C5563456191","b":"5425E64B-4474-4ACF-869A-C2C755AEB922","alpha":"50A7264D-E4F9-419D-A18F-99207C579003","mode":"71C3FD9B-DC92-47F6-B31E-731789595F25","nodeType":"Blend"},{"uuid":"A9389FFD-50B2-4575-B983-9C5563456191","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5425E64B-4474-4ACF-869A-C2C755AEB922","type":"v3","thickness":"B48467C3-05D5-4012-A1DB-9641A1680C03","ior":"F5C18EB9-62BE-4D8B-85AF-14D134574DC0","roughness":"C92364F4-7BA7-488A-B7DB-5782C20ECC69","alpha":"09B23DAB-5858-40F9-A976-444731CAD6A6","calpha":"g5425E64B44744ACF869AC2C755AEB922_calpha","nodeType":"Transmission"},{"uuid":"50A7264D-E4F9-419D-A18F-99207C579003","type":"f","src":"g5425E64B44744ACF869AC2C755AEB922_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F988E9CB-DF1A-4956-9B3A-D1B0448D8D44","type":"v3","near":"E8D2B6B4-00F5-432A-94AA-02B434CC6F84","far":"D544DC5A-64E2-4BEC-B8CA-25CA74D26A1C","isVector":"43DC1AF4-DE2A-4487-9924-E25E08D99D5D","isWorldSpace":"38A9179F-64DE-45F0-A9DD-FA9BB52C5431","origin":"9027EA62-F987-4FAE-AE40-98BB0FC6A512","colorA":"2F79F83E-AF46-487B-BBD8-B0183D3D4DFC","colorB":"61D6F1D5-907B-4CE1-B91C-4C28ABE3CF1C","alpha":"ABE77AE1-41BC-4CDC-8EC3-C8B813BC8982","nodeType":"Depth"},{"uuid":"014729D7-683C-47D8-9670-4D44DC38F7F2","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"ABE77AE1-41BC-4CDC-8EC3-C8B813BC8982"},"nodeType":"Expression"},{"uuid":"0EC8ABF7-C79C-4C9E-A0E7-A9D9BC441919","type":"v3","color":"DA6A7767-6C5F-4923-A779-DCD0DD12149C","bias":"7901C7F1-CA98-4B08-84E4-A2DB0BF80ED5","scale":"EBE2B978-E4ED-405F-B6F3-EBDC0D41FF05","intensity":"DEDB8536-90BB-47FB-94B8-18870AFEB879","factor":"16AF2E75-C2C5-4CED-93CD-AE5119BB5D30","alpha":"A9283735-DAB5-46E8-8D4F-8F5A9D270B7D","mode":"38B4B73B-E830-4832-A755-35FD8549350D","calpha":"g0EC8ABF7C79C4C9EA0E7A9D9BC441919_calpha","nodeType":"Fresnel"},{"uuid":"66D05FF3-9D25-4724-B735-714BF6154DFE","type":"f","src":"g0EC8ABF7C79C4C9EA0E7A9D9BC441919_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1B601B36-63B8-47DE-AAB4-399D2D42BA54","type":"f","value":1,"nodeType":"Float"},{"uuid":"58785330-195F-46F6-9AF8-74CB4187BA9C","type":"f","value":1,"nodeType":"Float"},{"uuid":"8220B616-AE5C-42DD-86F2-CCE8F7E8CC4E","type":"i","value":0,"nodeType":"Int"},{"uuid":"3824E690-E278-4BAB-BD34-C7257F9FDA31","type":"f","value":30,"nodeType":"Float"},{"uuid":"6C8366A2-6F8A-4CAB-AE9F-11FE89542811","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"25B059FC-0E89-466A-87B3-B3553858C923","type":"f","value":10,"nodeType":"Float"},{"uuid":"C6A5BA95-9802-45FA-9E94-EB40F66B1341","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D5A7D3EA-116B-4C23-890D-5A4D78057AD2","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"70036027-0F8F-4C7D-BFD1-A3A5D42BE832","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"973DAF5C-6A8E-455B-88A3-7DA3C21ABF99","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"516C3212-ACE9-4F5D-B606-0E74D082F041","project":false,"nodeType":"Texture"},{"uuid":"516C3212-ACE9-4F5D-B606-0E74D082F041","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A9C1EBE0-0F7E-4EA9-BF3C-2F560438C9FD","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"82696A6A-CF39-4B7F-ABCF-F6A3995B8B10","project":false,"nodeType":"Texture"},{"uuid":"82696A6A-CF39-4B7F-ABCF-F6A3995B8B10","type":"v2","index":0,"nodeType":"UV"},{"uuid":"1E234E3C-5FBD-419C-838B-2141A0A7B30D","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"878E790F-B132-455B-AD5A-3B5FAE356D9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"086526B7-C449-4D81-AF4E-AA2EF90A38D2","type":"i","value":0,"nodeType":"Int"},{"uuid":"87AA9EB3-2EA9-400D-90E3-EA364CA3A49D","type":"f","value":50,"nodeType":"Float"},{"uuid":"C1FDAC4B-5E10-47F9-BB72-19AC5AE0F778","type":"f","value":145,"nodeType":"Float"},{"uuid":"ADA93B02-A8DC-412E-B533-F2F7BD1DC507","type":"f","value":1,"nodeType":"Float"},{"uuid":"0DBFCD76-AAD0-4224-900B-8CDA2AD630EB","type":"f","value":0,"nodeType":"Float"},{"uuid":"F517E8CA-F473-48DB-97A5-FB9DFF402239","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"4962D881-17E8-41B4-AC52-35230AFE8A92","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"70D19E09-062E-4B98-A30F-BE406F11E56F","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"4B517B89-388E-43FA-914B-BFBB31CE4759","type":"f","value":1,"nodeType":"Float"},{"uuid":"97B95129-5377-49DA-B03A-36CB7D1510AE","type":"i","value":1,"nodeType":"Int"},{"uuid":"3A00FDC2-F258-4FD1-A9D4-1346148A989D","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"6EFD146C-25FA-4BE2-8041-9E2E5F3249FC","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"474FED76-6E72-42BD-B236-01F28289938E","type":"f","value":1,"nodeType":"Float"},{"uuid":"82D2CC3D-9049-437B-B415-5A9C72A6A2DE","type":"f","value":2,"nodeType":"Float"},{"uuid":"0EC136C5-3C89-4E85-A40E-8E32BD597769","type":"f","value":1,"nodeType":"Float"},{"uuid":"511DBBF2-AA85-494E-80EF-217C1AFD06BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"4BC21BE5-014D-45DB-AECA-6B290F0609FA","type":"i","value":2,"nodeType":"Int"},{"uuid":"E4806741-9C0A-4097-A05B-11068CE6A6D7","type":"phong","color":"CA522B28-A033-49E0-A3B8-45BAD6EBC7B1","specular":"6C8366A2-6F8A-4CAB-AE9F-11FE89542811","shininess":"3824E690-E278-4BAB-BD34-C7257F9FDA31","shadingAlpha":"58785330-195F-46F6-9AF8-74CB4187BA9C","shadingBlend":"8220B616-AE5C-42DD-86F2-CCE8F7E8CC4E","afterColor":"78636C92-6FC5-4B92-9E9B-89CF0718415E","alpha":"919F94C0-37E3-4B35-B4C8-93EFB8928886","nodeType":"Phong"},{"uuid":"CA522B28-A033-49E0-A3B8-45BAD6EBC7B1","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"78636C92-6FC5-4B92-9E9B-89CF0718415E","type":"v3","a":"C7FED520-1B57-496E-AF41-CA96801660B8","b":"560B2278-B808-40DE-9B1B-1B4B32D8068C","alpha":"F820DEBB-2B64-4922-A1EB-47291DEE8305","mode":"4BC21BE5-014D-45DB-AECA-6B290F0609FA","nodeType":"Blend"},{"uuid":"C7FED520-1B57-496E-AF41-CA96801660B8","type":"v3","a":"2D61F2EC-870A-4A0E-840C-17809ADC33C3","b":"CA4BC342-0E88-445D-B3DD-63E599872674","alpha":"44AFB6C7-400F-43C9-9BEC-F0BFA0201A18","mode":"97B95129-5377-49DA-B03A-36CB7D1510AE","nodeType":"Blend"},{"uuid":"2D61F2EC-870A-4A0E-840C-17809ADC33C3","type":"v3","a":"50F1F01B-30C8-4861-8023-75DA352C90A1","b":"C43E03A7-7522-4207-BD7A-E79FC6B7477B","alpha":"D9E11D08-7F82-4E4C-865D-7BE7FEEE33D4","mode":"086526B7-C449-4D81-AF4E-AA2EF90A38D2","nodeType":"Blend"},{"uuid":"50F1F01B-30C8-4861-8023-75DA352C90A1","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C43E03A7-7522-4207-BD7A-E79FC6B7477B","type":"v3","thickness":"25B059FC-0E89-466A-87B3-B3553858C923","ior":"C6A5BA95-9802-45FA-9E94-EB40F66B1341","roughness":"D5A7D3EA-116B-4C23-890D-5A4D78057AD2","alpha":"878E790F-B132-455B-AD5A-3B5FAE356D9A","calpha":"gC43E03A775224207BD7AE79FC6B7477B_calpha","nodeType":"Transmission"},{"uuid":"D9E11D08-7F82-4E4C-865D-7BE7FEEE33D4","type":"f","src":"gC43E03A775224207BD7AE79FC6B7477B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CA4BC342-0E88-445D-B3DD-63E599872674","type":"v3","near":"87AA9EB3-2EA9-400D-90E3-EA364CA3A49D","far":"C1FDAC4B-5E10-47F9-BB72-19AC5AE0F778","isVector":"ADA93B02-A8DC-412E-B533-F2F7BD1DC507","isWorldSpace":"0DBFCD76-AAD0-4224-900B-8CDA2AD630EB","origin":"F517E8CA-F473-48DB-97A5-FB9DFF402239","colorA":"4962D881-17E8-41B4-AC52-35230AFE8A92","colorB":"70D19E09-062E-4B98-A30F-BE406F11E56F","alpha":"4B517B89-388E-43FA-914B-BFBB31CE4759","nodeType":"Depth"},{"uuid":"44AFB6C7-400F-43C9-9BEC-F0BFA0201A18","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"4B517B89-388E-43FA-914B-BFBB31CE4759"},"nodeType":"Expression"},{"uuid":"560B2278-B808-40DE-9B1B-1B4B32D8068C","type":"v3","color":"3A00FDC2-F258-4FD1-A9D4-1346148A989D","bias":"6EFD146C-25FA-4BE2-8041-9E2E5F3249FC","scale":"474FED76-6E72-42BD-B236-01F28289938E","intensity":"82D2CC3D-9049-437B-B415-5A9C72A6A2DE","factor":"0EC136C5-3C89-4E85-A40E-8E32BD597769","alpha":"511DBBF2-AA85-494E-80EF-217C1AFD06BF","mode":"4BC21BE5-014D-45DB-AECA-6B290F0609FA","calpha":"g560B2278B80840DE9B1B1B4B32D8068C_calpha","nodeType":"Fresnel"},{"uuid":"F820DEBB-2B64-4922-A1EB-47291DEE8305","type":"f","src":"g560B2278B80840DE9B1B1B4B32D8068C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"919F94C0-37E3-4B35-B4C8-93EFB8928886","type":"f","value":1,"nodeType":"Float"},{"uuid":"F5B9325D-FBB8-4F43-B45A-BC04DE7AAB28","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"EDCC3D5B-C68C-4510-9BD5-D8E5604D2F45","nodeType":"Color"},{"uuid":"EDCC3D5B-C68C-4510-9BD5-D8E5604D2F45","type":"f","value":1,"nodeType":"Float"},{"uuid":"44A17CF7-CA73-4747-9E43-491F9F12C817","type":"i","value":0,"nodeType":"Int"},{"uuid":"EABFB3AC-203B-459F-BDDB-1CACB5A188E8","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6EC182F-E337-4536-AF77-4BE144592275","type":"i","value":0,"nodeType":"Int"},{"uuid":"34322962-A2EF-4992-A472-94C232E126C9","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"91E61A43-E991-497E-B69D-BD86BFC3D027","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"7ACCEE9C-D1E5-4952-8570-A1EDAE37B168","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"757E3BBE-1B67-4E5B-A9A9-EB111530B641","type":"f","value":1,"nodeType":"Float"},{"uuid":"319E4F49-6B7F-47BE-A6A4-3B84216A672A","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"9F1E7DFE-283A-46C0-AAEA-F20B61A7937B","type":"f","value":1,"nodeType":"Float"},{"uuid":"9C4BA8BE-92B8-4E8C-A5F4-E54018A689C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"318A6499-FC7B-4AA7-B2E4-7827495F2B24","type":"i","value":0,"nodeType":"Int"},{"uuid":"188C0EA7-11B4-468F-8FD4-6F0FC7C53B63","type":"lambert","color":"F5B9325D-FBB8-4F43-B45A-BC04DE7AAB28","emissiveIntensity":"2E0D39D2-5E6B-4446-B7F6-29E8F65DAC55","shadingAlpha":"EABFB3AC-203B-459F-BDDB-1CACB5A188E8","shadingBlend":"D6EC182F-E337-4536-AF77-4BE144592275","afterColor":"BDE37403-672D-40D0-AB37-3965D5289DDF","alpha":"4A771C5B-2126-480E-A6BA-D806EAF0927D","emissive":"34322962-A2EF-4992-A472-94C232E126C9","nodeType":"Lambert"},{"uuid":"2E0D39D2-5E6B-4446-B7F6-29E8F65DAC55","type":"f","value":1,"nodeType":"Float"},{"uuid":"BDE37403-672D-40D0-AB37-3965D5289DDF","type":"v3","a":"96CF1C04-E1B7-4ADE-BFB8-9FBA05080367","b":"F32D2AF9-830E-459F-96A2-416DC32DC113","alpha":"473BA8DA-83C4-4088-8CCE-AD7464104CCE","mode":"318A6499-FC7B-4AA7-B2E4-7827495F2B24","nodeType":"Blend"},{"uuid":"96CF1C04-E1B7-4ADE-BFB8-9FBA05080367","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F32D2AF9-830E-459F-96A2-416DC32DC113","type":"v3","color":"91E61A43-E991-497E-B69D-BD86BFC3D027","bias":"7ACCEE9C-D1E5-4952-8570-A1EDAE37B168","scale":"757E3BBE-1B67-4E5B-A9A9-EB111530B641","intensity":"319E4F49-6B7F-47BE-A6A4-3B84216A672A","factor":"9F1E7DFE-283A-46C0-AAEA-F20B61A7937B","alpha":"9C4BA8BE-92B8-4E8C-A5F4-E54018A689C0","mode":"318A6499-FC7B-4AA7-B2E4-7827495F2B24","calpha":"gF32D2AF9830E459F96A2416DC32DC113_calpha","nodeType":"Fresnel"},{"uuid":"473BA8DA-83C4-4088-8CCE-AD7464104CCE","type":"f","src":"gF32D2AF9830E459F96A2416DC32DC113_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4A771C5B-2126-480E-A6BA-D806EAF0927D","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1393,1137],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/layout_dark/index.html b/site/spline/design/layout_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/layout_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/layout_dark/runtime.js b/site/spline/design/layout_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/layout_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOn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QSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/layout_dark/scene.json b/site/spline/design/layout_dark/scene.json deleted file mode 100644 index bebcb2503..000000000 --- a/site/spline/design/layout_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.8632351105050647,1.3877787807814454e-17,-0.50480208398075,0,-0.14502267448093786,0.9578447875246077,-0.24799553806134123,0,0.48352204487252076,0.28728620400558436,0.8268452510055053,0,-23.987386521882627,230.3277534699212,1143.4164289641712,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000002,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-76.94465201665992,0.4178501358965292,-98.63279130365652,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["4CEE8081-DF9A-414C-B952-00D0F42060E6","88B965DB-8CFD-472C-87A2-B0F3AEAA8088"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"88B965DB-8CFD-472C-87A2-B0F3AEAA8088"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"B47CA50B-41D6-4AEE-88BA-4DA115D72BC4"},{"uuid":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","objectType":"Mesh3D","name":"Cube copy 10","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-478.5504910358467,-191.02719312096582,278.982102766933,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"interaction":{"uuid":"4E317D27-3986-451E-AA1F-478CDB6D387F","selectedState":0,"states":["3BD078E5-F937-410A-A7F9-5C1BA96929C4","13F94928-847A-4DB1-BE0C-68860304FC35"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","state":"13F94928-847A-4DB1-BE0C-68860304FC35"}]}]},"geometry":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","material":"972021DA-D1BC-410E-B95F-DC28BF4B82C6"},{"uuid":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","objectType":"Mesh3D","name":"Cube copy 9","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,104.97217124530464,-175.33267147612932,156.21358813721042,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"interaction":{"uuid":"87E66C6B-1573-4DB3-BEF3-C467BD8FEA0A","selectedState":0,"states":["0673B2F2-9E0D-41DD-AD10-35580FFD0702","232ABFB9-00BC-49C7-8037-979EA4364C0B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","state":"232ABFB9-00BC-49C7-8037-979EA4364C0B"}]}]},"geometry":"53F4C327-4868-48DA-8FC8-4FD577D63D34","material":"41E85458-2AD3-4008-8B0E-84160899D29A"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-180.82350074513494,0.4178501358965292,-98.63279130365652,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["B0FD718F-8EEA-41BB-8737-77F027FCD758","8B021AA7-3767-4FE4-A69E-24708D8A52D3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"8B021AA7-3767-4FE4-A69E-24708D8A52D3"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"EE55FE25-7448-47CB-B358-4694E90D19AB"},{"uuid":"6EAA47D6-8FB7-42F3-9926-77429CA5137F","objectType":"Mesh3D","name":"Cube copy 7","matrix":[1,0,0,0,0,-0.9396926207859071,0.3420201433256703,0,0,-0.34202014332567027,-0.9396926207859069,0,109.51129684329464,-121.3895460375428,21.17660453440807,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"interaction":{"uuid":"ECD7E6CB-C79A-4ED0-B00A-7A03BB08B18D","selectedState":0,"states":["8A056A08-77F3-437B-9228-2A7A16DFBF8A","3A18B19F-A3CD-4A64-A6B2-748864F843DE"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"6EAA47D6-8FB7-42F3-9926-77429CA5137F","state":"3A18B19F-A3CD-4A64-A6B2-748864F843DE"}]}]},"geometry":"2DBADC1B-7F3E-4205-A38F-DECC3794A0D5","material":"ECEEDD05-B1D5-4565-9B37-ADCED15039C3"},{"uuid":"1A292755-6BC1-4ABB-9D81-7860EEA006AC","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,-0.9396926207859101,0.34202014332567093,0,0,-0.34202014332567093,-0.9396926207859101,0,10.534771456721458,-122.15293403303363,17.637833140228576,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"0F79A54B-4BBE-4BC1-99C0-CB86C4C02625","selectedState":0,"states":["907C1AA9-85E9-411C-BD55-6D2BB1B1C1EE","FA4C95D1-10CC-46FD-BA50-13119F236723"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"1A292755-6BC1-4ABB-9D81-7860EEA006AC","state":"FA4C95D1-10CC-46FD-BA50-13119F236723"}]}]},"geometry":"BC0A73B0-3BB1-47AD-8161-9ADD27898AE4","material":"965B60A2-D39C-4014-A010-05E60C5060F4"},{"uuid":"C45F8E6D-2068-4617-8291-49DAA9D72F19","objectType":"Mesh3D","name":"Cube copy 5","matrix":[1.000000000000012,-3.1308381269245555e-17,2.720436994223432e-16,0,1.224646799147353e-16,0.9396926207859084,-0.34202014332566866,0,-2.4492935982947355e-16,0.34202014332567277,0.9396926207859196,0,-92.46522854327877,-73.79488051928482,4.26206273772965,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"42D4F1E2-E870-408F-8473-3BAF91CAAC68","selectedState":0,"states":["035117A6-16BB-479C-AA37-3EAFBC4DAAED","3A86C3B9-4C99-4202-BEB0-B2C431A482DF"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"C45F8E6D-2068-4617-8291-49DAA9D72F19","state":"3A86C3B9-4C99-4202-BEB0-B2C431A482DF"}]}]},"geometry":"4D541A57-7A45-4616-9DED-60CF6C63666F","material":"3F684B60-9B38-4866-A4EC-EA1456ABF0D9"},{"uuid":"D9C2D100-409F-4403-A98D-A39788AB8850","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,-0.9396926207859163,0.34202014332567326,0,0,-0.342020143325673,-0.9396926207859155,0,60.53477145672121,-27.242356786268587,-12.710181232475918,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"interaction":{"uuid":"D0FA51AF-597A-41D3-9BDB-30B281E3FAA1","selectedState":0,"states":["CAC32034-FC42-4F56-9BA1-B4CC0A4E779F","BB63C07E-8221-497A-B065-F19CE4FA1F94"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"D9C2D100-409F-4403-A98D-A39788AB8850","state":"BB63C07E-8221-497A-B065-F19CE4FA1F94"}]}]},"geometry":"EA75EF62-7B8C-41DF-B29C-D0C4F6804260","material":"01E3CC91-E074-48CA-9393-5BF153534892"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,0,6.123233995736766e-14,1000,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"48C98966-C341-457B-A325-6AAF364439CF","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53F4C327-4868-48DA-8FC8-4FD577D63D34","userData":{"parameters":{"width":160,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"2DBADC1B-7F3E-4205-A38F-DECC3794A0D5","userData":{"parameters":{"width":100,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}},{"uuid":"BC0A73B0-3BB1-47AD-8161-9ADD27898AE4","userData":{"parameters":{"width":100,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}},{"uuid":"4D541A57-7A45-4616-9DED-60CF6C63666F","userData":{"parameters":{"width":110,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":200,"depth":32},"type":"CubeGeometry"}},{"uuid":"EA75EF62-7B8C-41DF-B29C-D0C4F6804260","userData":{"parameters":{"width":200,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"B47CA50B-41D6-4AEE-88BA-4DA115D72BC4","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4C7C09F8-A7E3-4325-8425-501F8D0972FD","f1_mode":"54D3AA48-F20F-4A4C-8EAD-1EE352755D06","f1_shininess":"5B2BCDC1-8970-4751-9DB6-81DF9575A145","f1_specular":"0E334D1D-057F-4BDB-ADFF-7650EEAF677C"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"0CBC992A-073A-4D55-A2DB-15AE5A4F0256","f2_ior":"F369DD01-A123-4387-A0C5-4D56CD7857B6","f2_roughness":"6D8B3057-AC63-4A37-A446-5132E21BDFF4","f2_transmissionSamplerSize":"FF2FCCC6-45B0-4010-B1EE-7DCF37230444","f2_transmissionSamplerMap":"0371800A-53CD-43E4-82EE-FFAFDC302125","f2_transmissionDepthMap":"77252A84-303E-4D52-9555-953C5860E242","f2_aspectRatio":"64F07E20-71FB-4C09-A60C-F07A257A3360","f2_alpha":"EDCDEAED-37ED-4616-A3EE-8EE9453BFD5C","f2_mode":"73952214-D566-4C2F-A067-E9CBC9BA5181"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"11B9E4D1-06F9-4B01-97FF-DB1BBECE2145","f4_far":"5324F074-49CE-4315-AB55-A3F71079B76A","f4_isVector":"5E7A8CB2-5BF4-41F6-A001-36D4F308A85B","f4_isWorldSpace":"0DCC7C89-2CB7-4644-AA7A-75B86F9FC54B","f4_origin":"8837FB37-2FCA-436B-85F1-229F99DAEDB9","f4_colorA":"36EF51BD-25F1-4F97-8B34-042FBEF835E7","f4_colorB":"79EC7AF5-AC52-4A44-A0E0-3481DB414B28","f4_alpha":"6149AF19-6E47-4C86-82C9-3C7E47CABBDC","f4_mode":"C1A48DC3-51D3-49B6-ABE8-0720D323397C"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4AEF29D0-4D24-42A9-A44D-31EBC4B303A0","f3_bias":"74387971-BF18-4BB1-8D5D-1A47D2E8F29F","f3_scale":"9DACAF97-4147-47A8-84F0-BD5D1075537D","f3_intensity":"DBA8C84E-C550-4A51-946B-4FB5674F7250","f3_factor":"E4685397-F0DF-473F-99B9-CD2499142757","f3_alpha":"5C0B2DDD-AFE6-47D2-B7A4-3E73B7C454FD","f3_mode":"B3B56A54-0A96-46AC-830C-FB991C0D65BB"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"27AFC4DB-9892-490C-BC70-52A987C47421","fragment":"27AFC4DB-9892-490C-BC70-52A987C47421"},{"uuid":"972021DA-D1BC-410E-B95F-DC28BF4B82C6","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1923B487-6256-4435-8461-59108C8CE963","f1_mode":"F8032A8F-9E4C-492F-B8E5-9C6584C25808","f1_shininess":"A31FCB67-468F-4843-B3AE-1B5E6C96942B","f1_specular":"C9900111-9938-4F76-A2D0-A88593F4DD05"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"62896B31-61FD-4485-B95D-8369122ACBE5","f2_ior":"C13619ED-22E5-4C99-93F0-CE1DA504BDD7","f2_roughness":"98657F06-2375-4F40-8C33-1DA082DD5921","f2_transmissionSamplerSize":"54C7052B-52D9-4AA3-8364-D6A95999E6A7","f2_transmissionSamplerMap":"753C3F35-E67F-4A61-8045-37F4D0B478FD","f2_transmissionDepthMap":"7B3BA6E4-FFA5-4654-874D-9C13A4507C15","f2_aspectRatio":"0FAA0EDA-246B-457F-B709-753E29206855","f2_alpha":"D2017C82-A2E1-4F06-B3B0-55FE2AB99D6D","f2_mode":"93284330-0E5F-459C-8D47-114A26196045"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"825874C5-D8AF-4EA5-9450-A54AF0C8A997","f4_far":"33D9DF44-AAB6-4686-AB96-F3B741E32290","f4_isVector":"B6608D7C-DFAB-4503-B136-67677E60075B","f4_isWorldSpace":"3DB349A3-FF7D-47F8-9108-B313C4CC0889","f4_origin":"CD3D887D-8BA2-4FB2-8828-93AB60A07B29","f4_colorA":"89BE0FC6-C157-4A0F-8F20-16AEC386CDC3","f4_colorB":"C899A389-57A7-45E6-A079-69DFF2205240","f4_alpha":"CD471F78-4361-459A-BF92-1EC2AC96130E","f4_mode":"0266D6CD-474F-4960-AEE6-459A1523AB70"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F1291E3D-2BAD-43C9-BC60-B3B1634B2A02","f3_bias":"105C01BB-E448-46CB-BB33-69EECCCC0C43","f3_scale":"275E25B9-4621-4F59-8F1D-6207DEB75DB1","f3_intensity":"CC797E50-E778-4395-BBEB-5D3B19FC56A3","f3_factor":"ED0642EF-5DC8-4962-8C67-2A2B4302E36B","f3_alpha":"749E467A-CE2A-4176-AD13-69FB71E84FB4","f3_mode":"031F33CD-3682-4762-9DC6-DBA00BD91644"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"052F679B-351A-4149-9491-A71826CF9FC2","fragment":"052F679B-351A-4149-9491-A71826CF9FC2"},{"uuid":"41E85458-2AD3-4008-8B0E-84160899D29A","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C97DFDA0-A0A6-4DB8-894D-CD9D02C545A4","f1_mode":"15F3C7B2-8986-4752-B9D9-0E1C6452E37C","f1_shininess":"AD435D6F-47CF-4E62-A217-C1BC66664AED","f1_specular":"B0673489-B962-4F39-ADD6-4987B4F045E4"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"1920E46F-C1E4-45EA-AB2E-60B33B60DE47","f2_ior":"CED1CB13-70BD-41EC-A203-C496289AD201","f2_roughness":"7D2BD129-0C89-43AE-A427-BC1541EF3C1B","f2_transmissionSamplerSize":"33404D17-0CC1-4D8A-AEFF-154A2616CBD3","f2_transmissionSamplerMap":"B4AB5843-1F14-4780-AA03-7876CD1C2590","f2_transmissionDepthMap":"FC4343C9-9548-412E-A06A-0FB7FE2252E6","f2_aspectRatio":"98596F10-EE74-43EE-B7F4-A6E2D26FEDE5","f2_alpha":"4C6780A1-4050-4264-B173-B37D2C7C760F","f2_mode":"E8785667-8D57-4D52-B756-674E08CA8518"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"8C05C1C7-06C2-42FA-BA70-3120C85BB43E","f4_far":"B86D5BC2-83E5-4D3D-AA5B-4E9D758D3AAC","f4_isVector":"41375C90-58C7-4F90-990D-C0ED8DE6103A","f4_isWorldSpace":"E95F2D23-922F-4DD0-B948-418F5F17F9EF","f4_origin":"21ACAF71-B6C0-4AC5-A2FA-3BA5E57A1612","f4_colorA":"DABD445A-2A62-455D-9040-182F9CD7E7BC","f4_colorB":"7F33322C-816B-4350-BF5B-5FDC1717C707","f4_alpha":"87B93118-C1F4-437F-B9B9-1B9A6F7A7FDD","f4_mode":"764E377C-BEC9-4F7E-BFC8-C13DD6F6CB28"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A2A4CE57-1155-4F46-A021-82E172B40A9E","f3_bias":"36AB4FE4-C3D2-4D1B-AC8D-9749E6146921","f3_scale":"1759D6E4-8D74-4F83-A480-0E5516295724","f3_intensity":"1FFEB97E-B1D8-4E02-BB7B-D0A21467C82A","f3_factor":"C38807EA-F499-453A-99DF-781C4DB77180","f3_alpha":"BE687DC3-116E-4D4B-9288-0AA1BD5A93B5","f3_mode":"CED347F3-4DDB-45E1-817C-45524AD91916"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"45DF87E9-0E8A-4B05-83A0-70AD630C4C9A","fragment":"45DF87E9-0E8A-4B05-83A0-70AD630C4C9A"},{"uuid":"EE55FE25-7448-47CB-B358-4694E90D19AB","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8509085C-9345-40E3-ABBD-230A6DA09BDE","f1_mode":"095A56D0-00FA-430E-B44E-31E4B5A77130","f1_shininess":"EB058285-6D70-4448-9030-D3A51FC5307D","f1_specular":"1C367BD6-9DF7-4D64-9AF8-FAFFA9544CCF"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"245EC322-347B-4177-85A0-B137F918FF3C","f2_ior":"F837D8F7-988E-4487-9487-A5FA2B0F2CEB","f2_roughness":"AD0E9846-95F2-4BE6-A5BD-D15255C2B69E","f2_transmissionSamplerSize":"026EB1CD-27B1-4BC7-91F1-0263A17BB270","f2_transmissionSamplerMap":"51A8743B-9434-4801-8BC6-3D1FBA26E343","f2_transmissionDepthMap":"087C79DD-3497-4ED1-AD97-8BFB86645F69","f2_aspectRatio":"9906C264-D68D-4FFC-AA72-EECD176AD63A","f2_alpha":"D39DC81E-70B6-461C-B72B-A6DED24A9EAB","f2_mode":"4B4A6FE2-556C-4512-A5BE-18E349E256D4"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"F842B440-FECC-4940-A093-FCB02EACEEE7","f4_far":"25E8A245-08B0-4CA6-AD8C-5C94E6102041","f4_isVector":"47CDBE76-DCCD-49D9-9085-EA07A097C50E","f4_isWorldSpace":"D81FCBE5-3D96-46F4-BCC5-EF9795E56D60","f4_origin":"0B4EE8F1-8E0F-4256-9B6E-28E90C900AB9","f4_colorA":"59FD5EFD-5E45-48EB-AEC1-0E8193DBF3A0","f4_colorB":"9B72156C-93EA-4B85-B9E5-D6557633E16B","f4_alpha":"E43189CC-261E-45B4-9133-90B0BDACBF5A","f4_mode":"A1F73F3B-E33F-4993-98FC-D5A40F8DA1B0"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"865DF570-FB5B-4BD1-A3AD-3C30D7A0108D","f3_bias":"FF49F342-7CAA-4AF1-BF49-516C1506C997","f3_scale":"FA9ADC86-F695-4CEA-AD8D-46DB967EB57A","f3_intensity":"8A816F64-79C6-4522-8CF3-88E00D717444","f3_factor":"1AA77729-5EA1-4CC2-9621-D682BA486A12","f3_alpha":"4847CF34-C471-47C4-9093-F538E218148D","f3_mode":"3223732C-4C23-4807-AFD9-2CD30E2BA853"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A3C76274-50CA-469F-B6E5-D470079EAEEB","fragment":"A3C76274-50CA-469F-B6E5-D470079EAEEB"},{"uuid":"ECEEDD05-B1D5-4565-9B37-ADCED15039C3","type":"ShaderMaterial","reflectivity":{"uuid":"6A085E9A-07F5-446E-9A3F-67399FFAF918","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"535C8B62-143B-4566-8F2F-83A3C155CB25","f0_alpha":"C6D2A9E5-9396-4089-BEE2-0A1365CF1328","f0_mode":"07E46350-4063-404B-B50A-39415D0E3624"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"45608F34-DA5D-40B7-B68A-0D98E83D94DB","f1_mode":"7953F7FE-F229-45DC-80AD-2FC2E76A2A6A","f1_roughness":"2C808CF1-D617-4578-B06D-3DE7D138CCF1","f1_metalness":"B2572CCF-9EBE-4871-82A0-98DFBD035A70","f1_reflectivity":"6A085E9A-07F5-446E-9A3F-67399FFAF918"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"DCD50686-554C-4641-9C7B-1109C2B95AA9","fragment":"DCD50686-554C-4641-9C7B-1109C2B95AA9"},{"uuid":"965B60A2-D39C-4014-A010-05E60C5060F4","type":"ShaderMaterial","reflectivity":{"uuid":"475EF715-4983-4CFA-86CB-B36C2F376701","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"FBABEA12-8DCA-4E0D-846E-F81DAF920347","f0_alpha":"B52C0D00-70DC-427F-B59D-B80E87EBE34F","f0_mode":"7723186C-D545-46BB-9F80-1EA7AE3ED04B"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7BDCB1F7-5D48-47EC-9F96-9C14E579BC0A","f1_mode":"D38167F4-8D55-4638-BB9E-E2B127C4629A","f1_roughness":"65979A7D-38AE-46A4-8A5B-973C97E08CD4","f1_metalness":"9D9EE0A6-865A-4631-96B1-987C0E98AD4A","f1_reflectivity":"475EF715-4983-4CFA-86CB-B36C2F376701"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"3C5E15E7-27EC-45B9-A07F-83CE1E9934F8","fragment":"3C5E15E7-27EC-45B9-A07F-83CE1E9934F8"},{"uuid":"3F684B60-9B38-4866-A4EC-EA1456ABF0D9","type":"ShaderMaterial","reflectivity":{"uuid":"C8BDFD9D-6D40-40BC-9430-A30B7D0B6009","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"68D760D1-2A14-4618-8DA3-E36EB8AC3D2A","f0_alpha":"C0D84F24-98CF-48C2-82A6-FDA733E3BAFF","f0_mode":"3467C87A-CE23-4579-B5C5-DDD8420DC800"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"90F42F27-4EA6-47BD-8FF8-B7BD5B65DEAE","f1_mode":"7FA757D3-D98B-4591-99A5-20AF513CB416","f1_roughness":"E1867CE4-D9C8-496A-9DBD-4240ADBC287C","f1_metalness":"7EA63203-BF43-4F9F-A7FF-936FCC17AC16","f1_reflectivity":"C8BDFD9D-6D40-40BC-9430-A30B7D0B6009"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A2A933E7-DADC-44C9-A6D5-A59DD103D9BD","fragment":"A2A933E7-DADC-44C9-A6D5-A59DD103D9BD"},{"uuid":"01E3CC91-E074-48CA-9393-5BF153534892","type":"ShaderMaterial","reflectivity":{"uuid":"9771051F-5CD4-41D0-A8CD-9F1B5659B460","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"7F1D5E40-CF3B-4C80-B3CA-63BA476CE519","f0_alpha":"4B8B7206-4C74-4039-B362-984625E3FFEC","f0_mode":"AFFD86EF-7598-4364-8807-5C6FDDE7A5E4"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C8523BEB-DB3F-4A8D-AAC1-79B39C9159F0","f1_mode":"678A3E77-9814-4ECB-A699-AA4F66DCA6B7","f1_roughness":"48D2528A-F3F3-4C52-B70F-0163341D0DAB","f1_metalness":"81B5BB08-116E-4EAA-AF3B-8035FB161FE1","f1_reflectivity":"9771051F-5CD4-41D0-A8CD-9F1B5659B460"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F3A95CF1-AA11-470A-968A-0CD09D773614","fragment":"F3A95CF1-AA11-470A-968A-0CD09D773614"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"4CEE8081-DF9A-414C-B952-00D0F42060E6","name":"Base State","position":[-76.94465201665992,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"076DE6C8-D4DC-4174-A23C-36ED7734D7A2","f1_mode":"228157DE-5545-46D7-840A-DD2BBAD14B21","f1_shininess":"A7A1D8DE-603F-414F-ACE7-066729BBD213","f1_specular":"8E9950D7-27D0-4AD0-B267-52FE2F73E7B6"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F3CD8EB2-86FC-4547-8FBC-54BDC5056E18","f2_ior":"3F97E63A-3B39-40BC-BE21-97598C35C623","f2_roughness":"19788376-754C-4F6F-9D59-7AB63089EB41","f2_transmissionSamplerSize":"6B66BCC1-6B0F-4435-A73A-1CA01438249F","f2_aspectRatio":"35B5C7A5-CF17-41D2-A5CE-BD25CA753D12","f2_alpha":"27A45324-0559-4BB5-86A7-E37230246ADF","f2_mode":"AC3BC57B-2148-48B5-9313-B80727EC58A6"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"CF035C46-BB20-48BE-B39D-D661D22A10B6","f4_far":"05E8E1D4-1F24-496D-B62A-5C8205E9416C","f4_isVector":"02FADAEF-CDAF-4F64-9F8B-DD2484BDFD82","f4_isWorldSpace":"FF0AD8D9-253A-4849-AFC6-1EA83069A679","f4_origin":"0C712F57-45E9-4C8D-99F4-B5B7ADB0DE6C","f4_colorA":"7EF889E4-42A2-47A9-B707-B29182C91CF9","f4_colorB":"893C1E2C-D30E-48BC-B06F-A8681A84CBD9","f4_alpha":"1282F1B8-4096-4041-95D3-9873793ED3CB","f4_mode":"70C3185D-4087-4836-9700-B547F5FCD90B"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8D317E8B-F2E1-4179-AF03-4D2A7AD0E36E","f3_bias":"0DDBB0C3-978C-47E1-8633-6CC1BFD930C0","f3_scale":"57D4A62A-BD5F-4F34-A25C-1B0F8E09FBFC","f3_intensity":"BEDA98AC-C38B-4BB2-9022-B4569BD807A9","f3_factor":"CEBFF218-B63B-4C6A-AB09-94C46937541A","f3_alpha":"CDA91738-2E72-4735-A869-A0D92F97BE74","f3_mode":"397628B0-0B72-46C2-BE8C-D16D933C6EE5"}}]}},{"uuid":"88B965DB-8CFD-472C-87A2-B0F3AEAA8088","name":"State 1","position":[-76.94465201665992,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2BA4FA9E-62E1-42CA-BCA1-BE8AD010C528","f1_mode":"5F2A7192-588B-4916-AAA2-5DF155DCF6CC","f1_shininess":"A72A8069-01FA-49A4-B50A-B4F6C4F9EAB0","f1_specular":"0A3F2CC3-EBF0-4006-8D00-68821E82BD8B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"CE7D1BEE-4B27-41C3-B3E0-1A5463491B26","f2_ior":"6F76A245-93D3-4DA9-B8EF-103098FB8055","f2_roughness":"CA710880-10DF-435D-94DF-BA571273CB83","f2_transmissionSamplerSize":"9B468899-3BE5-4384-BD12-08033BB13DA3","f2_aspectRatio":"50427B51-5DCE-41DD-B2E3-0755BF8EB6D7","f2_alpha":"7BEBB23C-E87E-4D9F-80D7-4B237CCE8982","f2_mode":"DC35844F-5D93-4062-A942-63398A1E0D1E"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"1CF87229-BB3F-4FE9-93D6-6FAA48B7A5E7","f4_far":"39AFC4D0-197C-483B-8614-74C8D4F22599","f4_isVector":"97E6E31A-68CB-4337-AC60-245BFC608812","f4_isWorldSpace":"D77E7C22-F338-4E49-A4B1-129902C675D1","f4_origin":"0EF65E4F-AAA1-4C4B-9A49-8289E0234232","f4_colorA":"7580FE80-DA4D-4B5F-A919-4E0B1FA701C4","f4_colorB":"A3C85F9D-E5B1-48AA-87AB-E094C79BB4DA","f4_alpha":"89F7478B-3222-4548-9244-73EA1B81402F","f4_mode":"5987F069-7123-4CFF-AD43-AE005F8A38CF"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"11EB9146-1FA5-4A06-B6A7-959BEEE97E6A","f3_bias":"64AA20C3-3F3E-4D89-B2E9-2AD3628D2FEB","f3_scale":"CA7C445D-0274-4DB7-ACED-707C99983087","f3_intensity":"946280B1-DD3D-49D9-8DE4-A32EAF8A87E8","f3_factor":"9E57C2BD-2543-4BC6-8CEE-0F7D18DF1737","f3_alpha":"2002865A-EBAB-4F98-9189-1C2A3DADBD2C","f3_mode":"9FA87C49-666F-4DD6-99A3-E57336C015BE"}}]}},{"uuid":"3BD078E5-F937-410A-A7F9-5C1BA96929C4","name":"Base State","position":[-478.5504910358467,-191.02719312096582,278.982102766933],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F67C6456-A5D8-4550-AF3B-BA9E7EB48BF1","f1_mode":"6818AC5B-9E2E-4DE5-AA82-97CB4DAB6A89","f1_shininess":"F4D87438-92BE-47F8-B1F4-B9D90CC9CEA7","f1_specular":"5A71AFD3-9498-483E-BFEB-0F521063F1E4"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F0A7714E-AFDB-4C72-8A8D-59990FB89DE3","f2_ior":"010B9DFB-4DCD-4DBF-A0EC-8B545BB7D845","f2_roughness":"D49FBAFB-27AA-4AAD-AD6A-21615C233F62","f2_transmissionSamplerSize":"11F4950B-1F82-4D66-9393-2CC467B36616","f2_aspectRatio":"2D798B44-82C7-4E93-B147-EB4E77A8A6E1","f2_alpha":"B1CC2FF6-34A8-460D-B9EF-5B4755E60560","f2_mode":"C8F26C43-3739-4EB8-AF2D-0E4C2E8E10E3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"87631E6B-3BFC-4096-9B7B-FB102483E714","f4_far":"C22A6A65-6838-4118-B4EB-1B3F82A85566","f4_isVector":"9CC02A17-7326-4A48-BB55-B3A14B83A54C","f4_isWorldSpace":"3DC30272-B2EE-4C67-B428-6C4F13E44022","f4_origin":"B1D0D335-9CC1-42D9-BE79-E3338EDBA02D","f4_colorA":"E0382A6E-A9AA-4817-B8B5-8FE5125D387B","f4_colorB":"1ED7F411-F2F5-4C93-90BE-DFCAE07D04A9","f4_alpha":"E0971B93-1DF0-4134-BC23-A4199F28B662","f4_mode":"EF551583-518E-41C8-9F31-2FE459D3D781"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E7E9BB91-94A4-405A-BDE6-52B40BF2DDE8","f3_bias":"3C2EA942-E279-4A5B-9C7C-9F17B2FD6F95","f3_scale":"ED7ADAF5-FAD2-4D1D-90F5-31204DE63D1B","f3_intensity":"8B135DFD-3195-417F-AFD0-5DFA5AE52528","f3_factor":"74F294E8-8FF6-4287-B4CA-7315EB692064","f3_alpha":"B1198DA9-59C3-4461-A516-D4DBD9357F56","f3_mode":"1C99C303-2C32-4D43-972C-B80B694C9B7C"}}]}},{"uuid":"13F94928-847A-4DB1-BE0C-68860304FC35","name":"State 1","position":[-478.5504910358467,-191.02719312096582,278.982102766933],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"A8BF9EA3-0FC3-4258-B46B-BC41E927F9ED","f1_mode":"60761C9C-DA66-4B6A-AE1F-EB30939AE013","f1_shininess":"6665BD90-74F2-41B9-8666-1B2ADCFB977D","f1_specular":"6E8AB860-0D3B-4A9B-8D4C-909DC50B0CE5"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"3B5A9266-1F4E-4D93-A651-4D068813AE51","f2_ior":"EDB07D21-CB73-4D96-B676-1DAC4558E619","f2_roughness":"2AB39420-9C11-45F7-9B8A-41F99B6FF1C0","f2_transmissionSamplerSize":"A5AE916A-7A81-4B17-8F68-5A1A7DC62F32","f2_aspectRatio":"3BF337B6-2971-4410-8388-B0E48C2406B2","f2_alpha":"C8A2EB32-72BF-4D39-99AE-63678D291199","f2_mode":"DE6ED891-084B-458C-A94E-AF0993EA69CF"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"9849970A-EDB7-4C33-B8E9-13A5C9615E73","f4_far":"272201C2-A3D5-4463-91BF-8029BFB92F95","f4_isVector":"7F36C1FC-C078-4509-8C0A-B5B301A9F93A","f4_isWorldSpace":"3EA35D16-6670-481F-BB48-89740FC356EC","f4_origin":"B726EDC4-97CC-4164-9FDA-A9AF221D805A","f4_colorA":"B79F2B29-9E15-4FBC-B192-E6AC01571E91","f4_colorB":"0031A7BD-CCE0-4C72-A121-FED02D3C15B5","f4_alpha":"59E02749-2322-44EE-ADA7-7F50B5282CE5","f4_mode":"9E66A8FA-6FB9-48A7-94FE-2D57D3793C19"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"2B943158-1916-4A4D-9413-39BF15988AF9","f3_bias":"934D8F8C-F90F-4D88-89A1-A5E1E5DE551B","f3_scale":"2A884FEF-AEED-4223-B537-9336D7ACD479","f3_intensity":"338503D5-4866-4888-BE59-B7A25F727505","f3_factor":"928A71EE-208B-477B-9001-443DDE784529","f3_alpha":"79E6C128-21BD-4891-9E8C-23F67C12C359","f3_mode":"23F1373E-252C-4975-B13C-8A1384EC9724"}}]}},{"uuid":"0673B2F2-9E0D-41DD-AD10-35580FFD0702","name":"Base State","position":[104.97217124530464,-175.33267147612932,156.21358813721042],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B8D2E41C-CA21-4A35-BC8D-64977D33B61D","f1_mode":"FF01EB8A-F551-4A6D-802F-4927535DEDE0","f1_shininess":"8C3CD481-16E4-4B6A-9E9C-E084EDF11418","f1_specular":"57E14B37-6F01-4998-94EA-A18584A6245F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"958A4F90-C5B2-4CAC-A378-BE2DC8A3AA65","f2_ior":"33A2E051-12C9-4ABD-8B45-9B29F90208E9","f2_roughness":"0C3BBE46-0FBE-48A8-9EB9-76612DCE4DDE","f2_transmissionSamplerSize":"52514616-39FA-4AD5-8551-E12170C3B54C","f2_aspectRatio":"88167729-BDEB-470D-8BFD-E1DB550202FD","f2_alpha":"81243666-864D-4258-841F-909C9EDB710B","f2_mode":"02BC9E96-1575-4817-A2D6-A1B07DE2DD98"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"29109E3C-D65E-43CF-9E54-CD9C1F20E743","f4_far":"8A013D1A-14E4-4453-93FB-F5A3667FFA43","f4_isVector":"5E70D1CF-E67C-45FF-B62F-528B189AF378","f4_isWorldSpace":"DFDF411C-B54A-433E-9DDA-CC0CD01AD05A","f4_origin":"F2C0012F-A9D0-4321-BAAC-4873A7DFDC81","f4_colorA":"546DE858-9BE1-4E14-B658-B357F3FF72B9","f4_colorB":"0EB9AA69-EF54-4AA8-A0C5-4051CDCF5C1F","f4_alpha":"9DE72681-A200-4ECF-9737-EDE2E44779DF","f4_mode":"7BC7A283-C84C-4538-9136-29D24FFD294D"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"EB2A64E9-E1B3-4854-A8FC-19E99C835173","f3_bias":"36281681-96F5-4739-B373-3E616BA195EE","f3_scale":"1E94F580-7462-4B54-BDD1-CE6B10A77CB7","f3_intensity":"934CA396-701E-4719-B21F-5A166444863D","f3_factor":"76234F90-E1DF-43C5-831B-910E129639C2","f3_alpha":"E4A3243E-FA5D-4801-AC9A-382920501038","f3_mode":"4F1579B9-EC89-4A77-BECD-F4719A42024B"}}]}},{"uuid":"232ABFB9-00BC-49C7-8037-979EA4364C0B","name":"State 1","position":[104.97217124530464,-175.33267147612932,156.21358813721042],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0CCACD3C-0D48-4771-B590-DA5643665506","f1_mode":"63A7E6E2-D622-4E8F-BA1A-3C10977C88D3","f1_shininess":"A689CA10-0FA6-40CB-9F3A-FAEB2604F633","f1_specular":"F2718D21-4101-42B2-9D23-FD3D140F6805"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"9D41B1F7-07F2-4EF6-979E-6F0D28B8CEEF","f2_ior":"4F1299CA-3ECE-4D3A-B928-FDADDCABF879","f2_roughness":"88687C90-7391-4350-84B2-44A21FE43AE2","f2_transmissionSamplerSize":"20C7DDD0-799C-410E-8557-925D3B8FE8CD","f2_aspectRatio":"6B4292A5-021E-4C69-B41F-5536BFC64500","f2_alpha":"43E7DF97-4BDE-4CB1-8924-C42249B1AE37","f2_mode":"633B8AA4-94C6-4ED9-A7EE-2F29A358BBA2"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"7D068AB4-9253-4DDF-82EF-70AAE0239E85","f4_far":"3E18C830-B21A-48EC-BC3A-C1C2185383A2","f4_isVector":"208A2170-692D-4425-93E9-1A42BB7799BA","f4_isWorldSpace":"389434E4-A7D3-488A-8E3C-C1493DAA6EDC","f4_origin":"0A05EB10-A148-419C-BF4E-85EC0FDFC0F8","f4_colorA":"3497868E-5605-4EDD-B9B5-338E97D36798","f4_colorB":"C31B42F4-7B5E-4D51-80F1-AA0545DF58F7","f4_alpha":"7A606DCF-7E27-4F87-8C67-ACAE799C8115","f4_mode":"DA50B5D6-F8FA-4EBF-909C-8801DE2DE951"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A6A05B03-46B5-42F1-8B20-27946E5FFFD2","f3_bias":"8DBDD181-6CF0-4665-B211-F11D261C2F6B","f3_scale":"88D29D32-7D23-40E6-A0CA-AFA4AAC94997","f3_intensity":"DD54F65C-6312-4BF9-8094-92851FCA526C","f3_factor":"1E275D66-1B3B-4A84-B174-68BB401A2B1F","f3_alpha":"78397018-BF8C-4F58-B1A4-5D58BF7F3DDF","f3_mode":"69139A33-9A66-49A1-A05D-3C622DEC36D5"}}]}},{"uuid":"B0FD718F-8EEA-41BB-8737-77F027FCD758","name":"Base State","position":[-180.82350074513494,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"338759F3-DE8F-4792-B8B7-82BD2D53AAB8","f1_mode":"5B148228-F919-4C6C-A769-78B0525C20F5","f1_shininess":"63528C74-2B3D-4114-A404-E812F03509FE","f1_specular":"CFE3310B-3B53-4E6B-A8A8-9A741A829912"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"EB3A0510-F064-457A-A8BB-859E550AD2CF","f2_ior":"4A66CC74-ECC6-49CD-8507-603AEAB48282","f2_roughness":"41E6EF3C-236E-405B-BAFF-79DADD3054EE","f2_transmissionSamplerSize":"65548A06-D0CF-4600-8575-21A521A95A35","f2_aspectRatio":"03F84392-F473-4F5D-859D-DB6C0787B5B2","f2_alpha":"6713B36D-B630-4D84-AF1F-203E3C7AE2A4","f2_mode":"82114C5B-FD78-4281-B8CA-83A6DC0BA4C9"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"5EF27140-D173-4561-A4BC-1213422E4253","f4_far":"D844482C-9DF6-4331-923E-E3144AD01200","f4_isVector":"F7BE076F-4B35-4CC9-8983-7A63ADB5F07C","f4_isWorldSpace":"759D54A5-BCAD-4607-8F99-4405031B5983","f4_origin":"F6ACDBFD-B35C-4127-9D8B-6A54CAF28A16","f4_colorA":"C9E42326-BA05-47ED-9763-EA40978481E1","f4_colorB":"2FD43EB9-DFC7-4DB7-B0CA-F876C5AB1B23","f4_alpha":"D8D556B9-A8F4-45CE-A297-66E6A3DFC8FA","f4_mode":"5DC385B3-D171-4EA0-8A61-D2969A30987B"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A9CA96B9-4152-46E3-847F-E5B8F6788A20","f3_bias":"8C75265E-5074-4256-A55F-119AAD36849B","f3_scale":"23A2C60B-010F-4646-99DA-FE6111CABE2F","f3_intensity":"C72B9FAD-BCEE-40DC-A9C2-DB45DDB38777","f3_factor":"1AD3F4BF-BE02-4C97-9519-D982EC3EA963","f3_alpha":"BE452D3E-B927-4F80-A6E2-268DFC3E2B73","f3_mode":"9E469AB1-BD8C-439C-84A3-0CEF11450FFA"}}]}},{"uuid":"8B021AA7-3767-4FE4-A69E-24708D8A52D3","name":"State 1","position":[-180.82350074513494,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4762DB36-093C-47C9-9C47-FB51415DF038","f1_mode":"704C2251-9C97-4EA7-8CDE-B7F03A8148CA","f1_shininess":"309169A2-A4EA-4E3A-BA5D-3405188781B3","f1_specular":"43A17F17-0407-4126-82E9-C0B025D6C284"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"891AF670-F853-4C08-8466-4D7A98E6133E","f2_ior":"79C8A178-AADD-4493-A0C8-D4DB8835828C","f2_roughness":"8B64A512-6A41-4A2B-BC51-7BE7BADCA091","f2_transmissionSamplerSize":"DABC801B-ED0F-4F7C-9E28-7E28F0C8B42C","f2_aspectRatio":"D396766D-44AB-49E3-9484-A4E4D986D36A","f2_alpha":"82EABFCF-A271-4F74-83AB-873A8E8A0909","f2_mode":"96416FF8-7CF0-49CF-BCEE-D969A741E875"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"70F741F1-8944-46E8-8E01-D79E59367E5A","f4_far":"322023DD-AAF0-4FD2-8869-4CCB33B18283","f4_isVector":"5D0E0766-8696-49A6-A442-6B928D566772","f4_isWorldSpace":"91A025A9-C956-44BE-AC8F-31812BD77AA9","f4_origin":"80B62168-C3DA-46A3-B746-7FD76A2DB2C1","f4_colorA":"8F203C51-7467-402A-9259-5AD27251A441","f4_colorB":"0D08F594-6FF4-4CE2-8F8A-9A1183133C31","f4_alpha":"42571B81-D901-435C-8681-B37EA4E91DF0","f4_mode":"C1716E6E-E0AE-4EEE-B9BB-AB5D761D2008"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"0738AA51-CC00-423F-8803-73CA72C98F4C","f3_bias":"19D94D0A-5B2A-4268-A70C-4851FC522C47","f3_scale":"C51709F5-91D1-4C7B-9F44-7CDE0FAA52AD","f3_intensity":"28A9C1E7-9A12-4807-8F28-D9A7DA93074D","f3_factor":"EE2C129D-ABCF-4205-AF0B-686F99820526","f3_alpha":"95788003-B732-467E-934C-31740256490B","f3_mode":"F5714D84-7CA2-46B1-831B-9ED75679C0CD"}}]}},{"uuid":"8A056A08-77F3-437B-9228-2A7A16DFBF8A","name":"Base State","position":[109.51129684329464,-121.3895460375428,21.17660453440807],"rotation":[2.7925268031909254,0,0,"XYZ"],"scale":[1,0.9999999999999993,0.9999999999999991],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"54B98CE6-33D1-4140-B6AF-CA7DC38B20DC","f0_alpha":"1A233435-AFFF-4638-B310-8914F1599DD5","f0_mode":"F5B7ED3B-2F5D-4776-B9BC-9B70D6AD17ED"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"54410F37-8658-4D99-BFCD-2451FC3ECBB6","f1_mode":"F69D921C-0B7F-4D2C-B166-D04908FAC661"}}]}},{"uuid":"3A18B19F-A3CD-4A64-A6B2-748864F843DE","name":"State 1","position":[109.51129684329464,-121.3895460375428,21.17660453440807],"rotation":[-0.34906585039886795,0,0,"XYZ"],"scale":[1,1.000000000000002,1.000000000000002],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"8960D86C-1A2C-4200-B192-7A3400C2A634","f0_alpha":"D71E7A95-78C7-4811-930C-41EE6D2067C8","f0_mode":"4DBEDC00-A4E7-401A-BEAE-2F25B28F82E6"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"323A7ADA-E4BD-44CE-B3D0-F46EBD6010FF","f1_mode":"A9952045-9CCD-4E74-9E68-AE1EDA638C87"}}]}},{"uuid":"907C1AA9-85E9-411C-BD55-6D2BB1B1C1EE","name":"Base State","position":[10.534771456721458,-122.15293403303363,17.637833140228576],"rotation":[2.792526803190926,0,0,"XYZ"],"scale":[1,1.0000000000000024,1.0000000000000024],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"0E5F2DA9-D6EF-4895-BE2F-05C3BF640A09","f0_alpha":"8FB989C1-02D9-4A7A-A72C-23697E303C2F","f0_mode":"BD735F99-8D19-4771-8CBE-EDAE86271E1C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4A169697-BE84-4BD4-BEF8-2E1C5727CA64","f1_mode":"E4B0A40A-98B8-4222-BA8D-56F59EAF6318"}}]}},{"uuid":"FA4C95D1-10CC-46FD-BA50-13119F236723","name":"State 1","position":[10.534771456721458,-122.15293403303363,17.637833140228576],"rotation":[-0.34906585039886745,0,0,"XYZ"],"scale":[1,1.0000000000000093,1.0000000000000093],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"B3EFEE34-2218-423D-8987-06AC2655C002","f0_alpha":"DA4FB767-317B-44B7-9BD4-EF9E7B2D6D94","f0_mode":"DEE75BE5-0142-4770-9FB5-F75A4A80B00F"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"57AA5C79-1ECD-41F9-B4EE-F5BABA49C69E","f1_mode":"B602897F-F9CA-4F9C-91E2-FFAAA8652BE2"}}]}},{"uuid":"035117A6-16BB-479C-AA37-3EAFBC4DAAED","name":"Base State","position":[-92.46522854327877,-73.79488051928482,4.26206273772965],"rotation":[-0.3490658503988659,-2.4492935982947064e-16,-1.2246467991473532e-16,"XYZ"],"scale":[1.000000000000012,1,1.000000000000012],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":110,"height":200,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"765B2627-0077-4492-AAE9-4A40D997FA3E","f0_alpha":"4492C524-65EA-4CC1-9F2B-460AD2875D22","f0_mode":"0948E92C-E2D0-467F-8F83-EEBBC8116720"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E39AACE9-8D25-440F-9906-81CB93C6CC8E","f1_mode":"2D657BD2-4E14-4C7B-A20E-80F818ABAE0F"}}]}},{"uuid":"3A86C3B9-4C99-4202-BEB0-B2C431A482DF","name":"State 1","position":[-92.46522854327877,-73.79488051928482,4.26206273772965],"rotation":[2.792526803190927,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.000000000000045,0.9999999999999991,1.0000000000000402],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":110,"height":200,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"EC1B5601-1463-4884-812E-B0C48A820905","f0_alpha":"4AA5036A-A555-4B32-BB0B-68E6BBA6A989","f0_mode":"9DDC6267-B1B0-45CD-85FA-DE88193D45C9"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B3FE3918-7C5C-41EF-9610-E4BC06C20A50","f1_mode":"B0EE24B4-320D-4F7D-81F1-FF49B6A711EF"}}]}},{"uuid":"CAC32034-FC42-4F56-9BA1-B4CC0A4E779F","name":"Base State","position":[60.53477145672121,-27.242356786268587,-12.710181232475918],"rotation":[2.792526803190926,0,0,"XYZ"],"scale":[1,1.0000000000000093,1.0000000000000084],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":200,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"E4DD08A8-826D-48F9-9B62-1A5FA139E376","f0_alpha":"1D9E5F64-361E-4B4D-8CE8-0C4FE00EA272","f0_mode":"E3058ACF-A539-406F-9963-756D77CDC5BE"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0A62DED6-83F6-4929-B09F-9667AAE5989B","f1_mode":"C2E9721D-B592-49DD-87D6-E1C49A2C4254"}}]}},{"uuid":"BB63C07E-8221-497A-B065-F19CE4FA1F94","name":"State 1","position":[60.53477145672121,-27.242356786268587,-12.710181232475918],"rotation":[-0.34906585039886745,0,0,"XYZ"],"scale":[1,1.0000000000000162,1.0000000000000162],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":200,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"78ABEB2C-959C-4932-96D1-76D5BE88B7B8","f0_alpha":"9219D716-3342-44C0-BF97-F8D68B2781D0","f0_mode":"6D2799B0-6FC9-4DD8-B017-59D0A10567D9"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C7FA3D6D-143E-40BE-A15C-18C30C4502FB","f1_mode":"98E2A874-4D55-4928-80D4-0A1C6F1D838C"}}]}}],"nodes":[{"uuid":"076DE6C8-D4DC-4174-A23C-36ED7734D7A2","type":"f","value":1,"nodeType":"Float"},{"uuid":"228157DE-5545-46D7-840A-DD2BBAD14B21","type":"i","value":0,"nodeType":"Int"},{"uuid":"A7A1D8DE-603F-414F-ACE7-066729BBD213","type":"f","value":30,"nodeType":"Float"},{"uuid":"8E9950D7-27D0-4AD0-B267-52FE2F73E7B6","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"F3CD8EB2-86FC-4547-8FBC-54BDC5056E18","type":"f","value":10,"nodeType":"Float"},{"uuid":"3F97E63A-3B39-40BC-BE21-97598C35C623","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"19788376-754C-4F6F-9D59-7AB63089EB41","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"6B66BCC1-6B0F-4435-A73A-1CA01438249F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"35B5C7A5-CF17-41D2-A5CE-BD25CA753D12","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"27A45324-0559-4BB5-86A7-E37230246ADF","type":"f","value":1,"nodeType":"Float"},{"uuid":"AC3BC57B-2148-48B5-9313-B80727EC58A6","type":"i","value":0,"nodeType":"Int"},{"uuid":"CF035C46-BB20-48BE-B39D-D661D22A10B6","type":"f","value":50,"nodeType":"Float"},{"uuid":"05E8E1D4-1F24-496D-B62A-5C8205E9416C","type":"f","value":118,"nodeType":"Float"},{"uuid":"02FADAEF-CDAF-4F64-9F8B-DD2484BDFD82","type":"f","value":1,"nodeType":"Float"},{"uuid":"FF0AD8D9-253A-4849-AFC6-1EA83069A679","type":"f","value":0,"nodeType":"Float"},{"uuid":"0C712F57-45E9-4C8D-99F4-B5B7ADB0DE6C","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7EF889E4-42A2-47A9-B707-B29182C91CF9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"893C1E2C-D30E-48BC-B06F-A8681A84CBD9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"1282F1B8-4096-4041-95D3-9873793ED3CB","type":"f","value":1,"nodeType":"Float"},{"uuid":"70C3185D-4087-4836-9700-B547F5FCD90B","type":"i","value":2,"nodeType":"Int"},{"uuid":"8D317E8B-F2E1-4179-AF03-4D2A7AD0E36E","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"0DDBB0C3-978C-47E1-8633-6CC1BFD930C0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"57D4A62A-BD5F-4F34-A25C-1B0F8E09FBFC","type":"f","value":1,"nodeType":"Float"},{"uuid":"BEDA98AC-C38B-4BB2-9022-B4569BD807A9","type":"f","value":2,"nodeType":"Float"},{"uuid":"CEBFF218-B63B-4C6A-AB09-94C46937541A","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"CDA91738-2E72-4735-A869-A0D92F97BE74","type":"f","value":1,"nodeType":"Float"},{"uuid":"397628B0-0B72-46C2-BE8C-D16D933C6EE5","type":"i","value":2,"nodeType":"Int"},{"uuid":"2BA4FA9E-62E1-42CA-BCA1-BE8AD010C528","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F2A7192-588B-4916-AAA2-5DF155DCF6CC","type":"i","value":0,"nodeType":"Int"},{"uuid":"A72A8069-01FA-49A4-B50A-B4F6C4F9EAB0","type":"f","value":30,"nodeType":"Float"},{"uuid":"0A3F2CC3-EBF0-4006-8D00-68821E82BD8B","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"CE7D1BEE-4B27-41C3-B3E0-1A5463491B26","type":"f","value":10,"nodeType":"Float"},{"uuid":"6F76A245-93D3-4DA9-B8EF-103098FB8055","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"CA710880-10DF-435D-94DF-BA571273CB83","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9B468899-3BE5-4384-BD12-08033BB13DA3","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"50427B51-5DCE-41DD-B2E3-0755BF8EB6D7","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"7BEBB23C-E87E-4D9F-80D7-4B237CCE8982","type":"f","value":1,"nodeType":"Float"},{"uuid":"DC35844F-5D93-4062-A942-63398A1E0D1E","type":"i","value":0,"nodeType":"Int"},{"uuid":"1CF87229-BB3F-4FE9-93D6-6FAA48B7A5E7","type":"f","value":50,"nodeType":"Float"},{"uuid":"39AFC4D0-197C-483B-8614-74C8D4F22599","type":"f","value":118,"nodeType":"Float"},{"uuid":"97E6E31A-68CB-4337-AC60-245BFC608812","type":"f","value":1,"nodeType":"Float"},{"uuid":"D77E7C22-F338-4E49-A4B1-129902C675D1","type":"f","value":0,"nodeType":"Float"},{"uuid":"0EF65E4F-AAA1-4C4B-9A49-8289E0234232","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7580FE80-DA4D-4B5F-A919-4E0B1FA701C4","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A3C85F9D-E5B1-48AA-87AB-E094C79BB4DA","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"89F7478B-3222-4548-9244-73EA1B81402F","type":"f","value":1,"nodeType":"Float"},{"uuid":"5987F069-7123-4CFF-AD43-AE005F8A38CF","type":"i","value":2,"nodeType":"Int"},{"uuid":"11EB9146-1FA5-4A06-B6A7-959BEEE97E6A","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"64AA20C3-3F3E-4D89-B2E9-2AD3628D2FEB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"CA7C445D-0274-4DB7-ACED-707C99983087","type":"f","value":1,"nodeType":"Float"},{"uuid":"946280B1-DD3D-49D9-8DE4-A32EAF8A87E8","type":"f","value":2,"nodeType":"Float"},{"uuid":"9E57C2BD-2543-4BC6-8CEE-0F7D18DF1737","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"2002865A-EBAB-4F98-9189-1C2A3DADBD2C","type":"f","value":1,"nodeType":"Float"},{"uuid":"9FA87C49-666F-4DD6-99A3-E57336C015BE","type":"i","value":2,"nodeType":"Int"},{"uuid":"4C7C09F8-A7E3-4325-8425-501F8D0972FD","type":"f","value":1,"nodeType":"Float"},{"uuid":"54D3AA48-F20F-4A4C-8EAD-1EE352755D06","type":"i","value":0,"nodeType":"Int"},{"uuid":"5B2BCDC1-8970-4751-9DB6-81DF9575A145","type":"f","value":30,"nodeType":"Float"},{"uuid":"0E334D1D-057F-4BDB-ADFF-7650EEAF677C","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"0CBC992A-073A-4D55-A2DB-15AE5A4F0256","type":"f","value":10,"nodeType":"Float"},{"uuid":"F369DD01-A123-4387-A0C5-4D56CD7857B6","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"6D8B3057-AC63-4A37-A446-5132E21BDFF4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FF2FCCC6-45B0-4010-B1EE-7DCF37230444","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"0371800A-53CD-43E4-82EE-FFAFDC302125","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"0020408A-04DD-4B2D-A114-6BF629E664CE","project":false,"nodeType":"Texture"},{"uuid":"0020408A-04DD-4B2D-A114-6BF629E664CE","type":"v2","index":0,"nodeType":"UV"},{"uuid":"77252A84-303E-4D52-9555-953C5860E242","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"6276464F-DD60-4062-9C95-7683E0E04491","project":false,"nodeType":"Texture"},{"uuid":"6276464F-DD60-4062-9C95-7683E0E04491","type":"v2","index":0,"nodeType":"UV"},{"uuid":"64F07E20-71FB-4C09-A60C-F07A257A3360","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"EDCDEAED-37ED-4616-A3EE-8EE9453BFD5C","type":"f","value":1,"nodeType":"Float"},{"uuid":"73952214-D566-4C2F-A067-E9CBC9BA5181","type":"i","value":0,"nodeType":"Int"},{"uuid":"11B9E4D1-06F9-4B01-97FF-DB1BBECE2145","type":"f","value":50,"nodeType":"Float"},{"uuid":"5324F074-49CE-4315-AB55-A3F71079B76A","type":"f","value":118,"nodeType":"Float"},{"uuid":"5E7A8CB2-5BF4-41F6-A001-36D4F308A85B","type":"f","value":1,"nodeType":"Float"},{"uuid":"0DCC7C89-2CB7-4644-AA7A-75B86F9FC54B","type":"f","value":0,"nodeType":"Float"},{"uuid":"8837FB37-2FCA-436B-85F1-229F99DAEDB9","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"36EF51BD-25F1-4F97-8B34-042FBEF835E7","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"79EC7AF5-AC52-4A44-A0E0-3481DB414B28","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"6149AF19-6E47-4C86-82C9-3C7E47CABBDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"C1A48DC3-51D3-49B6-ABE8-0720D323397C","type":"i","value":2,"nodeType":"Int"},{"uuid":"4AEF29D0-4D24-42A9-A44D-31EBC4B303A0","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"74387971-BF18-4BB1-8D5D-1A47D2E8F29F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9DACAF97-4147-47A8-84F0-BD5D1075537D","type":"f","value":1,"nodeType":"Float"},{"uuid":"DBA8C84E-C550-4A51-946B-4FB5674F7250","type":"f","value":2,"nodeType":"Float"},{"uuid":"E4685397-F0DF-473F-99B9-CD2499142757","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"5C0B2DDD-AFE6-47D2-B7A4-3E73B7C454FD","type":"f","value":1,"nodeType":"Float"},{"uuid":"B3B56A54-0A96-46AC-830C-FB991C0D65BB","type":"i","value":2,"nodeType":"Int"},{"uuid":"27AFC4DB-9892-490C-BC70-52A987C47421","type":"phong","color":"69E9C044-5B43-4195-BBAE-1DCC210B11C8","specular":"0E334D1D-057F-4BDB-ADFF-7650EEAF677C","shininess":"5B2BCDC1-8970-4751-9DB6-81DF9575A145","shadingAlpha":"4C7C09F8-A7E3-4325-8425-501F8D0972FD","shadingBlend":"54D3AA48-F20F-4A4C-8EAD-1EE352755D06","afterColor":"38BB4C4F-A6EF-4BD6-880D-585D3B05AF16","alpha":"8516CE4A-F0BF-49BC-9555-145C932821AA","nodeType":"Phong"},{"uuid":"69E9C044-5B43-4195-BBAE-1DCC210B11C8","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"38BB4C4F-A6EF-4BD6-880D-585D3B05AF16","type":"v3","a":"44CB956E-7F4E-448D-B4A2-E499BCC89D4A","b":"83006E63-4C5C-48FE-AEBE-62EA6A5F2AA1","alpha":"A6567718-CB03-455C-88DF-2A8093568A96","mode":"B3B56A54-0A96-46AC-830C-FB991C0D65BB","nodeType":"Blend"},{"uuid":"44CB956E-7F4E-448D-B4A2-E499BCC89D4A","type":"v3","a":"0943AA14-F81E-4533-8FC4-CB6FFED924A3","b":"17219790-F6A6-46FD-9BF6-004039066AA0","alpha":"36E80247-8CCE-457D-AEF6-490DCC922A16","mode":"C1A48DC3-51D3-49B6-ABE8-0720D323397C","nodeType":"Blend"},{"uuid":"0943AA14-F81E-4533-8FC4-CB6FFED924A3","type":"v3","a":"D23A19E1-3913-4603-855E-A8CBA42CF05B","b":"342F4B2F-7F47-41B3-ADF9-064A9E55B236","alpha":"E089EB8C-DF60-47CA-B38D-F8FCCF742B51","mode":"73952214-D566-4C2F-A067-E9CBC9BA5181","nodeType":"Blend"},{"uuid":"D23A19E1-3913-4603-855E-A8CBA42CF05B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"342F4B2F-7F47-41B3-ADF9-064A9E55B236","type":"v3","thickness":"0CBC992A-073A-4D55-A2DB-15AE5A4F0256","ior":"F369DD01-A123-4387-A0C5-4D56CD7857B6","roughness":"6D8B3057-AC63-4A37-A446-5132E21BDFF4","alpha":"EDCDEAED-37ED-4616-A3EE-8EE9453BFD5C","calpha":"g342F4B2F7F4741B3ADF9064A9E55B236_calpha","nodeType":"Transmission"},{"uuid":"E089EB8C-DF60-47CA-B38D-F8FCCF742B51","type":"f","src":"g342F4B2F7F4741B3ADF9064A9E55B236_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"17219790-F6A6-46FD-9BF6-004039066AA0","type":"v3","near":"11B9E4D1-06F9-4B01-97FF-DB1BBECE2145","far":"5324F074-49CE-4315-AB55-A3F71079B76A","isVector":"5E7A8CB2-5BF4-41F6-A001-36D4F308A85B","isWorldSpace":"0DCC7C89-2CB7-4644-AA7A-75B86F9FC54B","origin":"8837FB37-2FCA-436B-85F1-229F99DAEDB9","colorA":"36EF51BD-25F1-4F97-8B34-042FBEF835E7","colorB":"79EC7AF5-AC52-4A44-A0E0-3481DB414B28","alpha":"6149AF19-6E47-4C86-82C9-3C7E47CABBDC","nodeType":"Depth"},{"uuid":"36E80247-8CCE-457D-AEF6-490DCC922A16","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"6149AF19-6E47-4C86-82C9-3C7E47CABBDC"},"nodeType":"Expression"},{"uuid":"83006E63-4C5C-48FE-AEBE-62EA6A5F2AA1","type":"v3","color":"4AEF29D0-4D24-42A9-A44D-31EBC4B303A0","bias":"74387971-BF18-4BB1-8D5D-1A47D2E8F29F","scale":"9DACAF97-4147-47A8-84F0-BD5D1075537D","intensity":"DBA8C84E-C550-4A51-946B-4FB5674F7250","factor":"E4685397-F0DF-473F-99B9-CD2499142757","alpha":"5C0B2DDD-AFE6-47D2-B7A4-3E73B7C454FD","mode":"B3B56A54-0A96-46AC-830C-FB991C0D65BB","calpha":"g83006E634C5C48FEAEBE62EA6A5F2AA1_calpha","nodeType":"Fresnel"},{"uuid":"A6567718-CB03-455C-88DF-2A8093568A96","type":"f","src":"g83006E634C5C48FEAEBE62EA6A5F2AA1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8516CE4A-F0BF-49BC-9555-145C932821AA","type":"f","value":1,"nodeType":"Float"},{"uuid":"F67C6456-A5D8-4550-AF3B-BA9E7EB48BF1","type":"f","value":1,"nodeType":"Float"},{"uuid":"6818AC5B-9E2E-4DE5-AA82-97CB4DAB6A89","type":"i","value":0,"nodeType":"Int"},{"uuid":"F4D87438-92BE-47F8-B1F4-B9D90CC9CEA7","type":"f","value":30,"nodeType":"Float"},{"uuid":"5A71AFD3-9498-483E-BFEB-0F521063F1E4","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"F0A7714E-AFDB-4C72-8A8D-59990FB89DE3","type":"f","value":10,"nodeType":"Float"},{"uuid":"010B9DFB-4DCD-4DBF-A0EC-8B545BB7D845","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D49FBAFB-27AA-4AAD-AD6A-21615C233F62","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"11F4950B-1F82-4D66-9393-2CC467B36616","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2D798B44-82C7-4E93-B147-EB4E77A8A6E1","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"B1CC2FF6-34A8-460D-B9EF-5B4755E60560","type":"f","value":1,"nodeType":"Float"},{"uuid":"C8F26C43-3739-4EB8-AF2D-0E4C2E8E10E3","type":"i","value":0,"nodeType":"Int"},{"uuid":"87631E6B-3BFC-4096-9B7B-FB102483E714","type":"f","value":50,"nodeType":"Float"},{"uuid":"C22A6A65-6838-4118-B4EB-1B3F82A85566","type":"f","value":118,"nodeType":"Float"},{"uuid":"9CC02A17-7326-4A48-BB55-B3A14B83A54C","type":"f","value":1,"nodeType":"Float"},{"uuid":"3DC30272-B2EE-4C67-B428-6C4F13E44022","type":"f","value":0,"nodeType":"Float"},{"uuid":"B1D0D335-9CC1-42D9-BE79-E3338EDBA02D","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"E0382A6E-A9AA-4817-B8B5-8FE5125D387B","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"1ED7F411-F2F5-4C93-90BE-DFCAE07D04A9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E0971B93-1DF0-4134-BC23-A4199F28B662","type":"f","value":1,"nodeType":"Float"},{"uuid":"EF551583-518E-41C8-9F31-2FE459D3D781","type":"i","value":2,"nodeType":"Int"},{"uuid":"E7E9BB91-94A4-405A-BDE6-52B40BF2DDE8","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"3C2EA942-E279-4A5B-9C7C-9F17B2FD6F95","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"ED7ADAF5-FAD2-4D1D-90F5-31204DE63D1B","type":"f","value":1,"nodeType":"Float"},{"uuid":"8B135DFD-3195-417F-AFD0-5DFA5AE52528","type":"f","value":2,"nodeType":"Float"},{"uuid":"74F294E8-8FF6-4287-B4CA-7315EB692064","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"B1198DA9-59C3-4461-A516-D4DBD9357F56","type":"f","value":1,"nodeType":"Float"},{"uuid":"1C99C303-2C32-4D43-972C-B80B694C9B7C","type":"i","value":2,"nodeType":"Int"},{"uuid":"A8BF9EA3-0FC3-4258-B46B-BC41E927F9ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"60761C9C-DA66-4B6A-AE1F-EB30939AE013","type":"i","value":0,"nodeType":"Int"},{"uuid":"6665BD90-74F2-41B9-8666-1B2ADCFB977D","type":"f","value":30,"nodeType":"Float"},{"uuid":"6E8AB860-0D3B-4A9B-8D4C-909DC50B0CE5","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"3B5A9266-1F4E-4D93-A651-4D068813AE51","type":"f","value":10,"nodeType":"Float"},{"uuid":"EDB07D21-CB73-4D96-B676-1DAC4558E619","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2AB39420-9C11-45F7-9B8A-41F99B6FF1C0","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A5AE916A-7A81-4B17-8F68-5A1A7DC62F32","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"3BF337B6-2971-4410-8388-B0E48C2406B2","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"C8A2EB32-72BF-4D39-99AE-63678D291199","type":"f","value":1,"nodeType":"Float"},{"uuid":"DE6ED891-084B-458C-A94E-AF0993EA69CF","type":"i","value":0,"nodeType":"Int"},{"uuid":"9849970A-EDB7-4C33-B8E9-13A5C9615E73","type":"f","value":50,"nodeType":"Float"},{"uuid":"272201C2-A3D5-4463-91BF-8029BFB92F95","type":"f","value":118,"nodeType":"Float"},{"uuid":"7F36C1FC-C078-4509-8C0A-B5B301A9F93A","type":"f","value":1,"nodeType":"Float"},{"uuid":"3EA35D16-6670-481F-BB48-89740FC356EC","type":"f","value":0,"nodeType":"Float"},{"uuid":"B726EDC4-97CC-4164-9FDA-A9AF221D805A","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"B79F2B29-9E15-4FBC-B192-E6AC01571E91","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"0031A7BD-CCE0-4C72-A121-FED02D3C15B5","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"59E02749-2322-44EE-ADA7-7F50B5282CE5","type":"f","value":1,"nodeType":"Float"},{"uuid":"9E66A8FA-6FB9-48A7-94FE-2D57D3793C19","type":"i","value":2,"nodeType":"Int"},{"uuid":"2B943158-1916-4A4D-9413-39BF15988AF9","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"934D8F8C-F90F-4D88-89A1-A5E1E5DE551B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2A884FEF-AEED-4223-B537-9336D7ACD479","type":"f","value":1,"nodeType":"Float"},{"uuid":"338503D5-4866-4888-BE59-B7A25F727505","type":"f","value":2,"nodeType":"Float"},{"uuid":"928A71EE-208B-477B-9001-443DDE784529","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"79E6C128-21BD-4891-9E8C-23F67C12C359","type":"f","value":1,"nodeType":"Float"},{"uuid":"23F1373E-252C-4975-B13C-8A1384EC9724","type":"i","value":2,"nodeType":"Int"},{"uuid":"1923B487-6256-4435-8461-59108C8CE963","type":"f","value":1,"nodeType":"Float"},{"uuid":"F8032A8F-9E4C-492F-B8E5-9C6584C25808","type":"i","value":0,"nodeType":"Int"},{"uuid":"A31FCB67-468F-4843-B3AE-1B5E6C96942B","type":"f","value":30,"nodeType":"Float"},{"uuid":"C9900111-9938-4F76-A2D0-A88593F4DD05","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"62896B31-61FD-4485-B95D-8369122ACBE5","type":"f","value":10,"nodeType":"Float"},{"uuid":"C13619ED-22E5-4C99-93F0-CE1DA504BDD7","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"98657F06-2375-4F40-8C33-1DA082DD5921","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"54C7052B-52D9-4AA3-8364-D6A95999E6A7","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"753C3F35-E67F-4A61-8045-37F4D0B478FD","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"9D0946C6-86E1-41F8-A725-B0EA435B08B0","project":false,"nodeType":"Texture"},{"uuid":"9D0946C6-86E1-41F8-A725-B0EA435B08B0","type":"v2","index":0,"nodeType":"UV"},{"uuid":"7B3BA6E4-FFA5-4654-874D-9C13A4507C15","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"6EE179B1-0F41-4E23-AEFC-32E5E2930737","project":false,"nodeType":"Texture"},{"uuid":"6EE179B1-0F41-4E23-AEFC-32E5E2930737","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0FAA0EDA-246B-457F-B709-753E29206855","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"D2017C82-A2E1-4F06-B3B0-55FE2AB99D6D","type":"f","value":1,"nodeType":"Float"},{"uuid":"93284330-0E5F-459C-8D47-114A26196045","type":"i","value":0,"nodeType":"Int"},{"uuid":"825874C5-D8AF-4EA5-9450-A54AF0C8A997","type":"f","value":50,"nodeType":"Float"},{"uuid":"33D9DF44-AAB6-4686-AB96-F3B741E32290","type":"f","value":118,"nodeType":"Float"},{"uuid":"B6608D7C-DFAB-4503-B136-67677E60075B","type":"f","value":1,"nodeType":"Float"},{"uuid":"3DB349A3-FF7D-47F8-9108-B313C4CC0889","type":"f","value":0,"nodeType":"Float"},{"uuid":"CD3D887D-8BA2-4FB2-8828-93AB60A07B29","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"89BE0FC6-C157-4A0F-8F20-16AEC386CDC3","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"C899A389-57A7-45E6-A079-69DFF2205240","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"CD471F78-4361-459A-BF92-1EC2AC96130E","type":"f","value":1,"nodeType":"Float"},{"uuid":"0266D6CD-474F-4960-AEE6-459A1523AB70","type":"i","value":2,"nodeType":"Int"},{"uuid":"F1291E3D-2BAD-43C9-BC60-B3B1634B2A02","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"105C01BB-E448-46CB-BB33-69EECCCC0C43","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"275E25B9-4621-4F59-8F1D-6207DEB75DB1","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC797E50-E778-4395-BBEB-5D3B19FC56A3","type":"f","value":2,"nodeType":"Float"},{"uuid":"ED0642EF-5DC8-4962-8C67-2A2B4302E36B","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"749E467A-CE2A-4176-AD13-69FB71E84FB4","type":"f","value":1,"nodeType":"Float"},{"uuid":"031F33CD-3682-4762-9DC6-DBA00BD91644","type":"i","value":2,"nodeType":"Int"},{"uuid":"052F679B-351A-4149-9491-A71826CF9FC2","type":"phong","color":"F95B878B-453F-41A2-BFF2-F9166CFE9782","specular":"C9900111-9938-4F76-A2D0-A88593F4DD05","shininess":"A31FCB67-468F-4843-B3AE-1B5E6C96942B","shadingAlpha":"1923B487-6256-4435-8461-59108C8CE963","shadingBlend":"F8032A8F-9E4C-492F-B8E5-9C6584C25808","afterColor":"D2B1292D-ABD4-42D0-A928-978940745D79","alpha":"8C9EA25C-119D-4B6C-BB44-606E3C62981C","nodeType":"Phong"},{"uuid":"F95B878B-453F-41A2-BFF2-F9166CFE9782","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D2B1292D-ABD4-42D0-A928-978940745D79","type":"v3","a":"AF0CA0FF-BEFB-49FD-9EE7-A76CC9F3A4A8","b":"F69F9B1F-AFD8-480C-84BA-853154CEF817","alpha":"A072DD76-669B-45D2-9D73-C86A695AD38C","mode":"031F33CD-3682-4762-9DC6-DBA00BD91644","nodeType":"Blend"},{"uuid":"AF0CA0FF-BEFB-49FD-9EE7-A76CC9F3A4A8","type":"v3","a":"908381B4-9EBD-4E4F-81F7-037ACF41ECDD","b":"9F452F0C-0485-4901-B531-1296C2C39C76","alpha":"EF7EDA92-9924-4AAF-A1A6-804CD92C078F","mode":"0266D6CD-474F-4960-AEE6-459A1523AB70","nodeType":"Blend"},{"uuid":"908381B4-9EBD-4E4F-81F7-037ACF41ECDD","type":"v3","a":"F5144877-236F-4E3E-8246-8D4884746834","b":"F7F92268-E3B6-4574-AEF6-562BCF3332B7","alpha":"3B8E9781-5D28-4D19-91DB-3551C7B67F2B","mode":"93284330-0E5F-459C-8D47-114A26196045","nodeType":"Blend"},{"uuid":"F5144877-236F-4E3E-8246-8D4884746834","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F7F92268-E3B6-4574-AEF6-562BCF3332B7","type":"v3","thickness":"62896B31-61FD-4485-B95D-8369122ACBE5","ior":"C13619ED-22E5-4C99-93F0-CE1DA504BDD7","roughness":"98657F06-2375-4F40-8C33-1DA082DD5921","alpha":"D2017C82-A2E1-4F06-B3B0-55FE2AB99D6D","calpha":"gF7F92268E3B64574AEF6562BCF3332B7_calpha","nodeType":"Transmission"},{"uuid":"3B8E9781-5D28-4D19-91DB-3551C7B67F2B","type":"f","src":"gF7F92268E3B64574AEF6562BCF3332B7_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9F452F0C-0485-4901-B531-1296C2C39C76","type":"v3","near":"825874C5-D8AF-4EA5-9450-A54AF0C8A997","far":"33D9DF44-AAB6-4686-AB96-F3B741E32290","isVector":"B6608D7C-DFAB-4503-B136-67677E60075B","isWorldSpace":"3DB349A3-FF7D-47F8-9108-B313C4CC0889","origin":"CD3D887D-8BA2-4FB2-8828-93AB60A07B29","colorA":"89BE0FC6-C157-4A0F-8F20-16AEC386CDC3","colorB":"C899A389-57A7-45E6-A079-69DFF2205240","alpha":"CD471F78-4361-459A-BF92-1EC2AC96130E","nodeType":"Depth"},{"uuid":"EF7EDA92-9924-4AAF-A1A6-804CD92C078F","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"CD471F78-4361-459A-BF92-1EC2AC96130E"},"nodeType":"Expression"},{"uuid":"F69F9B1F-AFD8-480C-84BA-853154CEF817","type":"v3","color":"F1291E3D-2BAD-43C9-BC60-B3B1634B2A02","bias":"105C01BB-E448-46CB-BB33-69EECCCC0C43","scale":"275E25B9-4621-4F59-8F1D-6207DEB75DB1","intensity":"CC797E50-E778-4395-BBEB-5D3B19FC56A3","factor":"ED0642EF-5DC8-4962-8C67-2A2B4302E36B","alpha":"749E467A-CE2A-4176-AD13-69FB71E84FB4","mode":"031F33CD-3682-4762-9DC6-DBA00BD91644","calpha":"gF69F9B1FAFD8480C84BA853154CEF817_calpha","nodeType":"Fresnel"},{"uuid":"A072DD76-669B-45D2-9D73-C86A695AD38C","type":"f","src":"gF69F9B1FAFD8480C84BA853154CEF817_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8C9EA25C-119D-4B6C-BB44-606E3C62981C","type":"f","value":1,"nodeType":"Float"},{"uuid":"B8D2E41C-CA21-4A35-BC8D-64977D33B61D","type":"f","value":1,"nodeType":"Float"},{"uuid":"FF01EB8A-F551-4A6D-802F-4927535DEDE0","type":"i","value":0,"nodeType":"Int"},{"uuid":"8C3CD481-16E4-4B6A-9E9C-E084EDF11418","type":"f","value":30,"nodeType":"Float"},{"uuid":"57E14B37-6F01-4998-94EA-A18584A6245F","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"958A4F90-C5B2-4CAC-A378-BE2DC8A3AA65","type":"f","value":10,"nodeType":"Float"},{"uuid":"33A2E051-12C9-4ABD-8B45-9B29F90208E9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0C3BBE46-0FBE-48A8-9EB9-76612DCE4DDE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"52514616-39FA-4AD5-8551-E12170C3B54C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"88167729-BDEB-470D-8BFD-E1DB550202FD","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"81243666-864D-4258-841F-909C9EDB710B","type":"f","value":1,"nodeType":"Float"},{"uuid":"02BC9E96-1575-4817-A2D6-A1B07DE2DD98","type":"i","value":0,"nodeType":"Int"},{"uuid":"29109E3C-D65E-43CF-9E54-CD9C1F20E743","type":"f","value":50,"nodeType":"Float"},{"uuid":"8A013D1A-14E4-4453-93FB-F5A3667FFA43","type":"f","value":168,"nodeType":"Float"},{"uuid":"5E70D1CF-E67C-45FF-B62F-528B189AF378","type":"f","value":1,"nodeType":"Float"},{"uuid":"DFDF411C-B54A-433E-9DDA-CC0CD01AD05A","type":"f","value":0,"nodeType":"Float"},{"uuid":"F2C0012F-A9D0-4321-BAAC-4873A7DFDC81","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"546DE858-9BE1-4E14-B658-B357F3FF72B9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"0EB9AA69-EF54-4AA8-A0C5-4051CDCF5C1F","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"9DE72681-A200-4ECF-9737-EDE2E44779DF","type":"f","value":1,"nodeType":"Float"},{"uuid":"7BC7A283-C84C-4538-9136-29D24FFD294D","type":"i","value":2,"nodeType":"Int"},{"uuid":"EB2A64E9-E1B3-4854-A8FC-19E99C835173","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"36281681-96F5-4739-B373-3E616BA195EE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1E94F580-7462-4B54-BDD1-CE6B10A77CB7","type":"f","value":1,"nodeType":"Float"},{"uuid":"934CA396-701E-4719-B21F-5A166444863D","type":"f","value":2,"nodeType":"Float"},{"uuid":"76234F90-E1DF-43C5-831B-910E129639C2","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"E4A3243E-FA5D-4801-AC9A-382920501038","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F1579B9-EC89-4A77-BECD-F4719A42024B","type":"i","value":2,"nodeType":"Int"},{"uuid":"0CCACD3C-0D48-4771-B590-DA5643665506","type":"f","value":1,"nodeType":"Float"},{"uuid":"63A7E6E2-D622-4E8F-BA1A-3C10977C88D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"A689CA10-0FA6-40CB-9F3A-FAEB2604F633","type":"f","value":30,"nodeType":"Float"},{"uuid":"F2718D21-4101-42B2-9D23-FD3D140F6805","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"9D41B1F7-07F2-4EF6-979E-6F0D28B8CEEF","type":"f","value":10,"nodeType":"Float"},{"uuid":"4F1299CA-3ECE-4D3A-B928-FDADDCABF879","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"88687C90-7391-4350-84B2-44A21FE43AE2","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"20C7DDD0-799C-410E-8557-925D3B8FE8CD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"6B4292A5-021E-4C69-B41F-5536BFC64500","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"43E7DF97-4BDE-4CB1-8924-C42249B1AE37","type":"f","value":1,"nodeType":"Float"},{"uuid":"633B8AA4-94C6-4ED9-A7EE-2F29A358BBA2","type":"i","value":0,"nodeType":"Int"},{"uuid":"7D068AB4-9253-4DDF-82EF-70AAE0239E85","type":"f","value":50,"nodeType":"Float"},{"uuid":"3E18C830-B21A-48EC-BC3A-C1C2185383A2","type":"f","value":168,"nodeType":"Float"},{"uuid":"208A2170-692D-4425-93E9-1A42BB7799BA","type":"f","value":1,"nodeType":"Float"},{"uuid":"389434E4-A7D3-488A-8E3C-C1493DAA6EDC","type":"f","value":0,"nodeType":"Float"},{"uuid":"0A05EB10-A148-419C-BF4E-85EC0FDFC0F8","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3497868E-5605-4EDD-B9B5-338E97D36798","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"C31B42F4-7B5E-4D51-80F1-AA0545DF58F7","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"7A606DCF-7E27-4F87-8C67-ACAE799C8115","type":"f","value":1,"nodeType":"Float"},{"uuid":"DA50B5D6-F8FA-4EBF-909C-8801DE2DE951","type":"i","value":2,"nodeType":"Int"},{"uuid":"A6A05B03-46B5-42F1-8B20-27946E5FFFD2","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"8DBDD181-6CF0-4665-B211-F11D261C2F6B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"88D29D32-7D23-40E6-A0CA-AFA4AAC94997","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD54F65C-6312-4BF9-8094-92851FCA526C","type":"f","value":2,"nodeType":"Float"},{"uuid":"1E275D66-1B3B-4A84-B174-68BB401A2B1F","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"78397018-BF8C-4F58-B1A4-5D58BF7F3DDF","type":"f","value":1,"nodeType":"Float"},{"uuid":"69139A33-9A66-49A1-A05D-3C622DEC36D5","type":"i","value":2,"nodeType":"Int"},{"uuid":"C97DFDA0-A0A6-4DB8-894D-CD9D02C545A4","type":"f","value":1,"nodeType":"Float"},{"uuid":"15F3C7B2-8986-4752-B9D9-0E1C6452E37C","type":"i","value":0,"nodeType":"Int"},{"uuid":"AD435D6F-47CF-4E62-A217-C1BC66664AED","type":"f","value":30,"nodeType":"Float"},{"uuid":"B0673489-B962-4F39-ADD6-4987B4F045E4","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"1920E46F-C1E4-45EA-AB2E-60B33B60DE47","type":"f","value":10,"nodeType":"Float"},{"uuid":"CED1CB13-70BD-41EC-A203-C496289AD201","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"7D2BD129-0C89-43AE-A427-BC1541EF3C1B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"33404D17-0CC1-4D8A-AEFF-154A2616CBD3","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B4AB5843-1F14-4780-AA03-7876CD1C2590","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"F149B21E-E312-4DFC-AFEE-639A96E9FAAD","project":false,"nodeType":"Texture"},{"uuid":"F149B21E-E312-4DFC-AFEE-639A96E9FAAD","type":"v2","index":0,"nodeType":"UV"},{"uuid":"FC4343C9-9548-412E-A06A-0FB7FE2252E6","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"D4887D3B-24BD-474F-81D0-0A55264F0889","project":false,"nodeType":"Texture"},{"uuid":"D4887D3B-24BD-474F-81D0-0A55264F0889","type":"v2","index":0,"nodeType":"UV"},{"uuid":"98596F10-EE74-43EE-B7F4-A6E2D26FEDE5","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"4C6780A1-4050-4264-B173-B37D2C7C760F","type":"f","value":1,"nodeType":"Float"},{"uuid":"E8785667-8D57-4D52-B756-674E08CA8518","type":"i","value":0,"nodeType":"Int"},{"uuid":"8C05C1C7-06C2-42FA-BA70-3120C85BB43E","type":"f","value":50,"nodeType":"Float"},{"uuid":"B86D5BC2-83E5-4D3D-AA5B-4E9D758D3AAC","type":"f","value":168,"nodeType":"Float"},{"uuid":"41375C90-58C7-4F90-990D-C0ED8DE6103A","type":"f","value":1,"nodeType":"Float"},{"uuid":"E95F2D23-922F-4DD0-B948-418F5F17F9EF","type":"f","value":0,"nodeType":"Float"},{"uuid":"21ACAF71-B6C0-4AC5-A2FA-3BA5E57A1612","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"DABD445A-2A62-455D-9040-182F9CD7E7BC","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"7F33322C-816B-4350-BF5B-5FDC1717C707","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"87B93118-C1F4-437F-B9B9-1B9A6F7A7FDD","type":"f","value":1,"nodeType":"Float"},{"uuid":"764E377C-BEC9-4F7E-BFC8-C13DD6F6CB28","type":"i","value":2,"nodeType":"Int"},{"uuid":"A2A4CE57-1155-4F46-A021-82E172B40A9E","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"36AB4FE4-C3D2-4D1B-AC8D-9749E6146921","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1759D6E4-8D74-4F83-A480-0E5516295724","type":"f","value":1,"nodeType":"Float"},{"uuid":"1FFEB97E-B1D8-4E02-BB7B-D0A21467C82A","type":"f","value":2,"nodeType":"Float"},{"uuid":"C38807EA-F499-453A-99DF-781C4DB77180","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"BE687DC3-116E-4D4B-9288-0AA1BD5A93B5","type":"f","value":1,"nodeType":"Float"},{"uuid":"CED347F3-4DDB-45E1-817C-45524AD91916","type":"i","value":2,"nodeType":"Int"},{"uuid":"45DF87E9-0E8A-4B05-83A0-70AD630C4C9A","type":"phong","color":"82005F4C-C398-462F-97F5-7FCF6AFD2F55","specular":"B0673489-B962-4F39-ADD6-4987B4F045E4","shininess":"AD435D6F-47CF-4E62-A217-C1BC66664AED","shadingAlpha":"C97DFDA0-A0A6-4DB8-894D-CD9D02C545A4","shadingBlend":"15F3C7B2-8986-4752-B9D9-0E1C6452E37C","afterColor":"6579E8A4-EE21-4E31-B110-EDCCD71E3B96","alpha":"0400F7CF-E1D3-47E4-9469-5BA123FBA1D7","nodeType":"Phong"},{"uuid":"82005F4C-C398-462F-97F5-7FCF6AFD2F55","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"6579E8A4-EE21-4E31-B110-EDCCD71E3B96","type":"v3","a":"948891AF-2782-47D8-8356-36759DA99062","b":"BF9EED1B-F3CE-4174-B1E1-F3F699FAE9CF","alpha":"722F8D80-3EF5-4DD0-9275-88B90BA2FF6C","mode":"CED347F3-4DDB-45E1-817C-45524AD91916","nodeType":"Blend"},{"uuid":"948891AF-2782-47D8-8356-36759DA99062","type":"v3","a":"852A10A6-7A7B-47EF-9E81-398615100463","b":"B9C31757-6FCD-4A4B-9720-7E770E614BBB","alpha":"029B8F94-E50D-404F-B6AD-B920883176AB","mode":"764E377C-BEC9-4F7E-BFC8-C13DD6F6CB28","nodeType":"Blend"},{"uuid":"852A10A6-7A7B-47EF-9E81-398615100463","type":"v3","a":"BFFACFB9-0A5A-478F-8F38-5A11D32444F4","b":"ED830184-997A-47C6-A09F-C7F2456E5416","alpha":"59027FC8-783D-4F62-93B0-61E0E1246DF3","mode":"E8785667-8D57-4D52-B756-674E08CA8518","nodeType":"Blend"},{"uuid":"BFFACFB9-0A5A-478F-8F38-5A11D32444F4","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"ED830184-997A-47C6-A09F-C7F2456E5416","type":"v3","thickness":"1920E46F-C1E4-45EA-AB2E-60B33B60DE47","ior":"CED1CB13-70BD-41EC-A203-C496289AD201","roughness":"7D2BD129-0C89-43AE-A427-BC1541EF3C1B","alpha":"4C6780A1-4050-4264-B173-B37D2C7C760F","calpha":"gED830184997A47C6A09FC7F2456E5416_calpha","nodeType":"Transmission"},{"uuid":"59027FC8-783D-4F62-93B0-61E0E1246DF3","type":"f","src":"gED830184997A47C6A09FC7F2456E5416_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B9C31757-6FCD-4A4B-9720-7E770E614BBB","type":"v3","near":"8C05C1C7-06C2-42FA-BA70-3120C85BB43E","far":"B86D5BC2-83E5-4D3D-AA5B-4E9D758D3AAC","isVector":"41375C90-58C7-4F90-990D-C0ED8DE6103A","isWorldSpace":"E95F2D23-922F-4DD0-B948-418F5F17F9EF","origin":"21ACAF71-B6C0-4AC5-A2FA-3BA5E57A1612","colorA":"DABD445A-2A62-455D-9040-182F9CD7E7BC","colorB":"7F33322C-816B-4350-BF5B-5FDC1717C707","alpha":"87B93118-C1F4-437F-B9B9-1B9A6F7A7FDD","nodeType":"Depth"},{"uuid":"029B8F94-E50D-404F-B6AD-B920883176AB","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"87B93118-C1F4-437F-B9B9-1B9A6F7A7FDD"},"nodeType":"Expression"},{"uuid":"BF9EED1B-F3CE-4174-B1E1-F3F699FAE9CF","type":"v3","color":"A2A4CE57-1155-4F46-A021-82E172B40A9E","bias":"36AB4FE4-C3D2-4D1B-AC8D-9749E6146921","scale":"1759D6E4-8D74-4F83-A480-0E5516295724","intensity":"1FFEB97E-B1D8-4E02-BB7B-D0A21467C82A","factor":"C38807EA-F499-453A-99DF-781C4DB77180","alpha":"BE687DC3-116E-4D4B-9288-0AA1BD5A93B5","mode":"CED347F3-4DDB-45E1-817C-45524AD91916","calpha":"gBF9EED1BF3CE4174B1E1F3F699FAE9CF_calpha","nodeType":"Fresnel"},{"uuid":"722F8D80-3EF5-4DD0-9275-88B90BA2FF6C","type":"f","src":"gBF9EED1BF3CE4174B1E1F3F699FAE9CF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0400F7CF-E1D3-47E4-9469-5BA123FBA1D7","type":"f","value":1,"nodeType":"Float"},{"uuid":"338759F3-DE8F-4792-B8B7-82BD2D53AAB8","type":"f","value":1,"nodeType":"Float"},{"uuid":"5B148228-F919-4C6C-A769-78B0525C20F5","type":"i","value":0,"nodeType":"Int"},{"uuid":"63528C74-2B3D-4114-A404-E812F03509FE","type":"f","value":30,"nodeType":"Float"},{"uuid":"CFE3310B-3B53-4E6B-A8A8-9A741A829912","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"EB3A0510-F064-457A-A8BB-859E550AD2CF","type":"f","value":10,"nodeType":"Float"},{"uuid":"4A66CC74-ECC6-49CD-8507-603AEAB48282","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"41E6EF3C-236E-405B-BAFF-79DADD3054EE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"65548A06-D0CF-4600-8575-21A521A95A35","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"03F84392-F473-4F5D-859D-DB6C0787B5B2","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"6713B36D-B630-4D84-AF1F-203E3C7AE2A4","type":"f","value":1,"nodeType":"Float"},{"uuid":"82114C5B-FD78-4281-B8CA-83A6DC0BA4C9","type":"i","value":0,"nodeType":"Int"},{"uuid":"5EF27140-D173-4561-A4BC-1213422E4253","type":"f","value":50,"nodeType":"Float"},{"uuid":"D844482C-9DF6-4331-923E-E3144AD01200","type":"f","value":168,"nodeType":"Float"},{"uuid":"F7BE076F-4B35-4CC9-8983-7A63ADB5F07C","type":"f","value":1,"nodeType":"Float"},{"uuid":"759D54A5-BCAD-4607-8F99-4405031B5983","type":"f","value":0,"nodeType":"Float"},{"uuid":"F6ACDBFD-B35C-4127-9D8B-6A54CAF28A16","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C9E42326-BA05-47ED-9763-EA40978481E1","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"2FD43EB9-DFC7-4DB7-B0CA-F876C5AB1B23","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"D8D556B9-A8F4-45CE-A297-66E6A3DFC8FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"5DC385B3-D171-4EA0-8A61-D2969A30987B","type":"i","value":2,"nodeType":"Int"},{"uuid":"A9CA96B9-4152-46E3-847F-E5B8F6788A20","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"8C75265E-5074-4256-A55F-119AAD36849B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"23A2C60B-010F-4646-99DA-FE6111CABE2F","type":"f","value":1,"nodeType":"Float"},{"uuid":"C72B9FAD-BCEE-40DC-A9C2-DB45DDB38777","type":"f","value":2,"nodeType":"Float"},{"uuid":"1AD3F4BF-BE02-4C97-9519-D982EC3EA963","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"BE452D3E-B927-4F80-A6E2-268DFC3E2B73","type":"f","value":1,"nodeType":"Float"},{"uuid":"9E469AB1-BD8C-439C-84A3-0CEF11450FFA","type":"i","value":2,"nodeType":"Int"},{"uuid":"4762DB36-093C-47C9-9C47-FB51415DF038","type":"f","value":1,"nodeType":"Float"},{"uuid":"704C2251-9C97-4EA7-8CDE-B7F03A8148CA","type":"i","value":0,"nodeType":"Int"},{"uuid":"309169A2-A4EA-4E3A-BA5D-3405188781B3","type":"f","value":30,"nodeType":"Float"},{"uuid":"43A17F17-0407-4126-82E9-C0B025D6C284","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"891AF670-F853-4C08-8466-4D7A98E6133E","type":"f","value":10,"nodeType":"Float"},{"uuid":"79C8A178-AADD-4493-A0C8-D4DB8835828C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"8B64A512-6A41-4A2B-BC51-7BE7BADCA091","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"DABC801B-ED0F-4F7C-9E28-7E28F0C8B42C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D396766D-44AB-49E3-9484-A4E4D986D36A","type":"v2","x":0.8827385287691187,"y":1,"nodeType":"Vector2"},{"uuid":"82EABFCF-A271-4F74-83AB-873A8E8A0909","type":"f","value":1,"nodeType":"Float"},{"uuid":"96416FF8-7CF0-49CF-BCEE-D969A741E875","type":"i","value":0,"nodeType":"Int"},{"uuid":"70F741F1-8944-46E8-8E01-D79E59367E5A","type":"f","value":50,"nodeType":"Float"},{"uuid":"322023DD-AAF0-4FD2-8869-4CCB33B18283","type":"f","value":168,"nodeType":"Float"},{"uuid":"5D0E0766-8696-49A6-A442-6B928D566772","type":"f","value":1,"nodeType":"Float"},{"uuid":"91A025A9-C956-44BE-AC8F-31812BD77AA9","type":"f","value":0,"nodeType":"Float"},{"uuid":"80B62168-C3DA-46A3-B746-7FD76A2DB2C1","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"8F203C51-7467-402A-9259-5AD27251A441","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"0D08F594-6FF4-4CE2-8F8A-9A1183133C31","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"42571B81-D901-435C-8681-B37EA4E91DF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"C1716E6E-E0AE-4EEE-B9BB-AB5D761D2008","type":"i","value":2,"nodeType":"Int"},{"uuid":"0738AA51-CC00-423F-8803-73CA72C98F4C","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"19D94D0A-5B2A-4268-A70C-4851FC522C47","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C51709F5-91D1-4C7B-9F44-7CDE0FAA52AD","type":"f","value":1,"nodeType":"Float"},{"uuid":"28A9C1E7-9A12-4807-8F28-D9A7DA93074D","type":"f","value":2,"nodeType":"Float"},{"uuid":"EE2C129D-ABCF-4205-AF0B-686F99820526","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"95788003-B732-467E-934C-31740256490B","type":"f","value":1,"nodeType":"Float"},{"uuid":"F5714D84-7CA2-46B1-831B-9ED75679C0CD","type":"i","value":2,"nodeType":"Int"},{"uuid":"8509085C-9345-40E3-ABBD-230A6DA09BDE","type":"f","value":1,"nodeType":"Float"},{"uuid":"095A56D0-00FA-430E-B44E-31E4B5A77130","type":"i","value":0,"nodeType":"Int"},{"uuid":"EB058285-6D70-4448-9030-D3A51FC5307D","type":"f","value":30,"nodeType":"Float"},{"uuid":"1C367BD6-9DF7-4D64-9AF8-FAFFA9544CCF","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"245EC322-347B-4177-85A0-B137F918FF3C","type":"f","value":10,"nodeType":"Float"},{"uuid":"F837D8F7-988E-4487-9487-A5FA2B0F2CEB","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"AD0E9846-95F2-4BE6-A5BD-D15255C2B69E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"026EB1CD-27B1-4BC7-91F1-0263A17BB270","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"51A8743B-9434-4801-8BC6-3D1FBA26E343","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"3CD511C2-D8DA-40ED-812C-EB4F69C84796","project":false,"nodeType":"Texture"},{"uuid":"3CD511C2-D8DA-40ED-812C-EB4F69C84796","type":"v2","index":0,"nodeType":"UV"},{"uuid":"087C79DD-3497-4ED1-AD97-8BFB86645F69","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"65DB0520-A061-4399-85CD-D05B62C7AE73","project":false,"nodeType":"Texture"},{"uuid":"65DB0520-A061-4399-85CD-D05B62C7AE73","type":"v2","index":0,"nodeType":"UV"},{"uuid":"9906C264-D68D-4FFC-AA72-EECD176AD63A","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"D39DC81E-70B6-461C-B72B-A6DED24A9EAB","type":"f","value":1,"nodeType":"Float"},{"uuid":"4B4A6FE2-556C-4512-A5BE-18E349E256D4","type":"i","value":0,"nodeType":"Int"},{"uuid":"F842B440-FECC-4940-A093-FCB02EACEEE7","type":"f","value":50,"nodeType":"Float"},{"uuid":"25E8A245-08B0-4CA6-AD8C-5C94E6102041","type":"f","value":168,"nodeType":"Float"},{"uuid":"47CDBE76-DCCD-49D9-9085-EA07A097C50E","type":"f","value":1,"nodeType":"Float"},{"uuid":"D81FCBE5-3D96-46F4-BCC5-EF9795E56D60","type":"f","value":0,"nodeType":"Float"},{"uuid":"0B4EE8F1-8E0F-4256-9B6E-28E90C900AB9","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"59FD5EFD-5E45-48EB-AEC1-0E8193DBF3A0","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"9B72156C-93EA-4B85-B9E5-D6557633E16B","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E43189CC-261E-45B4-9133-90B0BDACBF5A","type":"f","value":1,"nodeType":"Float"},{"uuid":"A1F73F3B-E33F-4993-98FC-D5A40F8DA1B0","type":"i","value":2,"nodeType":"Int"},{"uuid":"865DF570-FB5B-4BD1-A3AD-3C30D7A0108D","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"FF49F342-7CAA-4AF1-BF49-516C1506C997","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FA9ADC86-F695-4CEA-AD8D-46DB967EB57A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8A816F64-79C6-4522-8CF3-88E00D717444","type":"f","value":2,"nodeType":"Float"},{"uuid":"1AA77729-5EA1-4CC2-9621-D682BA486A12","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"4847CF34-C471-47C4-9093-F538E218148D","type":"f","value":1,"nodeType":"Float"},{"uuid":"3223732C-4C23-4807-AFD9-2CD30E2BA853","type":"i","value":2,"nodeType":"Int"},{"uuid":"A3C76274-50CA-469F-B6E5-D470079EAEEB","type":"phong","color":"3E593F11-545E-422C-A562-39F1CAAD4ACD","specular":"1C367BD6-9DF7-4D64-9AF8-FAFFA9544CCF","shininess":"EB058285-6D70-4448-9030-D3A51FC5307D","shadingAlpha":"8509085C-9345-40E3-ABBD-230A6DA09BDE","shadingBlend":"095A56D0-00FA-430E-B44E-31E4B5A77130","afterColor":"BBB7E2A0-63EB-4470-9C7F-F91E31D26D76","alpha":"E03B6BF7-9331-47C7-ACDF-5CE6C710F345","nodeType":"Phong"},{"uuid":"3E593F11-545E-422C-A562-39F1CAAD4ACD","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"BBB7E2A0-63EB-4470-9C7F-F91E31D26D76","type":"v3","a":"43CBA555-5E41-4E1A-A042-B51FC9047361","b":"2E6A2A97-345C-4EDE-BB93-0DD773EAC530","alpha":"5DBEC6C8-6F6D-424F-8D00-1BC03854A593","mode":"3223732C-4C23-4807-AFD9-2CD30E2BA853","nodeType":"Blend"},{"uuid":"43CBA555-5E41-4E1A-A042-B51FC9047361","type":"v3","a":"DD00DEDF-F9C0-4151-B173-0B174C1DA2E0","b":"75BF081E-52B4-4278-9CA5-FBE8506074B8","alpha":"BEFFB9CB-9922-4C37-AD48-04EB26F3964F","mode":"A1F73F3B-E33F-4993-98FC-D5A40F8DA1B0","nodeType":"Blend"},{"uuid":"DD00DEDF-F9C0-4151-B173-0B174C1DA2E0","type":"v3","a":"D3259999-E3C8-405B-81CF-3E42D6A9BFF2","b":"9892B139-8A88-42D7-B4E3-58741A226EAE","alpha":"DE797F35-E4A4-44E9-849F-D01E5A3EE3DA","mode":"4B4A6FE2-556C-4512-A5BE-18E349E256D4","nodeType":"Blend"},{"uuid":"D3259999-E3C8-405B-81CF-3E42D6A9BFF2","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9892B139-8A88-42D7-B4E3-58741A226EAE","type":"v3","thickness":"245EC322-347B-4177-85A0-B137F918FF3C","ior":"F837D8F7-988E-4487-9487-A5FA2B0F2CEB","roughness":"AD0E9846-95F2-4BE6-A5BD-D15255C2B69E","alpha":"D39DC81E-70B6-461C-B72B-A6DED24A9EAB","calpha":"g9892B1398A8842D7B4E358741A226EAE_calpha","nodeType":"Transmission"},{"uuid":"DE797F35-E4A4-44E9-849F-D01E5A3EE3DA","type":"f","src":"g9892B1398A8842D7B4E358741A226EAE_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"75BF081E-52B4-4278-9CA5-FBE8506074B8","type":"v3","near":"F842B440-FECC-4940-A093-FCB02EACEEE7","far":"25E8A245-08B0-4CA6-AD8C-5C94E6102041","isVector":"47CDBE76-DCCD-49D9-9085-EA07A097C50E","isWorldSpace":"D81FCBE5-3D96-46F4-BCC5-EF9795E56D60","origin":"0B4EE8F1-8E0F-4256-9B6E-28E90C900AB9","colorA":"59FD5EFD-5E45-48EB-AEC1-0E8193DBF3A0","colorB":"9B72156C-93EA-4B85-B9E5-D6557633E16B","alpha":"E43189CC-261E-45B4-9133-90B0BDACBF5A","nodeType":"Depth"},{"uuid":"BEFFB9CB-9922-4C37-AD48-04EB26F3964F","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"E43189CC-261E-45B4-9133-90B0BDACBF5A"},"nodeType":"Expression"},{"uuid":"2E6A2A97-345C-4EDE-BB93-0DD773EAC530","type":"v3","color":"865DF570-FB5B-4BD1-A3AD-3C30D7A0108D","bias":"FF49F342-7CAA-4AF1-BF49-516C1506C997","scale":"FA9ADC86-F695-4CEA-AD8D-46DB967EB57A","intensity":"8A816F64-79C6-4522-8CF3-88E00D717444","factor":"1AA77729-5EA1-4CC2-9621-D682BA486A12","alpha":"4847CF34-C471-47C4-9093-F538E218148D","mode":"3223732C-4C23-4807-AFD9-2CD30E2BA853","calpha":"g2E6A2A97345C4EDEBB930DD773EAC530_calpha","nodeType":"Fresnel"},{"uuid":"5DBEC6C8-6F6D-424F-8D00-1BC03854A593","type":"f","src":"g2E6A2A97345C4EDEBB930DD773EAC530_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E03B6BF7-9331-47C7-ACDF-5CE6C710F345","type":"f","value":1,"nodeType":"Float"},{"uuid":"54B98CE6-33D1-4140-B6AF-CA7DC38B20DC","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"2E377836-4D94-47CD-B28B-E762E996E4DA","nodeType":"Color"},{"uuid":"2E377836-4D94-47CD-B28B-E762E996E4DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A233435-AFFF-4638-B310-8914F1599DD5","type":"f","value":1,"nodeType":"Float"},{"uuid":"F5B7ED3B-2F5D-4776-B9BC-9B70D6AD17ED","type":"i","value":0,"nodeType":"Int"},{"uuid":"54410F37-8658-4D99-BFCD-2451FC3ECBB6","type":"f","value":1,"nodeType":"Float"},{"uuid":"F69D921C-0B7F-4D2C-B166-D04908FAC661","type":"i","value":0,"nodeType":"Int"},{"uuid":"8960D86C-1A2C-4200-B192-7A3400C2A634","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"B772D95C-66CA-425B-8C01-3BC144256C38","nodeType":"Color"},{"uuid":"B772D95C-66CA-425B-8C01-3BC144256C38","type":"f","value":1,"nodeType":"Float"},{"uuid":"D71E7A95-78C7-4811-930C-41EE6D2067C8","type":"f","value":1,"nodeType":"Float"},{"uuid":"4DBEDC00-A4E7-401A-BEAE-2F25B28F82E6","type":"i","value":0,"nodeType":"Int"},{"uuid":"323A7ADA-E4BD-44CE-B3D0-F46EBD6010FF","type":"f","value":1,"nodeType":"Float"},{"uuid":"A9952045-9CCD-4E74-9E68-AE1EDA638C87","type":"i","value":0,"nodeType":"Int"},{"uuid":"535C8B62-143B-4566-8F2F-83A3C155CB25","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"C6D2A9E5-9396-4089-BEE2-0A1365CF1328","nodeType":"Color"},{"uuid":"C6D2A9E5-9396-4089-BEE2-0A1365CF1328","type":"f","value":1,"nodeType":"Float"},{"uuid":"07E46350-4063-404B-B50A-39415D0E3624","type":"i","value":0,"nodeType":"Int"},{"uuid":"45608F34-DA5D-40B7-B68A-0D98E83D94DB","type":"f","value":1,"nodeType":"Float"},{"uuid":"7953F7FE-F229-45DC-80AD-2FC2E76A2A6A","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C808CF1-D617-4578-B06D-3DE7D138CCF1","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"B2572CCF-9EBE-4871-82A0-98DFBD035A70","type":"f","value":0,"nodeType":"Float"},{"uuid":"6A085E9A-07F5-446E-9A3F-67399FFAF918","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"DCD50686-554C-4641-9C7B-1109C2B95AA9","type":"standard","color":"535C8B62-143B-4566-8F2F-83A3C155CB25","roughness":"2C808CF1-D617-4578-B06D-3DE7D138CCF1","metalness":"B2572CCF-9EBE-4871-82A0-98DFBD035A70","alpha":"C1A90DD0-BB9C-4B98-BE89-14B7A622CB7C","reflectivity":"6A085E9A-07F5-446E-9A3F-67399FFAF918","shadingAlpha":"45608F34-DA5D-40B7-B68A-0D98E83D94DB","shadingBlend":"7953F7FE-F229-45DC-80AD-2FC2E76A2A6A","nodeType":"Standard"},{"uuid":"C1A90DD0-BB9C-4B98-BE89-14B7A622CB7C","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E5F2DA9-D6EF-4895-BE2F-05C3BF640A09","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"04FD7B48-58DE-456D-AC02-0F33C99ABD3A","nodeType":"Color"},{"uuid":"04FD7B48-58DE-456D-AC02-0F33C99ABD3A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8FB989C1-02D9-4A7A-A72C-23697E303C2F","type":"f","value":1,"nodeType":"Float"},{"uuid":"BD735F99-8D19-4771-8CBE-EDAE86271E1C","type":"i","value":0,"nodeType":"Int"},{"uuid":"4A169697-BE84-4BD4-BEF8-2E1C5727CA64","type":"f","value":1,"nodeType":"Float"},{"uuid":"E4B0A40A-98B8-4222-BA8D-56F59EAF6318","type":"i","value":0,"nodeType":"Int"},{"uuid":"B3EFEE34-2218-423D-8987-06AC2655C002","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"84FA70EC-980A-4DA2-9AC5-17C34F54E549","nodeType":"Color"},{"uuid":"84FA70EC-980A-4DA2-9AC5-17C34F54E549","type":"f","value":1,"nodeType":"Float"},{"uuid":"DA4FB767-317B-44B7-9BD4-EF9E7B2D6D94","type":"f","value":1,"nodeType":"Float"},{"uuid":"DEE75BE5-0142-4770-9FB5-F75A4A80B00F","type":"i","value":0,"nodeType":"Int"},{"uuid":"57AA5C79-1ECD-41F9-B4EE-F5BABA49C69E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B602897F-F9CA-4F9C-91E2-FFAAA8652BE2","type":"i","value":0,"nodeType":"Int"},{"uuid":"FBABEA12-8DCA-4E0D-846E-F81DAF920347","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"B52C0D00-70DC-427F-B59D-B80E87EBE34F","nodeType":"Color"},{"uuid":"B52C0D00-70DC-427F-B59D-B80E87EBE34F","type":"f","value":1,"nodeType":"Float"},{"uuid":"7723186C-D545-46BB-9F80-1EA7AE3ED04B","type":"i","value":0,"nodeType":"Int"},{"uuid":"7BDCB1F7-5D48-47EC-9F96-9C14E579BC0A","type":"f","value":1,"nodeType":"Float"},{"uuid":"D38167F4-8D55-4638-BB9E-E2B127C4629A","type":"i","value":0,"nodeType":"Int"},{"uuid":"65979A7D-38AE-46A4-8A5B-973C97E08CD4","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"9D9EE0A6-865A-4631-96B1-987C0E98AD4A","type":"f","value":0,"nodeType":"Float"},{"uuid":"475EF715-4983-4CFA-86CB-B36C2F376701","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"3C5E15E7-27EC-45B9-A07F-83CE1E9934F8","type":"standard","color":"FBABEA12-8DCA-4E0D-846E-F81DAF920347","roughness":"65979A7D-38AE-46A4-8A5B-973C97E08CD4","metalness":"9D9EE0A6-865A-4631-96B1-987C0E98AD4A","alpha":"33EE07EB-7786-4183-8FFB-31E0F992F01F","reflectivity":"475EF715-4983-4CFA-86CB-B36C2F376701","shadingAlpha":"7BDCB1F7-5D48-47EC-9F96-9C14E579BC0A","shadingBlend":"D38167F4-8D55-4638-BB9E-E2B127C4629A","nodeType":"Standard"},{"uuid":"33EE07EB-7786-4183-8FFB-31E0F992F01F","type":"f","value":1,"nodeType":"Float"},{"uuid":"765B2627-0077-4492-AAE9-4A40D997FA3E","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"BA3578A3-319C-4B84-AEDB-2ED0030BAFD6","nodeType":"Color"},{"uuid":"BA3578A3-319C-4B84-AEDB-2ED0030BAFD6","type":"f","value":1,"nodeType":"Float"},{"uuid":"4492C524-65EA-4CC1-9F2B-460AD2875D22","type":"f","value":1,"nodeType":"Float"},{"uuid":"0948E92C-E2D0-467F-8F83-EEBBC8116720","type":"i","value":0,"nodeType":"Int"},{"uuid":"E39AACE9-8D25-440F-9906-81CB93C6CC8E","type":"f","value":1,"nodeType":"Float"},{"uuid":"2D657BD2-4E14-4C7B-A20E-80F818ABAE0F","type":"i","value":0,"nodeType":"Int"},{"uuid":"EC1B5601-1463-4884-812E-B0C48A820905","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"467216E2-0E42-46E0-8F40-12455E769D8A","nodeType":"Color"},{"uuid":"467216E2-0E42-46E0-8F40-12455E769D8A","type":"f","value":1,"nodeType":"Float"},{"uuid":"4AA5036A-A555-4B32-BB0B-68E6BBA6A989","type":"f","value":1,"nodeType":"Float"},{"uuid":"9DDC6267-B1B0-45CD-85FA-DE88193D45C9","type":"i","value":0,"nodeType":"Int"},{"uuid":"B3FE3918-7C5C-41EF-9610-E4BC06C20A50","type":"f","value":1,"nodeType":"Float"},{"uuid":"B0EE24B4-320D-4F7D-81F1-FF49B6A711EF","type":"i","value":0,"nodeType":"Int"},{"uuid":"68D760D1-2A14-4618-8DA3-E36EB8AC3D2A","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"C0D84F24-98CF-48C2-82A6-FDA733E3BAFF","nodeType":"Color"},{"uuid":"C0D84F24-98CF-48C2-82A6-FDA733E3BAFF","type":"f","value":1,"nodeType":"Float"},{"uuid":"3467C87A-CE23-4579-B5C5-DDD8420DC800","type":"i","value":0,"nodeType":"Int"},{"uuid":"90F42F27-4EA6-47BD-8FF8-B7BD5B65DEAE","type":"f","value":1,"nodeType":"Float"},{"uuid":"7FA757D3-D98B-4591-99A5-20AF513CB416","type":"i","value":0,"nodeType":"Int"},{"uuid":"E1867CE4-D9C8-496A-9DBD-4240ADBC287C","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"7EA63203-BF43-4F9F-A7FF-936FCC17AC16","type":"f","value":0,"nodeType":"Float"},{"uuid":"C8BDFD9D-6D40-40BC-9430-A30B7D0B6009","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A2A933E7-DADC-44C9-A6D5-A59DD103D9BD","type":"standard","color":"68D760D1-2A14-4618-8DA3-E36EB8AC3D2A","roughness":"E1867CE4-D9C8-496A-9DBD-4240ADBC287C","metalness":"7EA63203-BF43-4F9F-A7FF-936FCC17AC16","alpha":"041636BD-3CC7-42E1-90AA-0B74237F0604","reflectivity":"C8BDFD9D-6D40-40BC-9430-A30B7D0B6009","shadingAlpha":"90F42F27-4EA6-47BD-8FF8-B7BD5B65DEAE","shadingBlend":"7FA757D3-D98B-4591-99A5-20AF513CB416","nodeType":"Standard"},{"uuid":"041636BD-3CC7-42E1-90AA-0B74237F0604","type":"f","value":1,"nodeType":"Float"},{"uuid":"E4DD08A8-826D-48F9-9B62-1A5FA139E376","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"BE604176-0DAB-4786-903F-AE58D98D3432","nodeType":"Color"},{"uuid":"BE604176-0DAB-4786-903F-AE58D98D3432","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D9E5F64-361E-4B4D-8CE8-0C4FE00EA272","type":"f","value":1,"nodeType":"Float"},{"uuid":"E3058ACF-A539-406F-9963-756D77CDC5BE","type":"i","value":0,"nodeType":"Int"},{"uuid":"0A62DED6-83F6-4929-B09F-9667AAE5989B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C2E9721D-B592-49DD-87D6-E1C49A2C4254","type":"i","value":0,"nodeType":"Int"},{"uuid":"78ABEB2C-959C-4932-96D1-76D5BE88B7B8","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"2735E931-BD78-41FA-B7D9-EF104A2202CF","nodeType":"Color"},{"uuid":"2735E931-BD78-41FA-B7D9-EF104A2202CF","type":"f","value":1,"nodeType":"Float"},{"uuid":"9219D716-3342-44C0-BF97-F8D68B2781D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"6D2799B0-6FC9-4DD8-B017-59D0A10567D9","type":"i","value":0,"nodeType":"Int"},{"uuid":"C7FA3D6D-143E-40BE-A15C-18C30C4502FB","type":"f","value":1,"nodeType":"Float"},{"uuid":"98E2A874-4D55-4928-80D4-0A1C6F1D838C","type":"i","value":0,"nodeType":"Int"},{"uuid":"7F1D5E40-CF3B-4C80-B3CA-63BA476CE519","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"4B8B7206-4C74-4039-B362-984625E3FFEC","nodeType":"Color"},{"uuid":"4B8B7206-4C74-4039-B362-984625E3FFEC","type":"f","value":1,"nodeType":"Float"},{"uuid":"AFFD86EF-7598-4364-8807-5C6FDDE7A5E4","type":"i","value":0,"nodeType":"Int"},{"uuid":"C8523BEB-DB3F-4A8D-AAC1-79B39C9159F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"678A3E77-9814-4ECB-A699-AA4F66DCA6B7","type":"i","value":0,"nodeType":"Int"},{"uuid":"48D2528A-F3F3-4C52-B70F-0163341D0DAB","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"81B5BB08-116E-4EAA-AF3B-8035FB161FE1","type":"f","value":0,"nodeType":"Float"},{"uuid":"9771051F-5CD4-41D0-A8CD-9F1B5659B460","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F3A95CF1-AA11-470A-968A-0CD09D773614","type":"standard","color":"7F1D5E40-CF3B-4C80-B3CA-63BA476CE519","roughness":"48D2528A-F3F3-4C52-B70F-0163341D0DAB","metalness":"81B5BB08-116E-4EAA-AF3B-8035FB161FE1","alpha":"4D844E02-F9B2-44C9-81A3-4F6ACBEA12C5","reflectivity":"9771051F-5CD4-41D0-A8CD-9F1B5659B460","shadingAlpha":"C8523BEB-DB3F-4A8D-AAC1-79B39C9159F0","shadingBlend":"678A3E77-9814-4ECB-A699-AA4F66DCA6B7","nodeType":"Standard"},{"uuid":"4D844E02-F9B2-44C9-81A3-4F6ACBEA12C5","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1373,1212],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/layout_light/index.html b/site/spline/design/layout_light/index.html deleted file mode 100644 index 19a8a91aa..000000000 --- a/site/spline/design/layout_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/layout_light/runtime.js b/site/spline/design/layout_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/layout_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC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1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/layout_light/scene.json b/site/spline/design/layout_light/scene.json deleted file mode 100644 index 6269bcd20..000000000 --- a/site/spline/design/layout_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.8632351105050647,1.3877787807814454e-17,-0.50480208398075,0,-0.14502267448093786,0.9578447875246077,-0.24799553806134123,0,0.48352204487252076,0.28728620400558436,0.8268452510055053,0,-33.636017859222704,232.42400932391124,1148.3304084090505,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000002,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-76.94465201665992,0.4178501358965292,-98.63279130365652,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["4CEE8081-DF9A-414C-B952-00D0F42060E6","88B965DB-8CFD-472C-87A2-B0F3AEAA8088"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"88B965DB-8CFD-472C-87A2-B0F3AEAA8088"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"FB99F7D4-9AEE-4F73-A65E-6DB45A0616EA"},{"uuid":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","objectType":"Mesh3D","name":"Cube copy 10","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-478.5504910358467,-191.02719312096582,278.982102766933,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"interaction":{"uuid":"4E317D27-3986-451E-AA1F-478CDB6D387F","selectedState":0,"states":["3BD078E5-F937-410A-A7F9-5C1BA96929C4","13F94928-847A-4DB1-BE0C-68860304FC35"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","state":"13F94928-847A-4DB1-BE0C-68860304FC35"}]}]},"geometry":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","material":"6B8C0F16-E03E-46AA-82F9-D83D211C5386"},{"uuid":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","objectType":"Mesh3D","name":"Cube copy 9","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,104.97217124530464,-175.33267147612932,156.21358813721042,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"interaction":{"uuid":"87E66C6B-1573-4DB3-BEF3-C467BD8FEA0A","selectedState":0,"states":["0673B2F2-9E0D-41DD-AD10-35580FFD0702","232ABFB9-00BC-49C7-8037-979EA4364C0B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","state":"232ABFB9-00BC-49C7-8037-979EA4364C0B"}]}]},"geometry":"53F4C327-4868-48DA-8FC8-4FD577D63D34","material":"8B5E8BD9-06AD-4146-BD60-59D7B481C54B"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-180.82350074513494,0.4178501358965292,-98.63279130365652,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["B0FD718F-8EEA-41BB-8737-77F027FCD758","8B021AA7-3767-4FE4-A69E-24708D8A52D3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"8B021AA7-3767-4FE4-A69E-24708D8A52D3"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"C65720D3-1778-4F23-81DE-5EF16DBB1A65"},{"uuid":"6EAA47D6-8FB7-42F3-9926-77429CA5137F","objectType":"Mesh3D","name":"Cube copy 7","matrix":[1,0,0,0,0,-0.9396926207859071,0.3420201433256703,0,0,-0.34202014332567027,-0.9396926207859069,0,109.51129684329464,-121.3895460375428,21.17660453440807,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"interaction":{"uuid":"ECD7E6CB-C79A-4ED0-B00A-7A03BB08B18D","selectedState":0,"states":["8A056A08-77F3-437B-9228-2A7A16DFBF8A","3A18B19F-A3CD-4A64-A6B2-748864F843DE"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"6EAA47D6-8FB7-42F3-9926-77429CA5137F","state":"3A18B19F-A3CD-4A64-A6B2-748864F843DE"}]}]},"geometry":"2DBADC1B-7F3E-4205-A38F-DECC3794A0D5","material":"B2F8449A-AC8E-44E9-83CB-B9CF4A92F903"},{"uuid":"1A292755-6BC1-4ABB-9D81-7860EEA006AC","objectType":"Mesh3D","name":"Cube copy 6","matrix":[1,0,0,0,0,-0.9396926207859101,0.34202014332567093,0,0,-0.34202014332567093,-0.9396926207859101,0,10.534771456721458,-122.15293403303363,17.637833140228576,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"0F79A54B-4BBE-4BC1-99C0-CB86C4C02625","selectedState":0,"states":["907C1AA9-85E9-411C-BD55-6D2BB1B1C1EE","FA4C95D1-10CC-46FD-BA50-13119F236723"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"1A292755-6BC1-4ABB-9D81-7860EEA006AC","state":"FA4C95D1-10CC-46FD-BA50-13119F236723"}]}]},"geometry":"BC0A73B0-3BB1-47AD-8161-9ADD27898AE4","material":"053778E0-E480-458D-B4B4-B4572A9C48CF"},{"uuid":"C45F8E6D-2068-4617-8291-49DAA9D72F19","objectType":"Mesh3D","name":"Cube copy 5","matrix":[1.000000000000012,-3.1308381269245555e-17,2.720436994223432e-16,0,1.224646799147353e-16,0.9396926207859084,-0.34202014332566866,0,-2.4492935982947355e-16,0.34202014332567277,0.9396926207859196,0,-92.46522854327877,-73.79488051928482,4.26206273772965,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"42D4F1E2-E870-408F-8473-3BAF91CAAC68","selectedState":0,"states":["035117A6-16BB-479C-AA37-3EAFBC4DAAED","3A86C3B9-4C99-4202-BEB0-B2C431A482DF"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"C45F8E6D-2068-4617-8291-49DAA9D72F19","state":"3A86C3B9-4C99-4202-BEB0-B2C431A482DF"}]}]},"geometry":"4D541A57-7A45-4616-9DED-60CF6C63666F","material":"188C5554-324F-421C-8B86-876DFBCC640C"},{"uuid":"D9C2D100-409F-4403-A98D-A39788AB8850","objectType":"Mesh3D","name":"Cube 2","matrix":[1,0,0,0,0,-0.9396926207859159,0.3420201433256732,0,0,-0.3420201433256731,-0.9396926207859155,0,60.53477145672121,-27.242356786268587,-12.710181232475918,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"interaction":{"uuid":"D0FA51AF-597A-41D3-9BDB-30B281E3FAA1","selectedState":0,"states":["CAC32034-FC42-4F56-9BA1-B4CC0A4E779F","BB63C07E-8221-497A-B065-F19CE4FA1F94"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":4,"duration":300,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":0},"object":"D9C2D100-409F-4403-A98D-A39788AB8850","state":"BB63C07E-8221-497A-B065-F19CE4FA1F94"}]}]},"geometry":"EA75EF62-7B8C-41DF-B29C-D0C4F6804260","material":"8D95DF84-451C-4860-BC15-AB1A725F76C3"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,0,6.123233995736766e-14,1000,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"48C98966-C341-457B-A325-6AAF364439CF","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53F4C327-4868-48DA-8FC8-4FD577D63D34","userData":{"parameters":{"width":160,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"2DBADC1B-7F3E-4205-A38F-DECC3794A0D5","userData":{"parameters":{"width":100,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}},{"uuid":"BC0A73B0-3BB1-47AD-8161-9ADD27898AE4","userData":{"parameters":{"width":100,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}},{"uuid":"4D541A57-7A45-4616-9DED-60CF6C63666F","userData":{"parameters":{"width":110,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":200,"depth":32},"type":"CubeGeometry"}},{"uuid":"EA75EF62-7B8C-41DF-B29C-D0C4F6804260","userData":{"parameters":{"width":200,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":100,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"FB99F7D4-9AEE-4F73-A65E-6DB45A0616EA","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4BCD0CD8-FA3D-4FDB-B80D-0FFFD56BCCCF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","f1_mode":"97EF242E-3A72-4EB1-9450-30B50662F407","f1_shininess":"B1F3FB31-A409-4891-A7D0-B3936E663135","f1_specular":"195C69AA-E265-4F6E-962E-82AF11795549"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"BF030439-0A95-48F5-ABEB-1859CD2CE6CB","f2_ior":"7B3E20AF-326C-4B7D-A0B6-A7E28541315D","f2_roughness":"1CD7BA31-1825-4DE0-8D3D-AA569D32AEF9","f2_transmissionSamplerSize":"4303D30E-8258-42B6-BFFD-30B80A22DF0B","f2_transmissionSamplerMap":"4EA4B994-9BAB-4752-A76B-00320E1156E7","f2_transmissionDepthMap":"A3743A9B-18D9-4C5E-804B-73ED22103AA2","f2_aspectRatio":"BF2BA757-A968-44C1-B89F-614A3DFFC615","f2_alpha":"0C1ECA59-4F10-4364-95D8-125725577DA0","f2_mode":"082C5E1C-DB3F-47F5-AC16-929FD2438283"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"559C82D0-5E62-42BC-BB39-83F2BF6E7811","f4_far":"D816658F-7125-4B26-837E-98CBD1207084","f4_isVector":"549944E5-663E-4B52-88A2-B1F3951CECEA","f4_isWorldSpace":"445D34BB-CDD9-48B6-B4D8-3B1741891D01","f4_origin":"AB308043-0441-41C0-B5A0-58D8FD467066","f4_colorA":"ACDBB668-E042-467E-AF2E-6441836570FD","f4_colorB":"D7B4FBD7-D71B-4CB9-801B-1C7D499EC1E1","f4_alpha":"5089A034-F8BB-4E29-8338-251C02ECEE34","f4_mode":"E576195A-6FE2-4359-A05C-1F334BED38CC"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"5C9ABCB6-0426-4B1E-8ABB-C30DF7EDD9EF","f3_bias":"2DD10375-E2ED-406B-B679-0585F76FD515","f3_scale":"8D5EDCD7-8345-4D03-A94B-8A40D889B9AF","f3_intensity":"290811FA-ED57-41A2-A635-03AB4B86122C","f3_factor":"F10D067E-5055-4DFA-9D8A-49AA5F76DE60","f3_alpha":"91DD0E02-82E2-4023-B138-1B190B2144BF","f3_mode":"FC61C158-A25A-4FB6-A624-42DD54DFB0C1"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"82FCED54-F37F-4E88-BA64-B2E125F4D07B","fragment":"82FCED54-F37F-4E88-BA64-B2E125F4D07B"},{"uuid":"6B8C0F16-E03E-46AA-82F9-D83D211C5386","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4BCD0CD8-FA3D-4FDB-B80D-0FFFD56BCCCF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","f1_mode":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","f1_shininess":"C12A9B9B-DC1F-49E8-81F7-A1B38E2C4A1C","f1_specular":"7564AE94-182A-4284-B519-6CABE470945D"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DA697F1B-2B2B-40D0-83C3-624A7A5FB327","f2_ior":"55F9D5C6-E12B-4511-9934-4BDA6F26BEF3","f2_roughness":"16387422-F8B1-4A2D-83E7-D18DF4A89FDA","f2_transmissionSamplerSize":"758E516C-C777-4F55-BD69-42A6FAB1320E","f2_transmissionSamplerMap":"BABF3C75-68F7-47CF-8FAF-7F5277D58226","f2_transmissionDepthMap":"798CF858-F971-40B3-B8C4-B6D71B45D7EA","f2_aspectRatio":"915E58BC-12F1-4601-AC72-E62D706BD994","f2_alpha":"74DB3B03-4F9D-4B30-9535-59F8619F0C79","f2_mode":"B2584E69-1735-4808-9E71-6CAEA70065F2"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D92E37C5-3FE7-4227-A0DD-2952A045D7A5","f4_far":"B76EF1AB-23C1-479C-8DBC-F950C9E92F28","f4_isVector":"38F730E4-813B-4D0C-8F35-5D0F3C80831D","f4_isWorldSpace":"F8687F6E-BF2F-4A93-AC65-C64B43645AFA","f4_origin":"3B7D062C-4A4D-4073-A6B0-B94CF96A4243","f4_colorA":"13FB2F86-2FFD-4A52-B087-E44C160C3615","f4_colorB":"A486900B-8F35-40D6-A2A0-83EC3E8BF9A5","f4_alpha":"99B2D205-DF6D-4D4F-BBBC-8277E0FBD9C8","f4_mode":"4C961699-FE20-4356-998F-71EA07433238"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"ED71EE97-951E-42C1-9CE3-01F85AE16294","f3_bias":"90CB3DA4-2947-4CA5-ACCE-B03753691B3B","f3_scale":"37BEA810-CACE-4C4E-BBBD-81A0B00FD136","f3_intensity":"752B5A2D-8AB7-4ADE-B323-6329D0B76A1F","f3_factor":"C59EB554-308D-46D3-A711-885302AAE981","f3_alpha":"083EAAD6-ED85-4FA0-938B-CCBCFF66BE9C","f3_mode":"C9BEBF44-5291-4B71-83A6-CB54DAAFECC8"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"B875D127-D743-45D2-8D31-F232DBC4ED8E","fragment":"B875D127-D743-45D2-8D31-F232DBC4ED8E"},{"uuid":"8B5E8BD9-06AD-4146-BD60-59D7B481C54B","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E5FA876-21E5-4F39-B865-119366769E99","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","f1_mode":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","f1_shininess":"68962F85-4880-4941-8383-FB2574B11EDE","f1_specular":"E172D68A-CD2E-4D32-A04C-0FE8F938FFA6"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"258DD7DD-778F-44C7-94C2-D6308952C6B2","f2_ior":"038C2F80-4739-4696-895F-B193D4E5ABEF","f2_roughness":"2422736E-2985-4214-9038-BE1243ABB7A7","f2_transmissionSamplerSize":"F5C447CE-06A4-456A-8A92-A381D795B700","f2_transmissionSamplerMap":"BE06C6DE-C172-48BF-8AE6-AA24C443B479","f2_transmissionDepthMap":"4D401140-7197-4D03-8275-30E27BE7125C","f2_aspectRatio":"FECF21D2-D260-4BB7-8607-DC86BB7B83EF","f2_alpha":"68821B5D-EBBD-4A47-BA50-BD27D77C0A0B","f2_mode":"238FA743-EEC2-4B47-A9DA-0A7182D542F7"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"F7DF3873-252B-4F42-AACD-1884AD4D8810","f4_far":"0C88E392-D4D3-4968-AC7A-BB8CA8B17B30","f4_isVector":"F41F8A46-E6FB-4785-BC29-CC1DDFDD9768","f4_isWorldSpace":"37205E69-AC9D-40D7-AB54-33E8348A0325","f4_origin":"93A19D04-1790-482A-B731-89B23621E803","f4_colorA":"BBB83CEF-4F72-4ECB-AC89-98B287BFA7BD","f4_colorB":"6DEAC539-59BF-4B28-86B7-FAF212DF1C53","f4_alpha":"9CFF996F-D409-44D6-8BF3-AB7F879EA1ED","f4_mode":"4DB03EB5-EED9-44AF-B14D-B2A30F4AB80B"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"988DF265-A756-48F1-9911-2238648AB2FB","f3_bias":"24B011D1-B833-44F6-AA82-295201C17D25","f3_scale":"1662CD7C-26AF-4ACA-A2BB-51077E284DF2","f3_intensity":"CBD02E93-1278-4768-96E1-9D7036BE8003","f3_factor":"8E05CAB4-B3A4-41ED-BD29-B386BD4FCBB4","f3_alpha":"B1810AEB-86CD-419C-A86F-3DE358D0C453","f3_mode":"9A2E4CFD-DEC6-4FC1-9877-BEB07DAF12CF"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"045370D6-0EE1-4BAD-87D3-B9DF86841131","fragment":"045370D6-0EE1-4BAD-87D3-B9DF86841131"},{"uuid":"C65720D3-1778-4F23-81DE-5EF16DBB1A65","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E5FA876-21E5-4F39-B865-119366769E99","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E580F990-A83F-4809-ADC2-95CE2B455A52","f1_mode":"13D6E696-B3BE-439D-81DA-300B0D2A1691","f1_shininess":"3B22122F-C845-4F80-ABD6-8F99A0268849","f1_specular":"FB7425AE-AEF2-48B0-A6FC-2C2DD4E36B77"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"493B68FF-BE19-4357-B422-A6B2A90F2331","f2_ior":"000BDA03-4988-4416-83CC-7354CA7BB7A7","f2_roughness":"205A0BE3-7101-4BFD-B5A5-E8A516642853","f2_transmissionSamplerSize":"F16EFB8F-379A-45C7-ABAF-C1FE8838AA7D","f2_transmissionSamplerMap":"3D2C6A9C-F4D6-429B-B933-069A00CFEC81","f2_transmissionDepthMap":"63B1119E-7B55-4258-8029-9926E3ED488C","f2_aspectRatio":"A3BDDF28-9A0D-400A-B9BC-B13ED7B154D8","f2_alpha":"AFC6F1BE-C41B-4484-B723-79A1EFA7E1D2","f2_mode":"4B6C8F76-A06D-4206-AFE7-0B9F4C6070BF"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"403B102E-FE88-4DD2-AF6F-4B640D3C38B1","f4_far":"83365D97-E697-40D5-9D59-CB8D48C5E7FC","f4_isVector":"C0BD4391-B358-4A34-A907-BB310A8A9F00","f4_isWorldSpace":"316F08A8-0F87-442F-BB91-9F5AC9830091","f4_origin":"365414D0-D8E1-42AD-81E9-34BD032A4E11","f4_colorA":"AFB62CF4-053E-46E7-9761-A8FF36500D03","f4_colorB":"F1696F04-312F-499E-8E26-AAFD79CE245F","f4_alpha":"DAC254CF-F53B-426B-B763-E73F9F8A791B","f4_mode":"C482E346-0276-4B5C-ABD7-86EC2BF95925"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F15C1C37-B7A2-47C2-8783-C8562C2E4782","f3_bias":"A9A33D00-80B7-4742-8857-9CE671CC839D","f3_scale":"4CA763DD-EDDE-4736-A520-6DF849B068EB","f3_intensity":"6E3F8AA4-79DF-40F2-BD00-C028AAEF330F","f3_factor":"DEFCB748-5C7B-48E9-8B8E-61A44B86FE68","f3_alpha":"76F72977-4BBE-4C3A-B7C5-98966B37F11A","f3_mode":"9818D4C0-8142-4D9B-B007-A5A31E8A3A37"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33","fragment":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33"},{"uuid":"B2F8449A-AC8E-44E9-83CB-B9CF4A92F903","type":"ShaderMaterial","emissiveIntensity":{"uuid":"E213CF5A-2AD9-457E-89F9-50E185DE9FDC","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"F3B815FB-B293-456F-B15C-688DC352D083","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"19E81683-ADA0-4CE6-B3F0-F77F89EC04DC","f0_alpha":"0336C7A1-8798-483E-AB21-640A3EB385AB","f0_mode":"B586CE2C-6A79-46C0-A6C4-D9DF36CFCD84"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"47A667B6-3112-4F80-B074-6F6EFCB63890","f1_mode":"CC076918-B60F-4553-8878-094F3551E286","f1_emissive":"1F56B03A-5815-4520-A667-AEE98D6E438E"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"7AA95DDA-AE80-4603-8179-3B381EA98DB4","f2_bias":"2278109D-D85C-4E45-B611-B823323FD9FF","f2_scale":"C00D5F3C-6371-4971-A64B-68BED974EEA2","f2_intensity":"4F12433B-EE51-426E-A4FD-93E7F0E618F1","f2_factor":"98AD57DA-D0A6-4E43-A7AD-FF0A2BCD3CDC","f2_alpha":"9B4CC098-62B4-4475-BE00-CB929C21F929","f2_mode":"B1CC6FE2-8790-428F-992D-F9E0E9337D9A"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"33D0580D-FC1F-4D45-BE83-90B7C2C19313","fragment":"33D0580D-FC1F-4D45-BE83-90B7C2C19313"},{"uuid":"053778E0-E480-458D-B4B4-B4572A9C48CF","type":"ShaderMaterial","emissiveIntensity":{"uuid":"EC0EBE80-5211-4717-B902-E1CAECF452AB","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"AE394D79-C22B-4EEA-893C-E977D72AD188","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BBD51A6C-764B-49C9-9344-F7CFBC4DD1D8","f0_alpha":"A1D17FC6-7EA5-45A1-AC40-4331020FE411","f0_mode":"06C6E7CB-0A65-4262-9E31-6D465F5C7614"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9D143032-73FD-45A5-87C5-1C14F52F3B4B","f1_mode":"1194D657-C918-4B79-BAB0-7533D81325A6","f1_emissive":"F32F0548-9936-41D3-866F-98188693CA08"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"60D80220-1465-40A2-9CFB-1A4C4DA400C9","f2_bias":"AE58C1D2-1152-4DDD-BCC8-DAA0B0B65B25","f2_scale":"5A9FE228-C9C2-4369-9BDD-C4EFEE71D971","f2_intensity":"A6A8F9CD-E70E-48C8-8CC2-594341AD642A","f2_factor":"A79ACC3A-40A6-4830-AE53-40BD8167D54D","f2_alpha":"7CB3BE4E-11FE-460B-A116-847552120857","f2_mode":"AE7379F5-7283-461B-8A33-530B627548A1"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"C2AF7613-B84C-4B12-8AB7-42C413B4BDDC","fragment":"C2AF7613-B84C-4B12-8AB7-42C413B4BDDC"},{"uuid":"188C5554-324F-421C-8B86-876DFBCC640C","type":"ShaderMaterial","emissiveIntensity":{"uuid":"7D025A2C-AA8A-4A23-BED7-D790078CD1B7","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"15B21372-5C7B-4D15-85B8-BA05FDB4F76F","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"4BE51BD1-2492-4EA4-9436-FA3FC3A59D7A","f0_alpha":"068CE446-2E2D-44AB-B2DF-7A34BCA9F841","f0_mode":"37FE9FA1-B22C-4696-A47A-3045B6664088"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9C71CE08-CA26-4299-B1FF-E548A29E5080","f1_mode":"4B43496D-C9B5-4F09-BB56-2D7963967D41","f1_emissive":"40AE991A-E0A8-41F8-8DE2-3FA55351EAF7"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"02131CD3-0E68-4B23-960A-D9DBE499290A","f2_bias":"E814A5A5-AA28-49FA-9D43-6F91D2FE3502","f2_scale":"C8C32F77-0B4A-4470-A7F3-CDB39E606F8C","f2_intensity":"37604D24-9A80-4FE5-9451-496B62D03CBF","f2_factor":"2BEE7FC2-7E89-49C2-9A50-094DDF4B2B60","f2_alpha":"B33534F7-3AE2-4064-8655-B2CE3215E833","f2_mode":"2DCD7A6A-6F1A-4161-8B42-1C0E4DF48048"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"B5D8C262-304D-4672-A5D7-2E82DB09B11D","fragment":"B5D8C262-304D-4672-A5D7-2E82DB09B11D"},{"uuid":"8D95DF84-451C-4860-BC15-AB1A725F76C3","type":"ShaderMaterial","emissiveIntensity":{"uuid":"92EEE367-3CB0-4647-8510-924204203E07","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"D1D15F03-D40D-4254-963E-4E7CB30140F2","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"F790F353-CE0B-4B82-810B-DF313A57022E","f0_alpha":"B2E85646-25BE-49F3-8003-82894F120352","f0_mode":"5B5EE355-FED5-475C-9BE9-6DA780C033BB"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B4C8B66A-BFA7-44BA-8E41-F0170725472E","f1_mode":"B19944E1-A83F-4A1B-925B-3133B1795FF1","f1_emissive":"A8EAD0D0-0C20-46E3-B076-694B2FD5A23F"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"50DCA45C-AF4B-4CB4-B321-F8311ABB4B08","f2_bias":"57FC5112-584D-47B6-9025-9E4C28B56C6E","f2_scale":"B05720FA-8634-4CD7-9C9A-3A23069080F7","f2_intensity":"99C75718-2027-457F-A784-081455D770C1","f2_factor":"AD3A4082-0719-42C7-BBD3-79FBCFBE3854","f2_alpha":"76536314-A607-4093-9639-A94C97B3AB14","f2_mode":"BD1D3C87-3F4D-400C-AD42-28FC23B47CE2"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"2A4AE12D-C9E5-49D9-AE6C-B5E3401DE49A","fragment":"2A4AE12D-C9E5-49D9-AE6C-B5E3401DE49A"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"4CEE8081-DF9A-414C-B952-00D0F42060E6","name":"Base State","position":[-76.94465201665992,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7936E190-C305-4F76-B544-3BDC3ADE7DB7","f1_mode":"6D2A9A5D-90C7-4222-AA95-9F8A22E29DB9","f1_shininess":"12A8463A-7688-46B8-BF7B-043D92D261CC","f1_specular":"5049C359-2282-4484-9992-E1B05E75209B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"86A46368-0FED-4574-9F94-1133695FBBF2","f2_ior":"6521A072-27B2-4294-A47E-75D4388106DC","f2_roughness":"BCCC2E56-F2AA-4FF3-8478-29E7629AB925","f2_transmissionSamplerSize":"31178B5B-BED1-48A1-9F71-A015984F1C78","f2_aspectRatio":"2CDF13FB-AB4B-4F55-BDA9-2F3A29C52FA6","f2_alpha":"7DCEE7A2-DCD9-4AEA-80E3-E2C83B9DCCBC","f2_mode":"F9708C08-7F82-4D8B-B44F-A319C8B6EBF6"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"726FCE56-AA38-41F5-BB2B-E05EE32859D9","f4_far":"355B161D-3B93-465A-B4C9-A6DD01973A07","f4_isVector":"34531D40-80CE-4D07-A18D-A197F9F8D4ED","f4_isWorldSpace":"E001088A-4285-4FC6-937C-946514CB6829","f4_origin":"F6F92EB7-EA92-4CEB-9007-69D4C982525B","f4_colorA":"6B0CD2BA-0FAA-45E9-9118-6C7A4013C333","f4_colorB":"A0408019-A0F8-477A-A310-2D329B8FF485","f4_alpha":"A4F2A1E5-87CD-4EA4-A546-6E53FBE1890A","f4_mode":"D834B835-904F-4EF7-803E-1782A27ED424"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B61F5E7D-6FC4-4F6E-A7BF-05A73D6C6ED6","f3_bias":"438D32D3-7DDF-47BA-A0E6-A319967844E8","f3_scale":"DC166E9F-9489-40BD-B671-B1B9A6D44857","f3_intensity":"24276B7C-499A-4C0F-9EF1-7BDCC80BFB37","f3_factor":"5484FEC1-9F8D-4626-80C7-D4A8F6A28283","f3_alpha":"4F0B6683-FD40-497F-8A36-29995AD1404B","f3_mode":"1D6E28DD-A81C-40C2-B42C-4A256E7DFF50"}}]}},{"uuid":"88B965DB-8CFD-472C-87A2-B0F3AEAA8088","name":"State 1","position":[-76.94465201665992,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"48DE2E51-2005-4791-9ED6-F78F6B5C122B","f1_mode":"5C9DEE0A-FDB5-44DE-A059-CB242ACDC26F","f1_shininess":"F6BA8930-F525-4FA4-8B53-49114B253513","f1_specular":"C0439DE2-D053-4D19-9FD9-E27424C794FF"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"2C63691D-D9A6-438E-806F-6F33976676F1","f2_ior":"954C0689-528F-48D1-9626-4233633F8950","f2_roughness":"EC719995-6A35-4A70-9632-508EE559530C","f2_transmissionSamplerSize":"99E80BCF-63F6-42F1-BCCA-7E6048DF3C35","f2_aspectRatio":"F2D2242C-AED2-444E-AB84-BF17714DB8E0","f2_alpha":"64713045-81A4-4CE4-90D4-66C9A9CE8478","f2_mode":"B4C7766B-1FCA-431C-BF01-0BD7D04C59A3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"0D2F25F3-B3E3-428A-9416-5453418A75F8","f4_far":"A4E34779-67B4-46B2-BA5A-4AF697E98788","f4_isVector":"E6158A8D-18F6-4F09-AE41-CA504872E03A","f4_isWorldSpace":"BBC5C0B7-E79B-4879-818F-142E055F32D4","f4_origin":"2B4873EC-076B-49BC-AA62-5245759BDB43","f4_colorA":"44CCE824-DF4D-4B88-9B4D-8E2197B37D65","f4_colorB":"326F24DD-6535-460A-8314-FAF5A8608FAB","f4_alpha":"63D315EC-1ED2-4348-AB79-A2319E088936","f4_mode":"48AD85A3-A444-45C7-8EEE-E623BF817F3B"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"5CA3E9B6-F848-4FF1-9995-E4CA10A8BF33","f3_bias":"142BC173-41CD-40E0-B241-214AC89D9F4E","f3_scale":"154A5B0E-B261-4D99-B150-0DEF8A0C3133","f3_intensity":"D1FF9734-6D25-49B0-BC0F-FD3A07C9C209","f3_factor":"CBCEF956-A3B7-438E-997C-0DB5AD67E6EC","f3_alpha":"78CD79E5-2FD4-421E-A9C9-DA2F7C9FC88F","f3_mode":"AC5D7E76-62F1-4748-AFA7-63E6391EB1B2"}}]}},{"uuid":"3BD078E5-F937-410A-A7F9-5C1BA96929C4","name":"Base State","position":[-478.5504910358467,-191.02719312096582,278.982102766933],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3DA03F19-545A-4589-AA7B-6E25E4E0D5DE","f1_mode":"C69DC518-BD0A-4199-A470-1CF3C32E8B0B","f1_shininess":"BF5A61A7-0E18-40AB-86E5-E6EF69B26F70","f1_specular":"1DFF4111-7CB1-40DF-85DB-C14DAB361EC4"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6F55703E-7483-4D40-9969-D5B3F6F47488","f2_ior":"C2DEEF5A-84DA-4690-B378-D1D08E56AB07","f2_roughness":"04231C55-F01B-41AA-BF9F-D240CB0E8C8C","f2_transmissionSamplerSize":"AD7E859A-7AF2-4D2B-BF22-27AE46790426","f2_aspectRatio":"9195E340-48A1-46C2-A2F7-A713D2D7D138","f2_alpha":"38B50BB7-2E70-4598-854E-C60D8E1C26D2","f2_mode":"D8C9FE33-8A8D-4324-B041-4DEF2454CFD9"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"74BFEA8C-1762-4E59-BF8D-CC35BABACB31","f4_far":"0E867D03-907E-407A-9368-71733D445716","f4_isVector":"3B632DFB-17F6-44E6-B32E-1644F9A1505E","f4_isWorldSpace":"B9D45347-7349-4FA3-A6D4-DDB722458885","f4_origin":"744A3D08-3C93-4013-91FA-2A13AE212C56","f4_colorA":"7804FE65-BC98-476D-AC3A-0A5E04565531","f4_colorB":"EB7CAC1A-B3BF-43F1-ADD7-435CB2A268F4","f4_alpha":"E7359B5B-4500-468C-AC05-0821AFDD537A","f4_mode":"4F2754F3-EAF6-4BFC-8926-6E2B859F0915"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7D3F8D80-3A76-4E88-9D49-B9872278E61E","f3_bias":"62534628-DB12-4E5B-873C-E73053BBAAC1","f3_scale":"001D0471-BF78-44D0-8891-D2651EBFC23A","f3_intensity":"E37A142D-97F0-485C-B757-1CED06AD4A32","f3_factor":"AA11650A-C2FA-4B59-9281-809A0E6F6244","f3_alpha":"EE05A829-9C2E-4A23-8047-B0EAB8A05795","f3_mode":"810307BF-81EF-43EB-A933-2181346188F0"}}]}},{"uuid":"13F94928-847A-4DB1-BE0C-68860304FC35","name":"State 1","position":[-478.5504910358467,-191.02719312096582,278.982102766933],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0D06A676-D80C-44EA-8678-E5FF3D27808B","f1_mode":"1C3ECC7A-0342-41F3-8B54-678CBAE755A2","f1_shininess":"A65AB37D-FF35-4620-87FA-6D1E98E7B5F2","f1_specular":"C648B78F-CE53-469A-8955-0DD0B2C0B113"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"E8D32737-8EF8-4363-92FB-90BD5720D706","f2_ior":"66735D07-0CD3-4087-AD96-FAD7A9EDE884","f2_roughness":"4C525C75-2745-4265-BB55-07ED7A5831B5","f2_transmissionSamplerSize":"1FE11BC8-8248-473C-819D-D6340E9ACB0F","f2_aspectRatio":"BD2C0164-1BC8-4D65-BE37-31FEA64459C8","f2_alpha":"49B2C012-E388-4FA8-93F5-9B537A176D46","f2_mode":"E09F74E5-32A1-443A-9D99-CC1150970B83"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"64E49FA0-66B2-4C10-90AA-A4D8F2BA56B1","f4_far":"A3ACFA3B-218B-4E1A-906E-ED29F2E48F4A","f4_isVector":"CB168406-00EC-4F4C-AAC4-6E3FA62B51A0","f4_isWorldSpace":"8F1A09D7-97C2-403C-86B4-3D889500CCFF","f4_origin":"999FE4BA-777F-46F9-9119-99EAA96FF4C6","f4_colorA":"CB8ADA49-DAA0-40E2-BD62-0ED4A95FDBE3","f4_colorB":"6CB78281-922A-472B-9826-00C67619BE56","f4_alpha":"1080D098-B7E7-4315-B2BF-75148CF8AB47","f4_mode":"94BF5799-EABE-4EAB-B25A-114B642615D2"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"FFAB1D99-8BC5-488E-B058-A50FA6B7418D","f3_bias":"79282C8B-BEC7-41D9-9BDE-C65FCEB45EE1","f3_scale":"F2BDD247-0771-4E25-A23E-1973D42D9EBC","f3_intensity":"763DF174-F371-4C31-A327-A7B4CDD073E2","f3_factor":"29741B42-8186-40E1-AA64-CD961A80387A","f3_alpha":"53194445-5DEE-4811-B8BC-41686E22764E","f3_mode":"7C634F98-D26E-41BF-BDC6-4359B32F533F"}}]}},{"uuid":"0673B2F2-9E0D-41DD-AD10-35580FFD0702","name":"Base State","position":[104.97217124530464,-175.33267147612932,156.21358813721042],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F1CCDA77-FD0E-4B66-885A-9F756FF6FB24","f1_mode":"23C64443-8493-47A5-992C-A7AAD67E0164","f1_shininess":"FA172033-8848-4913-BA94-631D52CA4227","f1_specular":"9D9CDF74-B705-4A8F-A1E8-64EA97A31FAE"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"7205CBFD-E1F3-43A2-A2B2-CC4E3EC9FE73","f2_ior":"220FBEAC-C2D9-443E-BDA8-3BCDCE149294","f2_roughness":"6559E7EA-0DA6-4378-9568-F4FC3761253B","f2_transmissionSamplerSize":"DAB41DAA-21B4-4280-ACC5-DADC525F32F5","f2_aspectRatio":"B408B173-271D-4012-95A9-D18BF9D58165","f2_alpha":"B8974B32-7780-456B-977B-73D232039D20","f2_mode":"2513FB61-D30B-49A8-B7AF-8D1295FE3CF1"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"651ABCD0-104B-43A9-A27F-E7884CF03507","f4_far":"AEE14D58-DE2D-4AB0-B10C-1EF09105A789","f4_isVector":"A172BD28-C2E7-4F40-815A-FD69D93B8BC4","f4_isWorldSpace":"6EED541A-CA9B-423B-991F-0F8DBA9868EB","f4_origin":"76A38ADD-AD06-4160-906B-00752AF46C00","f4_colorA":"F4FB338F-DCEE-4AE1-9C1E-C1204918EFE5","f4_colorB":"FAED7E38-9F1A-4B8D-88E0-AA91CC15D7FA","f4_alpha":"268FF7F8-31B5-4C9A-A137-05F33A70AB74","f4_mode":"8E241CC0-6B9B-4301-8487-4043C1F34DA3"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"5F56FDCF-8498-422E-8125-CC410A089B6A","f3_bias":"507E1603-D6EE-4D02-8B1B-A1C774A2C5FF","f3_scale":"F4121A42-3FB1-4622-97E4-8F46BFEE696E","f3_intensity":"199BC4A5-3766-43D0-B0AE-122DAF35AD2A","f3_factor":"72A6ED3E-A5EC-4246-8758-FE1B26B8174E","f3_alpha":"6DF01D63-F84D-44D1-8C3B-8734B6F5A53E","f3_mode":"52B27C23-1097-4795-A82D-5062FADB840A"}}]}},{"uuid":"232ABFB9-00BC-49C7-8037-979EA4364C0B","name":"State 1","position":[104.97217124530464,-175.33267147612932,156.21358813721042],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8B9E292D-5248-420E-B10F-9BFAE6FE7E87","f1_mode":"377A2866-48D5-4745-A1AE-077241790A96","f1_shininess":"4153FB44-2C1C-4CC4-86E6-79E32573DDB5","f1_specular":"0B048450-A041-4935-B3F4-207CF5429D33"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F42CA235-6242-4B37-9B64-4D6F22606E49","f2_ior":"DBC4C04B-A76B-4FD6-92E5-4D74156453A8","f2_roughness":"D184E1B4-2E22-460B-8285-2B3EEE0CEE42","f2_transmissionSamplerSize":"CB9C1019-0583-4BD8-ABDD-0774A82870F8","f2_aspectRatio":"D185C264-3FEB-4F03-A1DC-1757643E6966","f2_alpha":"C897F4D5-7A79-460E-9566-59D035716544","f2_mode":"111C169D-7DEC-42E6-BA87-D3C6C97754C4"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"1109B58B-278E-445C-A7C3-E15EA5B2C58D","f4_far":"91A3EE1B-004A-4696-8957-0E09FFD9B860","f4_isVector":"435FA2CB-DFB7-4044-92F8-D4C6CBB17D64","f4_isWorldSpace":"B24203FB-344E-4B85-B59A-0B25F78E6CDC","f4_origin":"EE68398E-95EF-4C99-BE4E-3248F4451A2B","f4_colorA":"65C972D0-7B53-4D46-89B6-BD93654F8A67","f4_colorB":"233655E6-5C8F-402F-AFED-101E57AA561A","f4_alpha":"A6C729D7-587F-4661-A466-BFA4AAC47D90","f4_mode":"5388591D-A7EF-425E-B001-CCDB65039F37"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"33A01DF6-FB67-4A3C-B36A-F9B388BABCCB","f3_bias":"8099F9B8-5E8D-48DC-976D-55E86D436082","f3_scale":"5CB27644-E75E-49B5-A70C-89E55D3EAC7E","f3_intensity":"F05AFDE3-E02F-486D-AC8D-FD38021B00D4","f3_factor":"214602FC-A933-48FD-90E7-FEC92FA22E23","f3_alpha":"C4AD9E08-8E32-416C-A2FF-60F506AA2F9A","f3_mode":"E947949B-8CAE-4747-895D-635812007C16"}}]}},{"uuid":"B0FD718F-8EEA-41BB-8737-77F027FCD758","name":"Base State","position":[-180.82350074513494,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D6C31780-9CAD-43D2-8E90-F2759644CAEC","f1_mode":"C57203FA-CB51-49F0-80DE-B96A27E6348E","f1_shininess":"8C29D622-9AEC-4FE1-A0AD-CE332A9682C7","f1_specular":"5DD3875A-F8E5-4861-89D3-85DED6F3F754"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"D3F57E60-F327-4040-9D92-CCC23C63761C","f2_ior":"9AD6F493-6FE7-4E38-8C2E-6EAD53ED383F","f2_roughness":"356CAE88-E9BD-4F42-A675-3419D1685B33","f2_transmissionSamplerSize":"47FAD809-979A-4771-9EA8-C6571DF28D29","f2_aspectRatio":"ADE793A8-0AFD-4804-9AC3-86018BA66B40","f2_alpha":"98292E8D-ED3E-47BA-852B-46F44792FB6D","f2_mode":"3E41CE06-79C2-4C57-8F95-1FB94BB13F4B"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"55A264D9-8EE1-4955-BB59-7331812DE8A5","f4_far":"94A7AB5E-5995-4B57-926B-56802B00A7C1","f4_isVector":"B5DE081B-F35A-4CA3-8BBA-BB9DBB7C7B63","f4_isWorldSpace":"5ED5AA51-E3A3-47C0-BBFE-25EF23D6CE3D","f4_origin":"D62F9F39-A6D9-4FD7-88F1-DE4A03AB071C","f4_colorA":"2FF1E6CE-6C3C-43E4-837B-DAA88E87068B","f4_colorB":"D8E948CF-DE63-48AB-B4C2-237E8A207790","f4_alpha":"790CACD2-9F54-430D-BD1F-45210B93C8A9","f4_mode":"E05A33F8-2B1C-4F44-9DA1-DA12BFC46009"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E7D44468-06AE-476E-A495-AA3756F7BCF2","f3_bias":"6AC78D70-B6A0-4ED9-B3EF-BA30AC6B503F","f3_scale":"BC5B5CD1-C6CC-4A8D-8BE5-61DA2B310AC1","f3_intensity":"D9D972F6-9306-487E-ADE2-D6DFD38B774B","f3_factor":"A61A39C7-AE2B-485B-9438-A6F6D75B8D41","f3_alpha":"4DE8E091-D329-4D39-B03F-0670AC876A9F","f3_mode":"52A35D46-B278-4780-B1B8-CF9EEA50B16B"}}]}},{"uuid":"8B021AA7-3767-4FE4-A69E-24708D8A52D3","name":"State 1","position":[-180.82350074513494,0.4178501358965292,-98.63279130365652],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8A1821B0-5D72-42F4-9AF7-29E9966572D6","f1_mode":"4605DF9C-2BAB-4DDC-8188-8C2097D54F30","f1_shininess":"682CF624-452E-4E36-8D37-479470D75B1A","f1_specular":"94E37E44-91E5-4296-B896-CBAEDFCB03C8"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"A1992BB6-1D93-41F1-871F-69E318F0561E","f2_ior":"FEFE6B82-4813-4B38-A580-1389D7F461DD","f2_roughness":"8403DB96-E6B9-4EB8-9585-CDC583C923BC","f2_transmissionSamplerSize":"5E8946D6-AE60-453D-AF41-D27C0016D841","f2_aspectRatio":"E3EF3FCF-6A5B-4C3B-8970-D6D13CC52374","f2_alpha":"CF5ED6CD-7449-48D0-9E7C-C37089E4F9E5","f2_mode":"DCFAC8FB-203B-488E-B6A5-C1CEEF2A6238"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"118DB27F-BAFD-4F9A-ACFB-5F1336514112","f4_far":"0FBED206-5BE9-4DBA-AABA-9CE99C01C59D","f4_isVector":"48667350-C677-4F2E-87A3-FDDAE10D9704","f4_isWorldSpace":"91E99B16-D207-4AFB-976D-9126BA0CC680","f4_origin":"6C077010-671C-47A3-A7A5-C5600A524AC6","f4_colorA":"1BB5512B-2A19-4B78-A5CB-D9E03D323387","f4_colorB":"162D2AEC-71C3-4DD2-AD15-29C9C43989F9","f4_alpha":"67847503-9755-4B36-BEC9-2AEAC121013C","f4_mode":"68AF7F62-6A88-476B-A736-CD3A95BD6C9B"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"0273C120-01EC-4ABB-AA60-E48EA822E761","f3_bias":"10516967-11B3-448E-AD8E-4AFE5D4A965E","f3_scale":"040817A2-4942-47D9-BE17-E38416887A56","f3_intensity":"A118B483-B738-4B89-A46F-1998A32EC543","f3_factor":"FF6D6224-336D-42FD-8B78-D19F08ABACE6","f3_alpha":"E3E1488B-DCFD-4D63-B621-B067C52C6467","f3_mode":"A4405252-F0FA-4A4D-91D9-C797E3B5252B"}}]}},{"uuid":"8A056A08-77F3-437B-9228-2A7A16DFBF8A","name":"Base State","position":[109.51129684329464,-121.3895460375428,21.17660453440807],"rotation":[2.7925268031909254,0,0,"XYZ"],"scale":[1,0.9999999999999993,0.9999999999999991],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"418CD8D1-12DC-4F52-90A4-AC8B5DAF4D77","f0_alpha":"6985C7D4-D0DF-4EE8-9C45-86D22C4F70AC","f0_mode":"769D3AC5-71E6-4150-88CE-CF914968A2E4"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"86FDC4B6-0316-4153-8638-FE86CD1A1BB2","f1_mode":"85F18CF7-4CEF-40E3-BCD7-D78A0D617BEE","f1_emissive":"CBD1EC82-9C4E-4D22-A2A5-3331DCEB50FD"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"1DEA40C3-36F6-4B25-81FA-A986895EFCE6","f2_bias":"C29F3F81-10AB-4EEF-9D2C-910C236A6046","f2_scale":"7E147E75-C2C5-4CD2-9BD1-3F2A2983516C","f2_intensity":"2F7EA951-2B13-4AAB-A9AD-862EF1286AFC","f2_factor":"DC4474BC-50BB-40E8-A772-0D4051F4AE80","f2_alpha":"02F42DC1-F60D-43BA-9503-3890853D0EE9","f2_mode":"0418AF7B-E500-42E1-A196-1CABC7B00A29"}}]}},{"uuid":"3A18B19F-A3CD-4A64-A6B2-748864F843DE","name":"State 1","position":[109.51129684329464,-121.3895460375428,21.17660453440807],"rotation":[-0.34906585039886795,0,0,"XYZ"],"scale":[1,1.000000000000002,1.000000000000002],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D5DEF03C-A47B-4B30-89C5-6F894B450D1C","f0_alpha":"58D640F5-B953-4B1C-BEAE-73D65A914A67","f0_mode":"7E8B150E-A5D8-4D3A-AD94-AB629BA31795"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4A551C52-EED5-4630-B3D3-3BF819CC3BC5","f1_mode":"AB5301EB-553A-4704-9011-9047D794CC28","f1_emissive":"65B930DC-CAAB-4E11-AF55-A81AE8CE447F"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"678FD6D1-BDAB-4C70-8D7B-774719A975BA","f2_bias":"56EAA0D6-2348-4E7D-94E8-6DE1511C61B5","f2_scale":"8E2B9193-0C66-4C20-BA98-128F82D2FF45","f2_intensity":"D5751220-A6BE-4736-BBC1-22CB3506E3E6","f2_factor":"F962D150-9AD7-4F7B-A16B-A8DABB2B117C","f2_alpha":"BA7C03FB-527E-49AE-B109-25CDB107BFBA","f2_mode":"A7AD7FA4-32DE-4307-ABAC-A9F51A6AC1FF"}}]}},{"uuid":"907C1AA9-85E9-411C-BD55-6D2BB1B1C1EE","name":"Base State","position":[10.534771456721458,-122.15293403303363,17.637833140228576],"rotation":[2.792526803190926,0,0,"XYZ"],"scale":[1,1.0000000000000024,1.0000000000000024],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D0E478AD-4EB9-4FE4-8FBE-466EEFC8E3F2","f0_alpha":"FBDEC2F2-9901-4BFB-AF92-0A519CB676E4","f0_mode":"44BB4B17-9EA6-43BC-B735-0357EF19C01C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"11347943-E66A-462C-8DB5-D1A8F781B27F","f1_mode":"0E3AA4D0-85C3-4C6C-9542-DDB7715D3B63","f1_emissive":"6349F466-7AE8-4338-96B2-2C25C6AF0629"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"46BF8DAF-8428-41C4-86D1-60E8F7DB65D0","f2_bias":"A3982B6A-1CCF-4D34-A97B-48ABAFF5C648","f2_scale":"9D887CAD-2456-4EF7-9E36-3F153A4C9AFF","f2_intensity":"DB2C5987-7F2F-40B8-AA65-05AA339F0A8B","f2_factor":"7CB3849F-CE7E-4773-902E-1C84170F097B","f2_alpha":"77D9B344-C4B9-42DD-911F-6A31113F8464","f2_mode":"6F3A3262-7651-40BD-AF00-D68822DEAB24"}}]}},{"uuid":"FA4C95D1-10CC-46FD-BA50-13119F236723","name":"State 1","position":[10.534771456721458,-122.15293403303363,17.637833140228576],"rotation":[-0.34906585039886745,0,0,"XYZ"],"scale":[1,1.0000000000000093,1.0000000000000093],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":100,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"7A744E0F-D2A4-4A45-8EFC-3B6D3678B333","f0_alpha":"D6C99907-5FD1-4158-ACBD-F6A956E0FEDA","f0_mode":"9844533F-C7EF-4306-82AC-7258B9136A83"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"35411740-DA3F-482E-B7E1-22F2137056D6","f1_mode":"FAAD93D9-6B0F-43B9-8EEA-5627F7B4B0E2","f1_emissive":"18A36149-6A71-4B1E-A453-D0C5E6A072A8"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"E2DA941C-C197-4254-B6E2-0588A393DF7A","f2_bias":"54E75758-E01D-43D2-90A9-10021E11FC5F","f2_scale":"27B4E049-74DD-4DAC-92C3-3B0C1FA0ADB0","f2_intensity":"371A7FA7-346E-4F0D-B9EC-97D7F03B1422","f2_factor":"D9035E19-55FD-4491-AEE4-7BFF37EC3175","f2_alpha":"AB9446DC-C2E0-47C8-A51A-12666059C91E","f2_mode":"CAFFAF9D-65A3-4631-93BD-C705F80F95C8"}}]}},{"uuid":"035117A6-16BB-479C-AA37-3EAFBC4DAAED","name":"Base State","position":[-92.46522854327877,-73.79488051928482,4.26206273772965],"rotation":[-0.3490658503988659,-2.4492935982947064e-16,-1.2246467991473532e-16,"XYZ"],"scale":[1.000000000000012,1,1.000000000000012],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":110,"height":200,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"FEB323BD-029A-4451-A382-ADDE3E4B4710","f0_alpha":"91EBEEF0-905A-4B46-900A-55FE870FEA7B","f0_mode":"949071CF-98B8-44F8-ACB0-87216B6FBE6C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8D4C830B-6859-4ED3-B6FB-514389568ED5","f1_mode":"DFEB3779-0DA2-40AA-A8E0-D8A7F111B6F4","f1_emissive":"A6EB1A80-2533-40E7-A834-DA731F2C4984"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"2600EEE4-AA45-42B5-918E-1D792ED8A3DB","f2_bias":"0D6F6924-5B8B-4B52-A6D9-C1C56B9D1522","f2_scale":"4DBD6E41-C4EA-4401-B474-275AFB788426","f2_intensity":"77905147-F11E-4A19-A7ED-A5EDA1C079A4","f2_factor":"D6F48722-36BD-481D-80EA-AF3FC4439FC0","f2_alpha":"C4FCED98-60EF-43B3-8682-924881411E3B","f2_mode":"2D844965-C892-4F3A-8C9D-CCB93CF1CC1D"}}]}},{"uuid":"3A86C3B9-4C99-4202-BEB0-B2C431A482DF","name":"State 1","position":[-92.46522854327877,-73.79488051928482,4.26206273772965],"rotation":[2.792526803190927,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.000000000000045,0.9999999999999991,1.0000000000000402],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":110,"height":200,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BD0900C4-6A00-492E-84CC-E7A886DC87C5","f0_alpha":"0DFFA64A-49CF-4B1A-B799-238B5107B139","f0_mode":"BA57A86F-0C47-4CD0-8B21-971A9428F080"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"16774011-4D56-4AB6-B86A-60FB6D45E3FA","f1_mode":"E48AC673-ECA1-437F-BF5A-458CD6BF4F18","f1_emissive":"F466CDEE-42EC-4DD7-97EB-7EB5E415ED90"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"1E54B72A-CE5A-4BDD-992A-E0FAA77CE173","f2_bias":"97F661C5-E9C4-46C3-99DE-0C6A6BDE399C","f2_scale":"EC9C8680-E016-426C-A308-33BE453A9DF1","f2_intensity":"D189EAA6-3A59-48CA-81CC-F12C0E912161","f2_factor":"4D0B85EA-46D3-4028-B417-3F18F0BEC548","f2_alpha":"E630E023-3ECD-4FF4-AB34-4CE1244B0A87","f2_mode":"C64C9E32-6BD2-450A-B1EE-D24076E3F7F1"}}]}},{"uuid":"CAC32034-FC42-4F56-9BA1-B4CC0A4E779F","name":"Base State","position":[60.53477145672121,-27.242356786268587,-12.710181232475918],"rotation":[2.792526803190926,0,0,"XYZ"],"scale":[1,1.0000000000000093,1.0000000000000084],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":200,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D9FA023F-FA5E-4FDD-A1E6-86F33C884130","f0_alpha":"024A7D02-2210-46CD-8F58-90E75EE00105","f0_mode":"3A7C68FF-37FD-4761-8900-C79B547CBA21"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"FB9BFFE5-1A52-46C9-A997-28F9C52ECE53","f1_mode":"76505991-2A0D-4B57-AAEB-CA73AEA36DF3","f1_emissive":"8AD467C5-1E59-43B9-AA4B-C789ED5BE0C6"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"A97CF51B-63CE-44EF-8AFC-60D199C943F3","f2_bias":"B1B2257B-CBBA-4CED-8700-F8B2ECD43329","f2_scale":"9A339556-D479-4695-A443-3C312725B837","f2_intensity":"08A7CC82-84EE-4EF7-981A-EC792AC7711B","f2_factor":"DA971E8F-7C3E-4EAA-B9BA-1E799B137E1E","f2_alpha":"D6C2780C-B9B5-49CF-B9E4-DEDFB6251CCB","f2_mode":"86366B57-50BD-4834-8AAE-EB662DB3E2C5"}}]}},{"uuid":"BB63C07E-8221-497A-B065-F19CE4FA1F94","name":"State 1","position":[60.53477145672121,-27.242356786268587,-12.710181232475918],"rotation":[-0.34906585039886745,0,0,"XYZ"],"scale":[1,1.0000000000000162,1.0000000000000162],"hiddenMatrix":[1.0000000000000002,0,0,0,0,0.9999999999999999,0,0,0,0,1,0,-6.938893903907228e-18,0.0783333325989517,0,1],"geometry":{"width":200,"height":100,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"572DC9A4-722E-4A09-99A1-F101F7EB6CF4","f0_alpha":"534C2253-F7C3-451D-9C1E-3C4006C180DE","f0_mode":"34901584-1E6A-4B55-A559-41236B5783C0"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"57D72748-A897-4B5C-B26E-930D542A0E7B","f1_mode":"0F309ACD-DD06-45D9-B299-BFCD0392C415","f1_emissive":"D2F5FF31-2C2E-4332-9BBB-A28D8B19FA79"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"4B41B651-31B3-47B1-B29B-A279CDE00EAE","f2_bias":"1B796C5A-04D5-4076-92AA-8905F8E93C8F","f2_scale":"1A50CB87-7600-4033-93B4-83BDA71038DA","f2_intensity":"D81C940B-6AA6-40E4-9282-0F86000D91E2","f2_factor":"75E2645E-796C-4681-A495-C56D56117E47","f2_alpha":"14A6E420-B258-453E-A491-F8CC9C1EE5BC","f2_mode":"089CBC74-D719-4924-9C32-657E6263DEEB"}}]}}],"nodes":[{"uuid":"7936E190-C305-4F76-B544-3BDC3ADE7DB7","type":"f","value":1,"nodeType":"Float"},{"uuid":"6D2A9A5D-90C7-4222-AA95-9F8A22E29DB9","type":"i","value":0,"nodeType":"Int"},{"uuid":"12A8463A-7688-46B8-BF7B-043D92D261CC","type":"f","value":30,"nodeType":"Float"},{"uuid":"5049C359-2282-4484-9992-E1B05E75209B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"86A46368-0FED-4574-9F94-1133695FBBF2","type":"f","value":10,"nodeType":"Float"},{"uuid":"6521A072-27B2-4294-A47E-75D4388106DC","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"BCCC2E56-F2AA-4FF3-8478-29E7629AB925","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"31178B5B-BED1-48A1-9F71-A015984F1C78","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2CDF13FB-AB4B-4F55-BDA9-2F3A29C52FA6","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"7DCEE7A2-DCD9-4AEA-80E3-E2C83B9DCCBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"F9708C08-7F82-4D8B-B44F-A319C8B6EBF6","type":"i","value":0,"nodeType":"Int"},{"uuid":"726FCE56-AA38-41F5-BB2B-E05EE32859D9","type":"f","value":50,"nodeType":"Float"},{"uuid":"355B161D-3B93-465A-B4C9-A6DD01973A07","type":"f","value":105,"nodeType":"Float"},{"uuid":"34531D40-80CE-4D07-A18D-A197F9F8D4ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"E001088A-4285-4FC6-937C-946514CB6829","type":"f","value":0,"nodeType":"Float"},{"uuid":"F6F92EB7-EA92-4CEB-9007-69D4C982525B","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"6B0CD2BA-0FAA-45E9-9118-6C7A4013C333","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"A0408019-A0F8-477A-A310-2D329B8FF485","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"A4F2A1E5-87CD-4EA4-A546-6E53FBE1890A","type":"f","value":1,"nodeType":"Float"},{"uuid":"D834B835-904F-4EF7-803E-1782A27ED424","type":"i","value":1,"nodeType":"Int"},{"uuid":"B61F5E7D-6FC4-4F6E-A7BF-05A73D6C6ED6","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"438D32D3-7DDF-47BA-A0E6-A319967844E8","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DC166E9F-9489-40BD-B671-B1B9A6D44857","type":"f","value":1,"nodeType":"Float"},{"uuid":"24276B7C-499A-4C0F-9EF1-7BDCC80BFB37","type":"f","value":2,"nodeType":"Float"},{"uuid":"5484FEC1-9F8D-4626-80C7-D4A8F6A28283","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F0B6683-FD40-497F-8A36-29995AD1404B","type":"f","value":1,"nodeType":"Float"},{"uuid":"1D6E28DD-A81C-40C2-B42C-4A256E7DFF50","type":"i","value":2,"nodeType":"Int"},{"uuid":"48DE2E51-2005-4791-9ED6-F78F6B5C122B","type":"f","value":1,"nodeType":"Float"},{"uuid":"5C9DEE0A-FDB5-44DE-A059-CB242ACDC26F","type":"i","value":0,"nodeType":"Int"},{"uuid":"F6BA8930-F525-4FA4-8B53-49114B253513","type":"f","value":30,"nodeType":"Float"},{"uuid":"C0439DE2-D053-4D19-9FD9-E27424C794FF","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"2C63691D-D9A6-438E-806F-6F33976676F1","type":"f","value":10,"nodeType":"Float"},{"uuid":"954C0689-528F-48D1-9626-4233633F8950","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"EC719995-6A35-4A70-9632-508EE559530C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"99E80BCF-63F6-42F1-BCCA-7E6048DF3C35","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F2D2242C-AED2-444E-AB84-BF17714DB8E0","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"64713045-81A4-4CE4-90D4-66C9A9CE8478","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4C7766B-1FCA-431C-BF01-0BD7D04C59A3","type":"i","value":0,"nodeType":"Int"},{"uuid":"0D2F25F3-B3E3-428A-9416-5453418A75F8","type":"f","value":50,"nodeType":"Float"},{"uuid":"A4E34779-67B4-46B2-BA5A-4AF697E98788","type":"f","value":105,"nodeType":"Float"},{"uuid":"E6158A8D-18F6-4F09-AE41-CA504872E03A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BBC5C0B7-E79B-4879-818F-142E055F32D4","type":"f","value":0,"nodeType":"Float"},{"uuid":"2B4873EC-076B-49BC-AA62-5245759BDB43","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"44CCE824-DF4D-4B88-9B4D-8E2197B37D65","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"326F24DD-6535-460A-8314-FAF5A8608FAB","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"63D315EC-1ED2-4348-AB79-A2319E088936","type":"f","value":1,"nodeType":"Float"},{"uuid":"48AD85A3-A444-45C7-8EEE-E623BF817F3B","type":"i","value":1,"nodeType":"Int"},{"uuid":"5CA3E9B6-F848-4FF1-9995-E4CA10A8BF33","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"142BC173-41CD-40E0-B241-214AC89D9F4E","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"154A5B0E-B261-4D99-B150-0DEF8A0C3133","type":"f","value":1,"nodeType":"Float"},{"uuid":"D1FF9734-6D25-49B0-BC0F-FD3A07C9C209","type":"f","value":2,"nodeType":"Float"},{"uuid":"CBCEF956-A3B7-438E-997C-0DB5AD67E6EC","type":"f","value":1,"nodeType":"Float"},{"uuid":"78CD79E5-2FD4-421E-A9C9-DA2F7C9FC88F","type":"f","value":1,"nodeType":"Float"},{"uuid":"AC5D7E76-62F1-4748-AFA7-63E6391EB1B2","type":"i","value":2,"nodeType":"Int"},{"uuid":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","type":"f","value":1,"nodeType":"Float"},{"uuid":"97EF242E-3A72-4EB1-9450-30B50662F407","type":"i","value":0,"nodeType":"Int"},{"uuid":"B1F3FB31-A409-4891-A7D0-B3936E663135","type":"f","value":30,"nodeType":"Float"},{"uuid":"195C69AA-E265-4F6E-962E-82AF11795549","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"BF030439-0A95-48F5-ABEB-1859CD2CE6CB","type":"f","value":10,"nodeType":"Float"},{"uuid":"7B3E20AF-326C-4B7D-A0B6-A7E28541315D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"1CD7BA31-1825-4DE0-8D3D-AA569D32AEF9","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4303D30E-8258-42B6-BFFD-30B80A22DF0B","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"4EA4B994-9BAB-4752-A76B-00320E1156E7","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"1169A35D-EA8C-4ECF-B598-ED880C08E941","project":false,"nodeType":"Texture"},{"uuid":"1169A35D-EA8C-4ECF-B598-ED880C08E941","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A3743A9B-18D9-4C5E-804B-73ED22103AA2","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"52A62366-A2F8-4195-8B69-857543C404C2","project":false,"nodeType":"Texture"},{"uuid":"52A62366-A2F8-4195-8B69-857543C404C2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BF2BA757-A968-44C1-B89F-614A3DFFC615","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"0C1ECA59-4F10-4364-95D8-125725577DA0","type":"f","value":1,"nodeType":"Float"},{"uuid":"082C5E1C-DB3F-47F5-AC16-929FD2438283","type":"i","value":0,"nodeType":"Int"},{"uuid":"559C82D0-5E62-42BC-BB39-83F2BF6E7811","type":"f","value":50,"nodeType":"Float"},{"uuid":"D816658F-7125-4B26-837E-98CBD1207084","type":"f","value":105,"nodeType":"Float"},{"uuid":"549944E5-663E-4B52-88A2-B1F3951CECEA","type":"f","value":1,"nodeType":"Float"},{"uuid":"445D34BB-CDD9-48B6-B4D8-3B1741891D01","type":"f","value":0,"nodeType":"Float"},{"uuid":"AB308043-0441-41C0-B5A0-58D8FD467066","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"ACDBB668-E042-467E-AF2E-6441836570FD","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"D7B4FBD7-D71B-4CB9-801B-1C7D499EC1E1","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"5089A034-F8BB-4E29-8338-251C02ECEE34","type":"f","value":1,"nodeType":"Float"},{"uuid":"E576195A-6FE2-4359-A05C-1F334BED38CC","type":"i","value":1,"nodeType":"Int"},{"uuid":"5C9ABCB6-0426-4B1E-8ABB-C30DF7EDD9EF","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"2DD10375-E2ED-406B-B679-0585F76FD515","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"8D5EDCD7-8345-4D03-A94B-8A40D889B9AF","type":"f","value":1,"nodeType":"Float"},{"uuid":"290811FA-ED57-41A2-A635-03AB4B86122C","type":"f","value":2,"nodeType":"Float"},{"uuid":"F10D067E-5055-4DFA-9D8A-49AA5F76DE60","type":"f","value":1,"nodeType":"Float"},{"uuid":"91DD0E02-82E2-4023-B138-1B190B2144BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"FC61C158-A25A-4FB6-A624-42DD54DFB0C1","type":"i","value":2,"nodeType":"Int"},{"uuid":"82FCED54-F37F-4E88-BA64-B2E125F4D07B","type":"phong","color":"06C5D6EA-01B4-4A09-BE4D-4D3C61298284","specular":"195C69AA-E265-4F6E-962E-82AF11795549","shininess":"B1F3FB31-A409-4891-A7D0-B3936E663135","shadingAlpha":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","shadingBlend":"97EF242E-3A72-4EB1-9450-30B50662F407","afterColor":"D800907A-E7A8-4C0F-BA02-BC4829DD08D3","alpha":"DA2F4B51-F725-4663-9B62-E13C33E560C5","nodeType":"Phong"},{"uuid":"06C5D6EA-01B4-4A09-BE4D-4D3C61298284","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D800907A-E7A8-4C0F-BA02-BC4829DD08D3","type":"v3","a":"ACE1CDEE-93FA-4D9C-85EC-6610144F4606","b":"1F4C1213-3C55-4280-AC1B-F4F5A33B1AA7","alpha":"E7C07A21-9838-43CA-9705-1F40327E5193","mode":"FC61C158-A25A-4FB6-A624-42DD54DFB0C1","nodeType":"Blend"},{"uuid":"ACE1CDEE-93FA-4D9C-85EC-6610144F4606","type":"v3","a":"6EB907F9-D1AF-480E-AFA5-B4006CA2E338","b":"42BE01CD-A2DD-4951-A9FE-C2E8E5D8CDCA","alpha":"3EDF8060-E645-485F-BCB9-CEA1676B404D","mode":"E576195A-6FE2-4359-A05C-1F334BED38CC","nodeType":"Blend"},{"uuid":"6EB907F9-D1AF-480E-AFA5-B4006CA2E338","type":"v3","a":"05801061-0F40-4F15-8AE6-4E51B700B81F","b":"E0CB4B07-9AD8-4AEA-B6F2-6CB65A8A3E71","alpha":"4685E264-8DBF-40D2-932F-E31F9533E207","mode":"082C5E1C-DB3F-47F5-AC16-929FD2438283","nodeType":"Blend"},{"uuid":"05801061-0F40-4F15-8AE6-4E51B700B81F","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E0CB4B07-9AD8-4AEA-B6F2-6CB65A8A3E71","type":"v3","thickness":"BF030439-0A95-48F5-ABEB-1859CD2CE6CB","ior":"7B3E20AF-326C-4B7D-A0B6-A7E28541315D","roughness":"1CD7BA31-1825-4DE0-8D3D-AA569D32AEF9","alpha":"0C1ECA59-4F10-4364-95D8-125725577DA0","calpha":"gE0CB4B079AD84AEAB6F26CB65A8A3E71_calpha","nodeType":"Transmission"},{"uuid":"4685E264-8DBF-40D2-932F-E31F9533E207","type":"f","src":"gE0CB4B079AD84AEAB6F26CB65A8A3E71_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"42BE01CD-A2DD-4951-A9FE-C2E8E5D8CDCA","type":"v3","near":"559C82D0-5E62-42BC-BB39-83F2BF6E7811","far":"D816658F-7125-4B26-837E-98CBD1207084","isVector":"549944E5-663E-4B52-88A2-B1F3951CECEA","isWorldSpace":"445D34BB-CDD9-48B6-B4D8-3B1741891D01","origin":"AB308043-0441-41C0-B5A0-58D8FD467066","colorA":"ACDBB668-E042-467E-AF2E-6441836570FD","colorB":"D7B4FBD7-D71B-4CB9-801B-1C7D499EC1E1","alpha":"5089A034-F8BB-4E29-8338-251C02ECEE34","nodeType":"Depth"},{"uuid":"3EDF8060-E645-485F-BCB9-CEA1676B404D","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"5089A034-F8BB-4E29-8338-251C02ECEE34"},"nodeType":"Expression"},{"uuid":"1F4C1213-3C55-4280-AC1B-F4F5A33B1AA7","type":"v3","color":"5C9ABCB6-0426-4B1E-8ABB-C30DF7EDD9EF","bias":"2DD10375-E2ED-406B-B679-0585F76FD515","scale":"8D5EDCD7-8345-4D03-A94B-8A40D889B9AF","intensity":"290811FA-ED57-41A2-A635-03AB4B86122C","factor":"F10D067E-5055-4DFA-9D8A-49AA5F76DE60","alpha":"91DD0E02-82E2-4023-B138-1B190B2144BF","mode":"FC61C158-A25A-4FB6-A624-42DD54DFB0C1","calpha":"g1F4C12133C554280AC1BF4F5A33B1AA7_calpha","nodeType":"Fresnel"},{"uuid":"E7C07A21-9838-43CA-9705-1F40327E5193","type":"f","src":"g1F4C12133C554280AC1BF4F5A33B1AA7_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DA2F4B51-F725-4663-9B62-E13C33E560C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"3DA03F19-545A-4589-AA7B-6E25E4E0D5DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"C69DC518-BD0A-4199-A470-1CF3C32E8B0B","type":"i","value":0,"nodeType":"Int"},{"uuid":"BF5A61A7-0E18-40AB-86E5-E6EF69B26F70","type":"f","value":30,"nodeType":"Float"},{"uuid":"1DFF4111-7CB1-40DF-85DB-C14DAB361EC4","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"6F55703E-7483-4D40-9969-D5B3F6F47488","type":"f","value":10,"nodeType":"Float"},{"uuid":"C2DEEF5A-84DA-4690-B378-D1D08E56AB07","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"04231C55-F01B-41AA-BF9F-D240CB0E8C8C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"AD7E859A-7AF2-4D2B-BF22-27AE46790426","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9195E340-48A1-46C2-A2F7-A713D2D7D138","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"38B50BB7-2E70-4598-854E-C60D8E1C26D2","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8C9FE33-8A8D-4324-B041-4DEF2454CFD9","type":"i","value":0,"nodeType":"Int"},{"uuid":"74BFEA8C-1762-4E59-BF8D-CC35BABACB31","type":"f","value":50,"nodeType":"Float"},{"uuid":"0E867D03-907E-407A-9368-71733D445716","type":"f","value":105,"nodeType":"Float"},{"uuid":"3B632DFB-17F6-44E6-B32E-1644F9A1505E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B9D45347-7349-4FA3-A6D4-DDB722458885","type":"f","value":0,"nodeType":"Float"},{"uuid":"744A3D08-3C93-4013-91FA-2A13AE212C56","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7804FE65-BC98-476D-AC3A-0A5E04565531","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"EB7CAC1A-B3BF-43F1-ADD7-435CB2A268F4","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"E7359B5B-4500-468C-AC05-0821AFDD537A","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F2754F3-EAF6-4BFC-8926-6E2B859F0915","type":"i","value":1,"nodeType":"Int"},{"uuid":"7D3F8D80-3A76-4E88-9D49-B9872278E61E","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"62534628-DB12-4E5B-873C-E73053BBAAC1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"001D0471-BF78-44D0-8891-D2651EBFC23A","type":"f","value":1,"nodeType":"Float"},{"uuid":"E37A142D-97F0-485C-B757-1CED06AD4A32","type":"f","value":2,"nodeType":"Float"},{"uuid":"AA11650A-C2FA-4B59-9281-809A0E6F6244","type":"f","value":1,"nodeType":"Float"},{"uuid":"EE05A829-9C2E-4A23-8047-B0EAB8A05795","type":"f","value":1,"nodeType":"Float"},{"uuid":"810307BF-81EF-43EB-A933-2181346188F0","type":"i","value":2,"nodeType":"Int"},{"uuid":"0D06A676-D80C-44EA-8678-E5FF3D27808B","type":"f","value":1,"nodeType":"Float"},{"uuid":"1C3ECC7A-0342-41F3-8B54-678CBAE755A2","type":"i","value":0,"nodeType":"Int"},{"uuid":"A65AB37D-FF35-4620-87FA-6D1E98E7B5F2","type":"f","value":30,"nodeType":"Float"},{"uuid":"C648B78F-CE53-469A-8955-0DD0B2C0B113","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"E8D32737-8EF8-4363-92FB-90BD5720D706","type":"f","value":10,"nodeType":"Float"},{"uuid":"66735D07-0CD3-4087-AD96-FAD7A9EDE884","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"4C525C75-2745-4265-BB55-07ED7A5831B5","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1FE11BC8-8248-473C-819D-D6340E9ACB0F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"BD2C0164-1BC8-4D65-BE37-31FEA64459C8","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"49B2C012-E388-4FA8-93F5-9B537A176D46","type":"f","value":1,"nodeType":"Float"},{"uuid":"E09F74E5-32A1-443A-9D99-CC1150970B83","type":"i","value":0,"nodeType":"Int"},{"uuid":"64E49FA0-66B2-4C10-90AA-A4D8F2BA56B1","type":"f","value":50,"nodeType":"Float"},{"uuid":"A3ACFA3B-218B-4E1A-906E-ED29F2E48F4A","type":"f","value":105,"nodeType":"Float"},{"uuid":"CB168406-00EC-4F4C-AAC4-6E3FA62B51A0","type":"f","value":1,"nodeType":"Float"},{"uuid":"8F1A09D7-97C2-403C-86B4-3D889500CCFF","type":"f","value":0,"nodeType":"Float"},{"uuid":"999FE4BA-777F-46F9-9119-99EAA96FF4C6","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"CB8ADA49-DAA0-40E2-BD62-0ED4A95FDBE3","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"6CB78281-922A-472B-9826-00C67619BE56","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"1080D098-B7E7-4315-B2BF-75148CF8AB47","type":"f","value":1,"nodeType":"Float"},{"uuid":"94BF5799-EABE-4EAB-B25A-114B642615D2","type":"i","value":1,"nodeType":"Int"},{"uuid":"FFAB1D99-8BC5-488E-B058-A50FA6B7418D","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"79282C8B-BEC7-41D9-9BDE-C65FCEB45EE1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F2BDD247-0771-4E25-A23E-1973D42D9EBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"763DF174-F371-4C31-A327-A7B4CDD073E2","type":"f","value":2,"nodeType":"Float"},{"uuid":"29741B42-8186-40E1-AA64-CD961A80387A","type":"f","value":1,"nodeType":"Float"},{"uuid":"53194445-5DEE-4811-B8BC-41686E22764E","type":"f","value":1,"nodeType":"Float"},{"uuid":"7C634F98-D26E-41BF-BDC6-4359B32F533F","type":"i","value":2,"nodeType":"Int"},{"uuid":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","type":"i","value":0,"nodeType":"Int"},{"uuid":"C12A9B9B-DC1F-49E8-81F7-A1B38E2C4A1C","type":"f","value":30,"nodeType":"Float"},{"uuid":"7564AE94-182A-4284-B519-6CABE470945D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"DA697F1B-2B2B-40D0-83C3-624A7A5FB327","type":"f","value":10,"nodeType":"Float"},{"uuid":"55F9D5C6-E12B-4511-9934-4BDA6F26BEF3","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"16387422-F8B1-4A2D-83E7-D18DF4A89FDA","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"758E516C-C777-4F55-BD69-42A6FAB1320E","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"BABF3C75-68F7-47CF-8FAF-7F5277D58226","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"2AD780E1-8B56-4182-A3F4-AD72CD31ED16","project":false,"nodeType":"Texture"},{"uuid":"2AD780E1-8B56-4182-A3F4-AD72CD31ED16","type":"v2","index":0,"nodeType":"UV"},{"uuid":"798CF858-F971-40B3-B8C4-B6D71B45D7EA","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"1EC2E432-F5A9-4B22-A674-B443AE09A6B6","project":false,"nodeType":"Texture"},{"uuid":"1EC2E432-F5A9-4B22-A674-B443AE09A6B6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"915E58BC-12F1-4601-AC72-E62D706BD994","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"74DB3B03-4F9D-4B30-9535-59F8619F0C79","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2584E69-1735-4808-9E71-6CAEA70065F2","type":"i","value":0,"nodeType":"Int"},{"uuid":"D92E37C5-3FE7-4227-A0DD-2952A045D7A5","type":"f","value":50,"nodeType":"Float"},{"uuid":"B76EF1AB-23C1-479C-8DBC-F950C9E92F28","type":"f","value":105,"nodeType":"Float"},{"uuid":"38F730E4-813B-4D0C-8F35-5D0F3C80831D","type":"f","value":1,"nodeType":"Float"},{"uuid":"F8687F6E-BF2F-4A93-AC65-C64B43645AFA","type":"f","value":0,"nodeType":"Float"},{"uuid":"3B7D062C-4A4D-4073-A6B0-B94CF96A4243","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"13FB2F86-2FFD-4A52-B087-E44C160C3615","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"A486900B-8F35-40D6-A2A0-83EC3E8BF9A5","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"99B2D205-DF6D-4D4F-BBBC-8277E0FBD9C8","type":"f","value":1,"nodeType":"Float"},{"uuid":"4C961699-FE20-4356-998F-71EA07433238","type":"i","value":1,"nodeType":"Int"},{"uuid":"ED71EE97-951E-42C1-9CE3-01F85AE16294","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"90CB3DA4-2947-4CA5-ACCE-B03753691B3B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"37BEA810-CACE-4C4E-BBBD-81A0B00FD136","type":"f","value":1,"nodeType":"Float"},{"uuid":"752B5A2D-8AB7-4ADE-B323-6329D0B76A1F","type":"f","value":2,"nodeType":"Float"},{"uuid":"C59EB554-308D-46D3-A711-885302AAE981","type":"f","value":1,"nodeType":"Float"},{"uuid":"083EAAD6-ED85-4FA0-938B-CCBCFF66BE9C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9BEBF44-5291-4B71-83A6-CB54DAAFECC8","type":"i","value":2,"nodeType":"Int"},{"uuid":"B875D127-D743-45D2-8D31-F232DBC4ED8E","type":"phong","color":"CFAEB915-D217-4C1C-A893-5C9D3959051D","specular":"7564AE94-182A-4284-B519-6CABE470945D","shininess":"C12A9B9B-DC1F-49E8-81F7-A1B38E2C4A1C","shadingAlpha":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","shadingBlend":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","afterColor":"C5C9D9E8-F4A8-46F1-938B-28B3FDA09F3D","alpha":"9BE7C014-F610-4B48-9558-4116089479E1","nodeType":"Phong"},{"uuid":"CFAEB915-D217-4C1C-A893-5C9D3959051D","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"C5C9D9E8-F4A8-46F1-938B-28B3FDA09F3D","type":"v3","a":"08E6190D-0F7C-45D7-A3B5-2B68B901CF63","b":"ACC5104A-2B7D-4D14-9290-BA57746DFEF9","alpha":"341F6534-BD83-4A13-A1F9-68F6EED89A92","mode":"C9BEBF44-5291-4B71-83A6-CB54DAAFECC8","nodeType":"Blend"},{"uuid":"08E6190D-0F7C-45D7-A3B5-2B68B901CF63","type":"v3","a":"9563CDEE-9C84-4E35-BF75-07DB78AC5ED2","b":"842BFE97-DDA4-489F-8226-A509AEBA80C1","alpha":"DA8C3FBF-3438-409D-A286-1A3390674466","mode":"4C961699-FE20-4356-998F-71EA07433238","nodeType":"Blend"},{"uuid":"9563CDEE-9C84-4E35-BF75-07DB78AC5ED2","type":"v3","a":"8614F3DA-D400-4277-B9A4-FCB0A4507F95","b":"0FD0B886-C026-439F-9A65-80F403905C69","alpha":"D59A9FF6-8472-44DD-A28D-5FDADAF7A0EA","mode":"B2584E69-1735-4808-9E71-6CAEA70065F2","nodeType":"Blend"},{"uuid":"8614F3DA-D400-4277-B9A4-FCB0A4507F95","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0FD0B886-C026-439F-9A65-80F403905C69","type":"v3","thickness":"DA697F1B-2B2B-40D0-83C3-624A7A5FB327","ior":"55F9D5C6-E12B-4511-9934-4BDA6F26BEF3","roughness":"16387422-F8B1-4A2D-83E7-D18DF4A89FDA","alpha":"74DB3B03-4F9D-4B30-9535-59F8619F0C79","calpha":"g0FD0B886C026439F9A6580F403905C69_calpha","nodeType":"Transmission"},{"uuid":"D59A9FF6-8472-44DD-A28D-5FDADAF7A0EA","type":"f","src":"g0FD0B886C026439F9A6580F403905C69_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"842BFE97-DDA4-489F-8226-A509AEBA80C1","type":"v3","near":"D92E37C5-3FE7-4227-A0DD-2952A045D7A5","far":"B76EF1AB-23C1-479C-8DBC-F950C9E92F28","isVector":"38F730E4-813B-4D0C-8F35-5D0F3C80831D","isWorldSpace":"F8687F6E-BF2F-4A93-AC65-C64B43645AFA","origin":"3B7D062C-4A4D-4073-A6B0-B94CF96A4243","colorA":"13FB2F86-2FFD-4A52-B087-E44C160C3615","colorB":"A486900B-8F35-40D6-A2A0-83EC3E8BF9A5","alpha":"99B2D205-DF6D-4D4F-BBBC-8277E0FBD9C8","nodeType":"Depth"},{"uuid":"DA8C3FBF-3438-409D-A286-1A3390674466","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"99B2D205-DF6D-4D4F-BBBC-8277E0FBD9C8"},"nodeType":"Expression"},{"uuid":"ACC5104A-2B7D-4D14-9290-BA57746DFEF9","type":"v3","color":"ED71EE97-951E-42C1-9CE3-01F85AE16294","bias":"90CB3DA4-2947-4CA5-ACCE-B03753691B3B","scale":"37BEA810-CACE-4C4E-BBBD-81A0B00FD136","intensity":"752B5A2D-8AB7-4ADE-B323-6329D0B76A1F","factor":"C59EB554-308D-46D3-A711-885302AAE981","alpha":"083EAAD6-ED85-4FA0-938B-CCBCFF66BE9C","mode":"C9BEBF44-5291-4B71-83A6-CB54DAAFECC8","calpha":"gACC5104A2B7D4D149290BA57746DFEF9_calpha","nodeType":"Fresnel"},{"uuid":"341F6534-BD83-4A13-A1F9-68F6EED89A92","type":"f","src":"gACC5104A2B7D4D149290BA57746DFEF9_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9BE7C014-F610-4B48-9558-4116089479E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1CCDA77-FD0E-4B66-885A-9F756FF6FB24","type":"f","value":1,"nodeType":"Float"},{"uuid":"23C64443-8493-47A5-992C-A7AAD67E0164","type":"i","value":0,"nodeType":"Int"},{"uuid":"FA172033-8848-4913-BA94-631D52CA4227","type":"f","value":30,"nodeType":"Float"},{"uuid":"9D9CDF74-B705-4A8F-A1E8-64EA97A31FAE","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"7205CBFD-E1F3-43A2-A2B2-CC4E3EC9FE73","type":"f","value":10,"nodeType":"Float"},{"uuid":"220FBEAC-C2D9-443E-BDA8-3BCDCE149294","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"6559E7EA-0DA6-4378-9568-F4FC3761253B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"DAB41DAA-21B4-4280-ACC5-DADC525F32F5","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B408B173-271D-4012-95A9-D18BF9D58165","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"B8974B32-7780-456B-977B-73D232039D20","type":"f","value":1,"nodeType":"Float"},{"uuid":"2513FB61-D30B-49A8-B7AF-8D1295FE3CF1","type":"i","value":0,"nodeType":"Int"},{"uuid":"651ABCD0-104B-43A9-A27F-E7884CF03507","type":"f","value":50,"nodeType":"Float"},{"uuid":"AEE14D58-DE2D-4AB0-B10C-1EF09105A789","type":"f","value":145,"nodeType":"Float"},{"uuid":"A172BD28-C2E7-4F40-815A-FD69D93B8BC4","type":"f","value":1,"nodeType":"Float"},{"uuid":"6EED541A-CA9B-423B-991F-0F8DBA9868EB","type":"f","value":0,"nodeType":"Float"},{"uuid":"76A38ADD-AD06-4160-906B-00752AF46C00","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F4FB338F-DCEE-4AE1-9C1E-C1204918EFE5","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"FAED7E38-9F1A-4B8D-88E0-AA91CC15D7FA","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"268FF7F8-31B5-4C9A-A137-05F33A70AB74","type":"f","value":1,"nodeType":"Float"},{"uuid":"8E241CC0-6B9B-4301-8487-4043C1F34DA3","type":"i","value":1,"nodeType":"Int"},{"uuid":"5F56FDCF-8498-422E-8125-CC410A089B6A","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"507E1603-D6EE-4D02-8B1B-A1C774A2C5FF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F4121A42-3FB1-4622-97E4-8F46BFEE696E","type":"f","value":1,"nodeType":"Float"},{"uuid":"199BC4A5-3766-43D0-B0AE-122DAF35AD2A","type":"f","value":2,"nodeType":"Float"},{"uuid":"72A6ED3E-A5EC-4246-8758-FE1B26B8174E","type":"f","value":1,"nodeType":"Float"},{"uuid":"6DF01D63-F84D-44D1-8C3B-8734B6F5A53E","type":"f","value":1,"nodeType":"Float"},{"uuid":"52B27C23-1097-4795-A82D-5062FADB840A","type":"i","value":2,"nodeType":"Int"},{"uuid":"8B9E292D-5248-420E-B10F-9BFAE6FE7E87","type":"f","value":1,"nodeType":"Float"},{"uuid":"377A2866-48D5-4745-A1AE-077241790A96","type":"i","value":0,"nodeType":"Int"},{"uuid":"4153FB44-2C1C-4CC4-86E6-79E32573DDB5","type":"f","value":30,"nodeType":"Float"},{"uuid":"0B048450-A041-4935-B3F4-207CF5429D33","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"F42CA235-6242-4B37-9B64-4D6F22606E49","type":"f","value":10,"nodeType":"Float"},{"uuid":"DBC4C04B-A76B-4FD6-92E5-4D74156453A8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D184E1B4-2E22-460B-8285-2B3EEE0CEE42","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CB9C1019-0583-4BD8-ABDD-0774A82870F8","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D185C264-3FEB-4F03-A1DC-1757643E6966","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"C897F4D5-7A79-460E-9566-59D035716544","type":"f","value":1,"nodeType":"Float"},{"uuid":"111C169D-7DEC-42E6-BA87-D3C6C97754C4","type":"i","value":0,"nodeType":"Int"},{"uuid":"1109B58B-278E-445C-A7C3-E15EA5B2C58D","type":"f","value":50,"nodeType":"Float"},{"uuid":"91A3EE1B-004A-4696-8957-0E09FFD9B860","type":"f","value":145,"nodeType":"Float"},{"uuid":"435FA2CB-DFB7-4044-92F8-D4C6CBB17D64","type":"f","value":1,"nodeType":"Float"},{"uuid":"B24203FB-344E-4B85-B59A-0B25F78E6CDC","type":"f","value":0,"nodeType":"Float"},{"uuid":"EE68398E-95EF-4C99-BE4E-3248F4451A2B","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"65C972D0-7B53-4D46-89B6-BD93654F8A67","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"233655E6-5C8F-402F-AFED-101E57AA561A","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"A6C729D7-587F-4661-A466-BFA4AAC47D90","type":"f","value":1,"nodeType":"Float"},{"uuid":"5388591D-A7EF-425E-B001-CCDB65039F37","type":"i","value":1,"nodeType":"Int"},{"uuid":"33A01DF6-FB67-4A3C-B36A-F9B388BABCCB","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"8099F9B8-5E8D-48DC-976D-55E86D436082","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5CB27644-E75E-49B5-A70C-89E55D3EAC7E","type":"f","value":1,"nodeType":"Float"},{"uuid":"F05AFDE3-E02F-486D-AC8D-FD38021B00D4","type":"f","value":2,"nodeType":"Float"},{"uuid":"214602FC-A933-48FD-90E7-FEC92FA22E23","type":"f","value":1,"nodeType":"Float"},{"uuid":"C4AD9E08-8E32-416C-A2FF-60F506AA2F9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"E947949B-8CAE-4747-895D-635812007C16","type":"i","value":2,"nodeType":"Int"},{"uuid":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","type":"f","value":1,"nodeType":"Float"},{"uuid":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","type":"i","value":0,"nodeType":"Int"},{"uuid":"68962F85-4880-4941-8383-FB2574B11EDE","type":"f","value":30,"nodeType":"Float"},{"uuid":"E172D68A-CD2E-4D32-A04C-0FE8F938FFA6","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"258DD7DD-778F-44C7-94C2-D6308952C6B2","type":"f","value":10,"nodeType":"Float"},{"uuid":"038C2F80-4739-4696-895F-B193D4E5ABEF","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2422736E-2985-4214-9038-BE1243ABB7A7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F5C447CE-06A4-456A-8A92-A381D795B700","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"BE06C6DE-C172-48BF-8AE6-AA24C443B479","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"3F0CCC42-9F1B-45EB-A734-D49D1A472FFB","project":false,"nodeType":"Texture"},{"uuid":"3F0CCC42-9F1B-45EB-A734-D49D1A472FFB","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4D401140-7197-4D03-8275-30E27BE7125C","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"55683795-E3B0-42BB-9EC2-45212C610E0C","project":false,"nodeType":"Texture"},{"uuid":"55683795-E3B0-42BB-9EC2-45212C610E0C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"FECF21D2-D260-4BB7-8607-DC86BB7B83EF","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"68821B5D-EBBD-4A47-BA50-BD27D77C0A0B","type":"f","value":1,"nodeType":"Float"},{"uuid":"238FA743-EEC2-4B47-A9DA-0A7182D542F7","type":"i","value":0,"nodeType":"Int"},{"uuid":"F7DF3873-252B-4F42-AACD-1884AD4D8810","type":"f","value":50,"nodeType":"Float"},{"uuid":"0C88E392-D4D3-4968-AC7A-BB8CA8B17B30","type":"f","value":145,"nodeType":"Float"},{"uuid":"F41F8A46-E6FB-4785-BC29-CC1DDFDD9768","type":"f","value":1,"nodeType":"Float"},{"uuid":"37205E69-AC9D-40D7-AB54-33E8348A0325","type":"f","value":0,"nodeType":"Float"},{"uuid":"93A19D04-1790-482A-B731-89B23621E803","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"BBB83CEF-4F72-4ECB-AC89-98B287BFA7BD","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"6DEAC539-59BF-4B28-86B7-FAF212DF1C53","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"9CFF996F-D409-44D6-8BF3-AB7F879EA1ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"4DB03EB5-EED9-44AF-B14D-B2A30F4AB80B","type":"i","value":1,"nodeType":"Int"},{"uuid":"988DF265-A756-48F1-9911-2238648AB2FB","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"24B011D1-B833-44F6-AA82-295201C17D25","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1662CD7C-26AF-4ACA-A2BB-51077E284DF2","type":"f","value":1,"nodeType":"Float"},{"uuid":"CBD02E93-1278-4768-96E1-9D7036BE8003","type":"f","value":2,"nodeType":"Float"},{"uuid":"8E05CAB4-B3A4-41ED-BD29-B386BD4FCBB4","type":"f","value":1,"nodeType":"Float"},{"uuid":"B1810AEB-86CD-419C-A86F-3DE358D0C453","type":"f","value":1,"nodeType":"Float"},{"uuid":"9A2E4CFD-DEC6-4FC1-9877-BEB07DAF12CF","type":"i","value":2,"nodeType":"Int"},{"uuid":"045370D6-0EE1-4BAD-87D3-B9DF86841131","type":"phong","color":"C081C79D-AD7E-4F63-B11D-CD26F1A9A9BD","specular":"E172D68A-CD2E-4D32-A04C-0FE8F938FFA6","shininess":"68962F85-4880-4941-8383-FB2574B11EDE","shadingAlpha":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","shadingBlend":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","afterColor":"7309CED1-2F4A-4062-8082-3EF3C909BA75","alpha":"F082178D-D77F-46C6-B057-92B3AF0A6922","nodeType":"Phong"},{"uuid":"C081C79D-AD7E-4F63-B11D-CD26F1A9A9BD","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"7309CED1-2F4A-4062-8082-3EF3C909BA75","type":"v3","a":"43AF57AC-ADCB-4DCA-95F5-03CC44F338A4","b":"2F3556E8-3509-49BC-902B-69DCCFCABB07","alpha":"541D5871-10DB-44FE-B2C7-7936D62B5023","mode":"9A2E4CFD-DEC6-4FC1-9877-BEB07DAF12CF","nodeType":"Blend"},{"uuid":"43AF57AC-ADCB-4DCA-95F5-03CC44F338A4","type":"v3","a":"5109AF5C-5794-42BB-B5B0-18BC6B5FABB1","b":"A294BBDC-64EC-44DD-BD57-27A0549317D7","alpha":"8C35966E-41B6-4645-AFC2-43139157409E","mode":"4DB03EB5-EED9-44AF-B14D-B2A30F4AB80B","nodeType":"Blend"},{"uuid":"5109AF5C-5794-42BB-B5B0-18BC6B5FABB1","type":"v3","a":"31EAE7A2-57A5-432D-A203-9B3EB0E31CCB","b":"C38B86CE-7392-47A3-A55E-0FEC25AAA05D","alpha":"E52A85C2-8035-4D5F-BDEE-C7A21DD97B73","mode":"238FA743-EEC2-4B47-A9DA-0A7182D542F7","nodeType":"Blend"},{"uuid":"31EAE7A2-57A5-432D-A203-9B3EB0E31CCB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C38B86CE-7392-47A3-A55E-0FEC25AAA05D","type":"v3","thickness":"258DD7DD-778F-44C7-94C2-D6308952C6B2","ior":"038C2F80-4739-4696-895F-B193D4E5ABEF","roughness":"2422736E-2985-4214-9038-BE1243ABB7A7","alpha":"68821B5D-EBBD-4A47-BA50-BD27D77C0A0B","calpha":"gC38B86CE739247A3A55E0FEC25AAA05D_calpha","nodeType":"Transmission"},{"uuid":"E52A85C2-8035-4D5F-BDEE-C7A21DD97B73","type":"f","src":"gC38B86CE739247A3A55E0FEC25AAA05D_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A294BBDC-64EC-44DD-BD57-27A0549317D7","type":"v3","near":"F7DF3873-252B-4F42-AACD-1884AD4D8810","far":"0C88E392-D4D3-4968-AC7A-BB8CA8B17B30","isVector":"F41F8A46-E6FB-4785-BC29-CC1DDFDD9768","isWorldSpace":"37205E69-AC9D-40D7-AB54-33E8348A0325","origin":"93A19D04-1790-482A-B731-89B23621E803","colorA":"BBB83CEF-4F72-4ECB-AC89-98B287BFA7BD","colorB":"6DEAC539-59BF-4B28-86B7-FAF212DF1C53","alpha":"9CFF996F-D409-44D6-8BF3-AB7F879EA1ED","nodeType":"Depth"},{"uuid":"8C35966E-41B6-4645-AFC2-43139157409E","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"9CFF996F-D409-44D6-8BF3-AB7F879EA1ED"},"nodeType":"Expression"},{"uuid":"2F3556E8-3509-49BC-902B-69DCCFCABB07","type":"v3","color":"988DF265-A756-48F1-9911-2238648AB2FB","bias":"24B011D1-B833-44F6-AA82-295201C17D25","scale":"1662CD7C-26AF-4ACA-A2BB-51077E284DF2","intensity":"CBD02E93-1278-4768-96E1-9D7036BE8003","factor":"8E05CAB4-B3A4-41ED-BD29-B386BD4FCBB4","alpha":"B1810AEB-86CD-419C-A86F-3DE358D0C453","mode":"9A2E4CFD-DEC6-4FC1-9877-BEB07DAF12CF","calpha":"g2F3556E8350949BC902B69DCCFCABB07_calpha","nodeType":"Fresnel"},{"uuid":"541D5871-10DB-44FE-B2C7-7936D62B5023","type":"f","src":"g2F3556E8350949BC902B69DCCFCABB07_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F082178D-D77F-46C6-B057-92B3AF0A6922","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6C31780-9CAD-43D2-8E90-F2759644CAEC","type":"f","value":1,"nodeType":"Float"},{"uuid":"C57203FA-CB51-49F0-80DE-B96A27E6348E","type":"i","value":0,"nodeType":"Int"},{"uuid":"8C29D622-9AEC-4FE1-A0AD-CE332A9682C7","type":"f","value":30,"nodeType":"Float"},{"uuid":"5DD3875A-F8E5-4861-89D3-85DED6F3F754","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"D3F57E60-F327-4040-9D92-CCC23C63761C","type":"f","value":10,"nodeType":"Float"},{"uuid":"9AD6F493-6FE7-4E38-8C2E-6EAD53ED383F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"356CAE88-E9BD-4F42-A675-3419D1685B33","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"47FAD809-979A-4771-9EA8-C6571DF28D29","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"ADE793A8-0AFD-4804-9AC3-86018BA66B40","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"98292E8D-ED3E-47BA-852B-46F44792FB6D","type":"f","value":1,"nodeType":"Float"},{"uuid":"3E41CE06-79C2-4C57-8F95-1FB94BB13F4B","type":"i","value":0,"nodeType":"Int"},{"uuid":"55A264D9-8EE1-4955-BB59-7331812DE8A5","type":"f","value":50,"nodeType":"Float"},{"uuid":"94A7AB5E-5995-4B57-926B-56802B00A7C1","type":"f","value":145,"nodeType":"Float"},{"uuid":"B5DE081B-F35A-4CA3-8BBA-BB9DBB7C7B63","type":"f","value":1,"nodeType":"Float"},{"uuid":"5ED5AA51-E3A3-47C0-BBFE-25EF23D6CE3D","type":"f","value":0,"nodeType":"Float"},{"uuid":"D62F9F39-A6D9-4FD7-88F1-DE4A03AB071C","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"2FF1E6CE-6C3C-43E4-837B-DAA88E87068B","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"D8E948CF-DE63-48AB-B4C2-237E8A207790","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"790CACD2-9F54-430D-BD1F-45210B93C8A9","type":"f","value":1,"nodeType":"Float"},{"uuid":"E05A33F8-2B1C-4F44-9DA1-DA12BFC46009","type":"i","value":1,"nodeType":"Int"},{"uuid":"E7D44468-06AE-476E-A495-AA3756F7BCF2","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"6AC78D70-B6A0-4ED9-B3EF-BA30AC6B503F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BC5B5CD1-C6CC-4A8D-8BE5-61DA2B310AC1","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9D972F6-9306-487E-ADE2-D6DFD38B774B","type":"f","value":2,"nodeType":"Float"},{"uuid":"A61A39C7-AE2B-485B-9438-A6F6D75B8D41","type":"f","value":1,"nodeType":"Float"},{"uuid":"4DE8E091-D329-4D39-B03F-0670AC876A9F","type":"f","value":1,"nodeType":"Float"},{"uuid":"52A35D46-B278-4780-B1B8-CF9EEA50B16B","type":"i","value":2,"nodeType":"Int"},{"uuid":"8A1821B0-5D72-42F4-9AF7-29E9966572D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"4605DF9C-2BAB-4DDC-8188-8C2097D54F30","type":"i","value":0,"nodeType":"Int"},{"uuid":"682CF624-452E-4E36-8D37-479470D75B1A","type":"f","value":30,"nodeType":"Float"},{"uuid":"94E37E44-91E5-4296-B896-CBAEDFCB03C8","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"A1992BB6-1D93-41F1-871F-69E318F0561E","type":"f","value":10,"nodeType":"Float"},{"uuid":"FEFE6B82-4813-4B38-A580-1389D7F461DD","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"8403DB96-E6B9-4EB8-9585-CDC583C923BC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"5E8946D6-AE60-453D-AF41-D27C0016D841","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E3EF3FCF-6A5B-4C3B-8970-D6D13CC52374","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"CF5ED6CD-7449-48D0-9E7C-C37089E4F9E5","type":"f","value":1,"nodeType":"Float"},{"uuid":"DCFAC8FB-203B-488E-B6A5-C1CEEF2A6238","type":"i","value":0,"nodeType":"Int"},{"uuid":"118DB27F-BAFD-4F9A-ACFB-5F1336514112","type":"f","value":50,"nodeType":"Float"},{"uuid":"0FBED206-5BE9-4DBA-AABA-9CE99C01C59D","type":"f","value":145,"nodeType":"Float"},{"uuid":"48667350-C677-4F2E-87A3-FDDAE10D9704","type":"f","value":1,"nodeType":"Float"},{"uuid":"91E99B16-D207-4AFB-976D-9126BA0CC680","type":"f","value":0,"nodeType":"Float"},{"uuid":"6C077010-671C-47A3-A7A5-C5600A524AC6","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"1BB5512B-2A19-4B78-A5CB-D9E03D323387","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"162D2AEC-71C3-4DD2-AD15-29C9C43989F9","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"67847503-9755-4B36-BEC9-2AEAC121013C","type":"f","value":1,"nodeType":"Float"},{"uuid":"68AF7F62-6A88-476B-A736-CD3A95BD6C9B","type":"i","value":1,"nodeType":"Int"},{"uuid":"0273C120-01EC-4ABB-AA60-E48EA822E761","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"10516967-11B3-448E-AD8E-4AFE5D4A965E","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"040817A2-4942-47D9-BE17-E38416887A56","type":"f","value":1,"nodeType":"Float"},{"uuid":"A118B483-B738-4B89-A46F-1998A32EC543","type":"f","value":2,"nodeType":"Float"},{"uuid":"FF6D6224-336D-42FD-8B78-D19F08ABACE6","type":"f","value":1,"nodeType":"Float"},{"uuid":"E3E1488B-DCFD-4D63-B621-B067C52C6467","type":"f","value":1,"nodeType":"Float"},{"uuid":"A4405252-F0FA-4A4D-91D9-C797E3B5252B","type":"i","value":2,"nodeType":"Int"},{"uuid":"E580F990-A83F-4809-ADC2-95CE2B455A52","type":"f","value":1,"nodeType":"Float"},{"uuid":"13D6E696-B3BE-439D-81DA-300B0D2A1691","type":"i","value":0,"nodeType":"Int"},{"uuid":"3B22122F-C845-4F80-ABD6-8F99A0268849","type":"f","value":30,"nodeType":"Float"},{"uuid":"FB7425AE-AEF2-48B0-A6FC-2C2DD4E36B77","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"493B68FF-BE19-4357-B422-A6B2A90F2331","type":"f","value":10,"nodeType":"Float"},{"uuid":"000BDA03-4988-4416-83CC-7354CA7BB7A7","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"205A0BE3-7101-4BFD-B5A5-E8A516642853","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F16EFB8F-379A-45C7-ABAF-C1FE8838AA7D","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"3D2C6A9C-F4D6-429B-B933-069A00CFEC81","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"83338ED9-76DE-4A63-9B0B-04579D52227B","project":false,"nodeType":"Texture"},{"uuid":"83338ED9-76DE-4A63-9B0B-04579D52227B","type":"v2","index":0,"nodeType":"UV"},{"uuid":"63B1119E-7B55-4258-8029-9926E3ED488C","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"D117D843-704C-45F7-854D-7E161B0838EF","project":false,"nodeType":"Texture"},{"uuid":"D117D843-704C-45F7-854D-7E161B0838EF","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A3BDDF28-9A0D-400A-B9BC-B13ED7B154D8","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"AFC6F1BE-C41B-4484-B723-79A1EFA7E1D2","type":"f","value":1,"nodeType":"Float"},{"uuid":"4B6C8F76-A06D-4206-AFE7-0B9F4C6070BF","type":"i","value":0,"nodeType":"Int"},{"uuid":"403B102E-FE88-4DD2-AF6F-4B640D3C38B1","type":"f","value":50,"nodeType":"Float"},{"uuid":"83365D97-E697-40D5-9D59-CB8D48C5E7FC","type":"f","value":145,"nodeType":"Float"},{"uuid":"C0BD4391-B358-4A34-A907-BB310A8A9F00","type":"f","value":1,"nodeType":"Float"},{"uuid":"316F08A8-0F87-442F-BB91-9F5AC9830091","type":"f","value":0,"nodeType":"Float"},{"uuid":"365414D0-D8E1-42AD-81E9-34BD032A4E11","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AFB62CF4-053E-46E7-9761-A8FF36500D03","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"F1696F04-312F-499E-8E26-AAFD79CE245F","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"DAC254CF-F53B-426B-B763-E73F9F8A791B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C482E346-0276-4B5C-ABD7-86EC2BF95925","type":"i","value":1,"nodeType":"Int"},{"uuid":"F15C1C37-B7A2-47C2-8783-C8562C2E4782","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"A9A33D00-80B7-4742-8857-9CE671CC839D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4CA763DD-EDDE-4736-A520-6DF849B068EB","type":"f","value":1,"nodeType":"Float"},{"uuid":"6E3F8AA4-79DF-40F2-BD00-C028AAEF330F","type":"f","value":2,"nodeType":"Float"},{"uuid":"DEFCB748-5C7B-48E9-8B8E-61A44B86FE68","type":"f","value":1,"nodeType":"Float"},{"uuid":"76F72977-4BBE-4C3A-B7C5-98966B37F11A","type":"f","value":1,"nodeType":"Float"},{"uuid":"9818D4C0-8142-4D9B-B007-A5A31E8A3A37","type":"i","value":2,"nodeType":"Int"},{"uuid":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33","type":"phong","color":"9DFA81F5-17F3-4962-B6FE-52ACA5E9D91C","specular":"FB7425AE-AEF2-48B0-A6FC-2C2DD4E36B77","shininess":"3B22122F-C845-4F80-ABD6-8F99A0268849","shadingAlpha":"E580F990-A83F-4809-ADC2-95CE2B455A52","shadingBlend":"13D6E696-B3BE-439D-81DA-300B0D2A1691","afterColor":"905BB683-0569-4438-8A83-3F1EAC576CF0","alpha":"F2827247-1BDB-408F-8ADD-A56DD2A7C50B","nodeType":"Phong"},{"uuid":"9DFA81F5-17F3-4962-B6FE-52ACA5E9D91C","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"905BB683-0569-4438-8A83-3F1EAC576CF0","type":"v3","a":"FD4D4C0E-D843-4970-9B38-877377907838","b":"A21EE2C5-1D9C-42FD-9A4F-28B5CC475FAE","alpha":"7C1DDFA5-0582-4309-ACFD-B53A2E4B37A4","mode":"9818D4C0-8142-4D9B-B007-A5A31E8A3A37","nodeType":"Blend"},{"uuid":"FD4D4C0E-D843-4970-9B38-877377907838","type":"v3","a":"EF5422BE-BBCE-46DC-BF11-AD6258C27E92","b":"C9A6AA35-0264-4A84-A2A2-7DC022875CD5","alpha":"94D3B803-73C9-4A9C-BC3C-D8E19A5D91B0","mode":"C482E346-0276-4B5C-ABD7-86EC2BF95925","nodeType":"Blend"},{"uuid":"EF5422BE-BBCE-46DC-BF11-AD6258C27E92","type":"v3","a":"7D2FCAFA-66B2-4836-B206-7DF5FD2DA03C","b":"7DAFB1CC-21CF-4B8E-A738-2F563E5C55C7","alpha":"E61F2762-BDD8-43FA-B95B-A5645131CC37","mode":"4B6C8F76-A06D-4206-AFE7-0B9F4C6070BF","nodeType":"Blend"},{"uuid":"7D2FCAFA-66B2-4836-B206-7DF5FD2DA03C","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7DAFB1CC-21CF-4B8E-A738-2F563E5C55C7","type":"v3","thickness":"493B68FF-BE19-4357-B422-A6B2A90F2331","ior":"000BDA03-4988-4416-83CC-7354CA7BB7A7","roughness":"205A0BE3-7101-4BFD-B5A5-E8A516642853","alpha":"AFC6F1BE-C41B-4484-B723-79A1EFA7E1D2","calpha":"g7DAFB1CC21CF4B8EA7382F563E5C55C7_calpha","nodeType":"Transmission"},{"uuid":"E61F2762-BDD8-43FA-B95B-A5645131CC37","type":"f","src":"g7DAFB1CC21CF4B8EA7382F563E5C55C7_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C9A6AA35-0264-4A84-A2A2-7DC022875CD5","type":"v3","near":"403B102E-FE88-4DD2-AF6F-4B640D3C38B1","far":"83365D97-E697-40D5-9D59-CB8D48C5E7FC","isVector":"C0BD4391-B358-4A34-A907-BB310A8A9F00","isWorldSpace":"316F08A8-0F87-442F-BB91-9F5AC9830091","origin":"365414D0-D8E1-42AD-81E9-34BD032A4E11","colorA":"AFB62CF4-053E-46E7-9761-A8FF36500D03","colorB":"F1696F04-312F-499E-8E26-AAFD79CE245F","alpha":"DAC254CF-F53B-426B-B763-E73F9F8A791B","nodeType":"Depth"},{"uuid":"94D3B803-73C9-4A9C-BC3C-D8E19A5D91B0","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"DAC254CF-F53B-426B-B763-E73F9F8A791B"},"nodeType":"Expression"},{"uuid":"A21EE2C5-1D9C-42FD-9A4F-28B5CC475FAE","type":"v3","color":"F15C1C37-B7A2-47C2-8783-C8562C2E4782","bias":"A9A33D00-80B7-4742-8857-9CE671CC839D","scale":"4CA763DD-EDDE-4736-A520-6DF849B068EB","intensity":"6E3F8AA4-79DF-40F2-BD00-C028AAEF330F","factor":"DEFCB748-5C7B-48E9-8B8E-61A44B86FE68","alpha":"76F72977-4BBE-4C3A-B7C5-98966B37F11A","mode":"9818D4C0-8142-4D9B-B007-A5A31E8A3A37","calpha":"gA21EE2C51D9C42FD9A4F28B5CC475FAE_calpha","nodeType":"Fresnel"},{"uuid":"7C1DDFA5-0582-4309-ACFD-B53A2E4B37A4","type":"f","src":"gA21EE2C51D9C42FD9A4F28B5CC475FAE_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F2827247-1BDB-408F-8ADD-A56DD2A7C50B","type":"f","value":1,"nodeType":"Float"},{"uuid":"418CD8D1-12DC-4F52-90A4-AC8B5DAF4D77","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"C706D798-59E9-4E43-9C0A-2CB545828FD4","nodeType":"Color"},{"uuid":"C706D798-59E9-4E43-9C0A-2CB545828FD4","type":"f","value":1,"nodeType":"Float"},{"uuid":"6985C7D4-D0DF-4EE8-9C45-86D22C4F70AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"769D3AC5-71E6-4150-88CE-CF914968A2E4","type":"i","value":0,"nodeType":"Int"},{"uuid":"86FDC4B6-0316-4153-8638-FE86CD1A1BB2","type":"f","value":1,"nodeType":"Float"},{"uuid":"85F18CF7-4CEF-40E3-BCD7-D78A0D617BEE","type":"i","value":0,"nodeType":"Int"},{"uuid":"CBD1EC82-9C4E-4D22-A2A5-3331DCEB50FD","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"1DEA40C3-36F6-4B25-81FA-A986895EFCE6","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"C29F3F81-10AB-4EEF-9D2C-910C236A6046","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"7E147E75-C2C5-4CD2-9BD1-3F2A2983516C","type":"f","value":1,"nodeType":"Float"},{"uuid":"2F7EA951-2B13-4AAB-A9AD-862EF1286AFC","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"DC4474BC-50BB-40E8-A772-0D4051F4AE80","type":"f","value":1,"nodeType":"Float"},{"uuid":"02F42DC1-F60D-43BA-9503-3890853D0EE9","type":"f","value":1,"nodeType":"Float"},{"uuid":"0418AF7B-E500-42E1-A196-1CABC7B00A29","type":"i","value":0,"nodeType":"Int"},{"uuid":"D5DEF03C-A47B-4B30-89C5-6F894B450D1C","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"C5DE36F6-302D-4B72-8F6A-DEEC56E53235","nodeType":"Color"},{"uuid":"C5DE36F6-302D-4B72-8F6A-DEEC56E53235","type":"f","value":1,"nodeType":"Float"},{"uuid":"58D640F5-B953-4B1C-BEAE-73D65A914A67","type":"f","value":1,"nodeType":"Float"},{"uuid":"7E8B150E-A5D8-4D3A-AD94-AB629BA31795","type":"i","value":0,"nodeType":"Int"},{"uuid":"4A551C52-EED5-4630-B3D3-3BF819CC3BC5","type":"f","value":1,"nodeType":"Float"},{"uuid":"AB5301EB-553A-4704-9011-9047D794CC28","type":"i","value":0,"nodeType":"Int"},{"uuid":"65B930DC-CAAB-4E11-AF55-A81AE8CE447F","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"678FD6D1-BDAB-4C70-8D7B-774719A975BA","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"56EAA0D6-2348-4E7D-94E8-6DE1511C61B5","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"8E2B9193-0C66-4C20-BA98-128F82D2FF45","type":"f","value":1,"nodeType":"Float"},{"uuid":"D5751220-A6BE-4736-BBC1-22CB3506E3E6","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"F962D150-9AD7-4F7B-A16B-A8DABB2B117C","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA7C03FB-527E-49AE-B109-25CDB107BFBA","type":"f","value":1,"nodeType":"Float"},{"uuid":"A7AD7FA4-32DE-4307-ABAC-A9F51A6AC1FF","type":"i","value":0,"nodeType":"Int"},{"uuid":"19E81683-ADA0-4CE6-B3F0-F77F89EC04DC","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"0336C7A1-8798-483E-AB21-640A3EB385AB","nodeType":"Color"},{"uuid":"0336C7A1-8798-483E-AB21-640A3EB385AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"B586CE2C-6A79-46C0-A6C4-D9DF36CFCD84","type":"i","value":0,"nodeType":"Int"},{"uuid":"47A667B6-3112-4F80-B074-6F6EFCB63890","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC076918-B60F-4553-8878-094F3551E286","type":"i","value":0,"nodeType":"Int"},{"uuid":"1F56B03A-5815-4520-A667-AEE98D6E438E","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"7AA95DDA-AE80-4603-8179-3B381EA98DB4","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"2278109D-D85C-4E45-B611-B823323FD9FF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C00D5F3C-6371-4971-A64B-68BED974EEA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F12433B-EE51-426E-A4FD-93E7F0E618F1","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"98AD57DA-D0A6-4E43-A7AD-FF0A2BCD3CDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"9B4CC098-62B4-4475-BE00-CB929C21F929","type":"f","value":1,"nodeType":"Float"},{"uuid":"B1CC6FE2-8790-428F-992D-F9E0E9337D9A","type":"i","value":0,"nodeType":"Int"},{"uuid":"33D0580D-FC1F-4D45-BE83-90B7C2C19313","type":"lambert","color":"19E81683-ADA0-4CE6-B3F0-F77F89EC04DC","emissiveIntensity":"E213CF5A-2AD9-457E-89F9-50E185DE9FDC","shadingAlpha":"47A667B6-3112-4F80-B074-6F6EFCB63890","shadingBlend":"CC076918-B60F-4553-8878-094F3551E286","afterColor":"B04C8DE4-BCF9-456D-B1ED-3E4A07A33EA3","alpha":"DA6405F0-5BD6-4534-A94D-B910D2A57ACD","emissive":"1F56B03A-5815-4520-A667-AEE98D6E438E","nodeType":"Lambert"},{"uuid":"E213CF5A-2AD9-457E-89F9-50E185DE9FDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"B04C8DE4-BCF9-456D-B1ED-3E4A07A33EA3","type":"v3","a":"20E2948D-372E-41C7-9BA5-61E7F632205B","b":"CB5E221F-B442-47DF-8544-75A2BFEB32A2","alpha":"978561CC-26DF-49FD-8842-9315DC542386","mode":"B1CC6FE2-8790-428F-992D-F9E0E9337D9A","nodeType":"Blend"},{"uuid":"20E2948D-372E-41C7-9BA5-61E7F632205B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CB5E221F-B442-47DF-8544-75A2BFEB32A2","type":"v3","color":"7AA95DDA-AE80-4603-8179-3B381EA98DB4","bias":"2278109D-D85C-4E45-B611-B823323FD9FF","scale":"C00D5F3C-6371-4971-A64B-68BED974EEA2","intensity":"4F12433B-EE51-426E-A4FD-93E7F0E618F1","factor":"98AD57DA-D0A6-4E43-A7AD-FF0A2BCD3CDC","alpha":"9B4CC098-62B4-4475-BE00-CB929C21F929","mode":"B1CC6FE2-8790-428F-992D-F9E0E9337D9A","calpha":"gCB5E221FB44247DF854475A2BFEB32A2_calpha","nodeType":"Fresnel"},{"uuid":"978561CC-26DF-49FD-8842-9315DC542386","type":"f","src":"gCB5E221FB44247DF854475A2BFEB32A2_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DA6405F0-5BD6-4534-A94D-B910D2A57ACD","type":"f","value":1,"nodeType":"Float"},{"uuid":"D0E478AD-4EB9-4FE4-8FBE-466EEFC8E3F2","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"16780097-BD8B-43BA-8846-48496BFCD7C5","nodeType":"Color"},{"uuid":"16780097-BD8B-43BA-8846-48496BFCD7C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"FBDEC2F2-9901-4BFB-AF92-0A519CB676E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"44BB4B17-9EA6-43BC-B735-0357EF19C01C","type":"i","value":0,"nodeType":"Int"},{"uuid":"11347943-E66A-462C-8DB5-D1A8F781B27F","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E3AA4D0-85C3-4C6C-9542-DDB7715D3B63","type":"i","value":0,"nodeType":"Int"},{"uuid":"6349F466-7AE8-4338-96B2-2C25C6AF0629","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"46BF8DAF-8428-41C4-86D1-60E8F7DB65D0","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"A3982B6A-1CCF-4D34-A97B-48ABAFF5C648","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9D887CAD-2456-4EF7-9E36-3F153A4C9AFF","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB2C5987-7F2F-40B8-AA65-05AA339F0A8B","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"7CB3849F-CE7E-4773-902E-1C84170F097B","type":"f","value":1,"nodeType":"Float"},{"uuid":"77D9B344-C4B9-42DD-911F-6A31113F8464","type":"f","value":1,"nodeType":"Float"},{"uuid":"6F3A3262-7651-40BD-AF00-D68822DEAB24","type":"i","value":0,"nodeType":"Int"},{"uuid":"7A744E0F-D2A4-4A45-8EFC-3B6D3678B333","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"19B5EED3-EB8C-4696-B3A4-3D1CF44EC8F0","nodeType":"Color"},{"uuid":"19B5EED3-EB8C-4696-B3A4-3D1CF44EC8F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6C99907-5FD1-4158-ACBD-F6A956E0FEDA","type":"f","value":1,"nodeType":"Float"},{"uuid":"9844533F-C7EF-4306-82AC-7258B9136A83","type":"i","value":0,"nodeType":"Int"},{"uuid":"35411740-DA3F-482E-B7E1-22F2137056D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"FAAD93D9-6B0F-43B9-8EEA-5627F7B4B0E2","type":"i","value":0,"nodeType":"Int"},{"uuid":"18A36149-6A71-4B1E-A453-D0C5E6A072A8","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"E2DA941C-C197-4254-B6E2-0588A393DF7A","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"54E75758-E01D-43D2-90A9-10021E11FC5F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"27B4E049-74DD-4DAC-92C3-3B0C1FA0ADB0","type":"f","value":1,"nodeType":"Float"},{"uuid":"371A7FA7-346E-4F0D-B9EC-97D7F03B1422","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"D9035E19-55FD-4491-AEE4-7BFF37EC3175","type":"f","value":1,"nodeType":"Float"},{"uuid":"AB9446DC-C2E0-47C8-A51A-12666059C91E","type":"f","value":1,"nodeType":"Float"},{"uuid":"CAFFAF9D-65A3-4631-93BD-C705F80F95C8","type":"i","value":0,"nodeType":"Int"},{"uuid":"BBD51A6C-764B-49C9-9344-F7CFBC4DD1D8","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"A1D17FC6-7EA5-45A1-AC40-4331020FE411","nodeType":"Color"},{"uuid":"A1D17FC6-7EA5-45A1-AC40-4331020FE411","type":"f","value":1,"nodeType":"Float"},{"uuid":"06C6E7CB-0A65-4262-9E31-6D465F5C7614","type":"i","value":0,"nodeType":"Int"},{"uuid":"9D143032-73FD-45A5-87C5-1C14F52F3B4B","type":"f","value":1,"nodeType":"Float"},{"uuid":"1194D657-C918-4B79-BAB0-7533D81325A6","type":"i","value":0,"nodeType":"Int"},{"uuid":"F32F0548-9936-41D3-866F-98188693CA08","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"60D80220-1465-40A2-9CFB-1A4C4DA400C9","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"AE58C1D2-1152-4DDD-BCC8-DAA0B0B65B25","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5A9FE228-C9C2-4369-9BDD-C4EFEE71D971","type":"f","value":1,"nodeType":"Float"},{"uuid":"A6A8F9CD-E70E-48C8-8CC2-594341AD642A","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"A79ACC3A-40A6-4830-AE53-40BD8167D54D","type":"f","value":1,"nodeType":"Float"},{"uuid":"7CB3BE4E-11FE-460B-A116-847552120857","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE7379F5-7283-461B-8A33-530B627548A1","type":"i","value":0,"nodeType":"Int"},{"uuid":"C2AF7613-B84C-4B12-8AB7-42C413B4BDDC","type":"lambert","color":"BBD51A6C-764B-49C9-9344-F7CFBC4DD1D8","emissiveIntensity":"EC0EBE80-5211-4717-B902-E1CAECF452AB","shadingAlpha":"9D143032-73FD-45A5-87C5-1C14F52F3B4B","shadingBlend":"1194D657-C918-4B79-BAB0-7533D81325A6","afterColor":"7F9E1165-45D1-4D8B-8711-DA6DB9F4E1BB","alpha":"72DF9F40-B166-430D-9469-B3A75BB01884","emissive":"F32F0548-9936-41D3-866F-98188693CA08","nodeType":"Lambert"},{"uuid":"EC0EBE80-5211-4717-B902-E1CAECF452AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"7F9E1165-45D1-4D8B-8711-DA6DB9F4E1BB","type":"v3","a":"1884C2FE-F5DB-4ECE-AFFE-0B68D73B364D","b":"93C7EC63-737C-4BF8-AEB8-D2CCDF9954C4","alpha":"BDB03256-3AFA-448F-AAE1-AE6C5C1401CD","mode":"AE7379F5-7283-461B-8A33-530B627548A1","nodeType":"Blend"},{"uuid":"1884C2FE-F5DB-4ECE-AFFE-0B68D73B364D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"93C7EC63-737C-4BF8-AEB8-D2CCDF9954C4","type":"v3","color":"60D80220-1465-40A2-9CFB-1A4C4DA400C9","bias":"AE58C1D2-1152-4DDD-BCC8-DAA0B0B65B25","scale":"5A9FE228-C9C2-4369-9BDD-C4EFEE71D971","intensity":"A6A8F9CD-E70E-48C8-8CC2-594341AD642A","factor":"A79ACC3A-40A6-4830-AE53-40BD8167D54D","alpha":"7CB3BE4E-11FE-460B-A116-847552120857","mode":"AE7379F5-7283-461B-8A33-530B627548A1","calpha":"g93C7EC63737C4BF8AEB8D2CCDF9954C4_calpha","nodeType":"Fresnel"},{"uuid":"BDB03256-3AFA-448F-AAE1-AE6C5C1401CD","type":"f","src":"g93C7EC63737C4BF8AEB8D2CCDF9954C4_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"72DF9F40-B166-430D-9469-B3A75BB01884","type":"f","value":1,"nodeType":"Float"},{"uuid":"FEB323BD-029A-4451-A382-ADDE3E4B4710","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"8A84B68B-3777-4300-985C-3FC7723EE2FE","nodeType":"Color"},{"uuid":"8A84B68B-3777-4300-985C-3FC7723EE2FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"91EBEEF0-905A-4B46-900A-55FE870FEA7B","type":"f","value":1,"nodeType":"Float"},{"uuid":"949071CF-98B8-44F8-ACB0-87216B6FBE6C","type":"i","value":0,"nodeType":"Int"},{"uuid":"8D4C830B-6859-4ED3-B6FB-514389568ED5","type":"f","value":1,"nodeType":"Float"},{"uuid":"DFEB3779-0DA2-40AA-A8E0-D8A7F111B6F4","type":"i","value":0,"nodeType":"Int"},{"uuid":"A6EB1A80-2533-40E7-A834-DA731F2C4984","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"2600EEE4-AA45-42B5-918E-1D792ED8A3DB","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"0D6F6924-5B8B-4B52-A6D9-C1C56B9D1522","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4DBD6E41-C4EA-4401-B474-275AFB788426","type":"f","value":1,"nodeType":"Float"},{"uuid":"77905147-F11E-4A19-A7ED-A5EDA1C079A4","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"D6F48722-36BD-481D-80EA-AF3FC4439FC0","type":"f","value":1,"nodeType":"Float"},{"uuid":"C4FCED98-60EF-43B3-8682-924881411E3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"2D844965-C892-4F3A-8C9D-CCB93CF1CC1D","type":"i","value":0,"nodeType":"Int"},{"uuid":"BD0900C4-6A00-492E-84CC-E7A886DC87C5","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"E6DE551E-84DC-4D99-BC05-A039A9D826F4","nodeType":"Color"},{"uuid":"E6DE551E-84DC-4D99-BC05-A039A9D826F4","type":"f","value":1,"nodeType":"Float"},{"uuid":"0DFFA64A-49CF-4B1A-B799-238B5107B139","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA57A86F-0C47-4CD0-8B21-971A9428F080","type":"i","value":0,"nodeType":"Int"},{"uuid":"16774011-4D56-4AB6-B86A-60FB6D45E3FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"E48AC673-ECA1-437F-BF5A-458CD6BF4F18","type":"i","value":0,"nodeType":"Int"},{"uuid":"F466CDEE-42EC-4DD7-97EB-7EB5E415ED90","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"1E54B72A-CE5A-4BDD-992A-E0FAA77CE173","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"97F661C5-E9C4-46C3-99DE-0C6A6BDE399C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"EC9C8680-E016-426C-A308-33BE453A9DF1","type":"f","value":1,"nodeType":"Float"},{"uuid":"D189EAA6-3A59-48CA-81CC-F12C0E912161","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"4D0B85EA-46D3-4028-B417-3F18F0BEC548","type":"f","value":1,"nodeType":"Float"},{"uuid":"E630E023-3ECD-4FF4-AB34-4CE1244B0A87","type":"f","value":1,"nodeType":"Float"},{"uuid":"C64C9E32-6BD2-450A-B1EE-D24076E3F7F1","type":"i","value":0,"nodeType":"Int"},{"uuid":"4BE51BD1-2492-4EA4-9436-FA3FC3A59D7A","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"068CE446-2E2D-44AB-B2DF-7A34BCA9F841","nodeType":"Color"},{"uuid":"068CE446-2E2D-44AB-B2DF-7A34BCA9F841","type":"f","value":1,"nodeType":"Float"},{"uuid":"37FE9FA1-B22C-4696-A47A-3045B6664088","type":"i","value":0,"nodeType":"Int"},{"uuid":"9C71CE08-CA26-4299-B1FF-E548A29E5080","type":"f","value":1,"nodeType":"Float"},{"uuid":"4B43496D-C9B5-4F09-BB56-2D7963967D41","type":"i","value":0,"nodeType":"Int"},{"uuid":"40AE991A-E0A8-41F8-8DE2-3FA55351EAF7","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"02131CD3-0E68-4B23-960A-D9DBE499290A","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"E814A5A5-AA28-49FA-9D43-6F91D2FE3502","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C8C32F77-0B4A-4470-A7F3-CDB39E606F8C","type":"f","value":1,"nodeType":"Float"},{"uuid":"37604D24-9A80-4FE5-9451-496B62D03CBF","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"2BEE7FC2-7E89-49C2-9A50-094DDF4B2B60","type":"f","value":1,"nodeType":"Float"},{"uuid":"B33534F7-3AE2-4064-8655-B2CE3215E833","type":"f","value":1,"nodeType":"Float"},{"uuid":"2DCD7A6A-6F1A-4161-8B42-1C0E4DF48048","type":"i","value":0,"nodeType":"Int"},{"uuid":"B5D8C262-304D-4672-A5D7-2E82DB09B11D","type":"lambert","color":"4BE51BD1-2492-4EA4-9436-FA3FC3A59D7A","emissiveIntensity":"7D025A2C-AA8A-4A23-BED7-D790078CD1B7","shadingAlpha":"9C71CE08-CA26-4299-B1FF-E548A29E5080","shadingBlend":"4B43496D-C9B5-4F09-BB56-2D7963967D41","afterColor":"625CA53F-12AF-4266-A063-81E926CC739C","alpha":"408D2D8A-790E-49E3-A48B-74FBBEF976C7","emissive":"40AE991A-E0A8-41F8-8DE2-3FA55351EAF7","nodeType":"Lambert"},{"uuid":"7D025A2C-AA8A-4A23-BED7-D790078CD1B7","type":"f","value":1,"nodeType":"Float"},{"uuid":"625CA53F-12AF-4266-A063-81E926CC739C","type":"v3","a":"8140FE36-531E-4CC0-8F88-8DDE9C2160D0","b":"BF060519-D4FF-4ABB-B111-B63AA5FD6D53","alpha":"43D61F48-7552-4521-BF1A-7E5699D01C3B","mode":"2DCD7A6A-6F1A-4161-8B42-1C0E4DF48048","nodeType":"Blend"},{"uuid":"8140FE36-531E-4CC0-8F88-8DDE9C2160D0","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BF060519-D4FF-4ABB-B111-B63AA5FD6D53","type":"v3","color":"02131CD3-0E68-4B23-960A-D9DBE499290A","bias":"E814A5A5-AA28-49FA-9D43-6F91D2FE3502","scale":"C8C32F77-0B4A-4470-A7F3-CDB39E606F8C","intensity":"37604D24-9A80-4FE5-9451-496B62D03CBF","factor":"2BEE7FC2-7E89-49C2-9A50-094DDF4B2B60","alpha":"B33534F7-3AE2-4064-8655-B2CE3215E833","mode":"2DCD7A6A-6F1A-4161-8B42-1C0E4DF48048","calpha":"gBF060519D4FF4ABBB111B63AA5FD6D53_calpha","nodeType":"Fresnel"},{"uuid":"43D61F48-7552-4521-BF1A-7E5699D01C3B","type":"f","src":"gBF060519D4FF4ABBB111B63AA5FD6D53_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"408D2D8A-790E-49E3-A48B-74FBBEF976C7","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9FA023F-FA5E-4FDD-A1E6-86F33C884130","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"1E16B6CC-2FC6-4CE4-A96D-50DDCFF948DE","nodeType":"Color"},{"uuid":"1E16B6CC-2FC6-4CE4-A96D-50DDCFF948DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"024A7D02-2210-46CD-8F58-90E75EE00105","type":"f","value":1,"nodeType":"Float"},{"uuid":"3A7C68FF-37FD-4761-8900-C79B547CBA21","type":"i","value":0,"nodeType":"Int"},{"uuid":"FB9BFFE5-1A52-46C9-A997-28F9C52ECE53","type":"f","value":1,"nodeType":"Float"},{"uuid":"76505991-2A0D-4B57-AAEB-CA73AEA36DF3","type":"i","value":0,"nodeType":"Int"},{"uuid":"8AD467C5-1E59-43B9-AA4B-C789ED5BE0C6","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"A97CF51B-63CE-44EF-8AFC-60D199C943F3","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"B1B2257B-CBBA-4CED-8700-F8B2ECD43329","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"9A339556-D479-4695-A443-3C312725B837","type":"f","value":1,"nodeType":"Float"},{"uuid":"08A7CC82-84EE-4EF7-981A-EC792AC7711B","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"DA971E8F-7C3E-4EAA-B9BA-1E799B137E1E","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6C2780C-B9B5-49CF-B9E4-DEDFB6251CCB","type":"f","value":1,"nodeType":"Float"},{"uuid":"86366B57-50BD-4834-8AAE-EB662DB3E2C5","type":"i","value":0,"nodeType":"Int"},{"uuid":"572DC9A4-722E-4A09-99A1-F101F7EB6CF4","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"A1AD5425-5935-407C-ABA3-60CF0CAE82B5","nodeType":"Color"},{"uuid":"A1AD5425-5935-407C-ABA3-60CF0CAE82B5","type":"f","value":1,"nodeType":"Float"},{"uuid":"534C2253-F7C3-451D-9C1E-3C4006C180DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"34901584-1E6A-4B55-A559-41236B5783C0","type":"i","value":0,"nodeType":"Int"},{"uuid":"57D72748-A897-4B5C-B26E-930D542A0E7B","type":"f","value":1,"nodeType":"Float"},{"uuid":"0F309ACD-DD06-45D9-B299-BFCD0392C415","type":"i","value":0,"nodeType":"Int"},{"uuid":"D2F5FF31-2C2E-4332-9BBB-A28D8B19FA79","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"4B41B651-31B3-47B1-B29B-A279CDE00EAE","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"1B796C5A-04D5-4076-92AA-8905F8E93C8F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1A50CB87-7600-4033-93B4-83BDA71038DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"D81C940B-6AA6-40E4-9282-0F86000D91E2","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"75E2645E-796C-4681-A495-C56D56117E47","type":"f","value":1,"nodeType":"Float"},{"uuid":"14A6E420-B258-453E-A491-F8CC9C1EE5BC","type":"f","value":1,"nodeType":"Float"},{"uuid":"089CBC74-D719-4924-9C32-657E6263DEEB","type":"i","value":0,"nodeType":"Int"},{"uuid":"F790F353-CE0B-4B82-810B-DF313A57022E","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"B2E85646-25BE-49F3-8003-82894F120352","nodeType":"Color"},{"uuid":"B2E85646-25BE-49F3-8003-82894F120352","type":"f","value":1,"nodeType":"Float"},{"uuid":"5B5EE355-FED5-475C-9BE9-6DA780C033BB","type":"i","value":0,"nodeType":"Int"},{"uuid":"B4C8B66A-BFA7-44BA-8E41-F0170725472E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B19944E1-A83F-4A1B-925B-3133B1795FF1","type":"i","value":0,"nodeType":"Int"},{"uuid":"A8EAD0D0-0C20-46E3-B076-694B2FD5A23F","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"50DCA45C-AF4B-4CB4-B321-F8311ABB4B08","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"57FC5112-584D-47B6-9025-9E4C28B56C6E","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B05720FA-8634-4CD7-9C9A-3A23069080F7","type":"f","value":1,"nodeType":"Float"},{"uuid":"99C75718-2027-457F-A784-081455D770C1","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"AD3A4082-0719-42C7-BBD3-79FBCFBE3854","type":"f","value":1,"nodeType":"Float"},{"uuid":"76536314-A607-4093-9639-A94C97B3AB14","type":"f","value":1,"nodeType":"Float"},{"uuid":"BD1D3C87-3F4D-400C-AD42-28FC23B47CE2","type":"i","value":0,"nodeType":"Int"},{"uuid":"2A4AE12D-C9E5-49D9-AE6C-B5E3401DE49A","type":"lambert","color":"F790F353-CE0B-4B82-810B-DF313A57022E","emissiveIntensity":"92EEE367-3CB0-4647-8510-924204203E07","shadingAlpha":"B4C8B66A-BFA7-44BA-8E41-F0170725472E","shadingBlend":"B19944E1-A83F-4A1B-925B-3133B1795FF1","afterColor":"09EA5441-9A06-4373-A10D-D8A272FEF4E8","alpha":"9768CC29-39AF-47A4-8BD4-6BCBC5F3F68C","emissive":"A8EAD0D0-0C20-46E3-B076-694B2FD5A23F","nodeType":"Lambert"},{"uuid":"92EEE367-3CB0-4647-8510-924204203E07","type":"f","value":1,"nodeType":"Float"},{"uuid":"09EA5441-9A06-4373-A10D-D8A272FEF4E8","type":"v3","a":"15EE467A-88C7-4C51-A380-1B3A2782877F","b":"67CD45AA-13CD-4AC2-8093-17885D403065","alpha":"0EF4A0EA-7E2F-4230-92A1-B0734E9E7B64","mode":"BD1D3C87-3F4D-400C-AD42-28FC23B47CE2","nodeType":"Blend"},{"uuid":"15EE467A-88C7-4C51-A380-1B3A2782877F","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"67CD45AA-13CD-4AC2-8093-17885D403065","type":"v3","color":"50DCA45C-AF4B-4CB4-B321-F8311ABB4B08","bias":"57FC5112-584D-47B6-9025-9E4C28B56C6E","scale":"B05720FA-8634-4CD7-9C9A-3A23069080F7","intensity":"99C75718-2027-457F-A784-081455D770C1","factor":"AD3A4082-0719-42C7-BBD3-79FBCFBE3854","alpha":"76536314-A607-4093-9639-A94C97B3AB14","mode":"BD1D3C87-3F4D-400C-AD42-28FC23B47CE2","calpha":"g67CD45AA13CD4AC2809317885D403065_calpha","nodeType":"Fresnel"},{"uuid":"0EF4A0EA-7E2F-4230-92A1-B0734E9E7B64","type":"f","src":"g67CD45AA13CD4AC2809317885D403065_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9768CC29-39AF-47A4-8BD4-6BCBC5F3F68C","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1951,1000],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/mode_dark/index.html b/site/spline/design/mode_dark/index.html deleted file mode 100644 index bd9d99073..000000000 --- a/site/spline/design/mode_dark/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - - diff --git a/site/spline/design/mode_dark/runtime.js b/site/spline/design/mode_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/mode_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1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PDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/mode_dark/scene.json b/site/spline/design/mode_dark/scene.json deleted file mode 100644 index 185a9a511..000000000 --- a/site/spline/design/mode_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"67F8D276-3D18-496C-921F-5DB3B8803A83","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,0.9396926207859073,-0.34202014332566893,0,0,0.34202014332566893,0.9396926207859073,0,34.522355355824786,2.1240479310930604,-19.792513368034697,1],"layers":1,"children":[{"uuid":"18E7565A-CFED-4765-BE1E-54206DF02272","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,0.9999999999999999,-2.220446049250313e-16,0,0,2.220446049250313e-16,0.9999999999999999,0,-54.77215097629973,120.46812647189498,-35.79251336803469,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-37.62507774150423,-2.1240479310929743,19.79251336803467,1],"interaction":{"uuid":"DCAE3C3C-6C08-4978-98C6-0428FEB569AF"},"geometry":"5E325399-FB4E-4A1E-99B9-C24ADB4371BA","material":"76695E13-4AF2-4CA4-9285-331E4B18BB9F"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"F77390CB-258F-4BDB-A31F-39C22D5AD30E","selectedState":0,"states":["C2126691-6153-4287-8203-07B7BE69A8EF","92C76C91-C572-439B-805D-6BE41924A872"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"67F8D276-3D18-496C-921F-5DB3B8803A83","state":"92C76C91-C572-439B-805D-6BE41924A872"}]}]},"enableHelper":true},{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.9388103300153909,-1.3877787807814457e-17,-0.34443455729121136,0,-0.16237037618502853,0.8819134276109325,-0.4425658901644691,0,0.3037614610083463,0.4714113980373582,0.827949436020424,0,-139.40379311840348,471.4113980373588,990.5397092969137,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":999.9999999999995,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.7350918906249999,"nearOrtho":50,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,123.2332767836149,54.059594317155856,-77.05647762613687,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["FDA5FA53-EEA4-4EBB-9AD2-47C50DD19BF9","7603BBA4-0FEC-4C3A-8039-BE7E8AF37981"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"7603BBA4-0FEC-4C3A-8039-BE7E8AF37981"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"1D33948A-8224-40DE-80A5-A8D439996797"},{"uuid":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","objectType":"Mesh3D","name":"Cube copy 10","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-444.36428618166275,-124.22591305881565,186.43581367365115,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"interaction":{"uuid":"4E317D27-3986-451E-AA1F-478CDB6D387F","selectedState":0,"states":["B72A6BC8-8701-4997-B8AD-2EC36F1356EC","69D68840-C232-4B4C-88A0-02688BC6C662"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","state":"69D68840-C232-4B4C-88A0-02688BC6C662"}]}]},"geometry":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","material":"DAC69E6D-8162-46E1-BDB8-32921538BC79"},{"uuid":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","objectType":"Mesh3D","name":"Cube copy 9","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-7.8879806217634325,-12.538128902116185,138.06153221290793,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"interaction":{"uuid":"87E66C6B-1573-4DB3-BEF3-C467BD8FEA0A","selectedState":0,"states":["3B418A74-2EF9-4F23-A5CC-962566D50AB5","100B2EEF-4D8A-422E-9ECF-744E8B7C9725"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","state":"100B2EEF-4D8A-422E-9ECF-744E8B7C9725"}]}]},"geometry":"53F4C327-4868-48DA-8FC8-4FD577D63D34","material":"92B2CFCD-8116-4CE7-8DD8-EA2CAF09F11C"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-39.93883535642771,17.162956902988817,-63.62719986286736,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["FB5D512A-A8F2-423F-B59B-95AEB5936F4A","12E65104-9142-43EF-9ADC-50C614076EA3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"12E65104-9142-43EF-9ADC-50C614076EA3"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"186C536D-6BA5-4402-9E81-FCE02D40E9F5"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,0,6.123233995736766e-14,1000,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"48C98966-C341-457B-A325-6AAF364439CF","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"5E325399-FB4E-4A1E-99B9-C24ADB4371BA","userData":{"parameters":{"width":118,"subdivisions":40,"roundness":20,"extrudeDepth":32,"surfaceMaxCount":1357,"extrudeBevelSize":8,"extrudeBevelSegments":3,"height":118,"depth":32},"shape":{"points":[0,0,0,0,0,0,20,79.78793586229436,-117.24272612867404,79.78793586229436,-22.56272118097305,79.78793586229436,-208.64174080591005,20,0,-238.24998696717296,0,-238.24998696717296,0,-238.24998696717296,20,131.3880929756492,-208.87420293651823,75.16581190658474,-262.397154350599,193.36772782193438,-149.87031832953974,20,131.3880929756492,-28.549748065144385,173.81211915771698,-65.21622783678866,65.7682875663515,28.164512324320064,20],"shapeHoles":[],"isClosed":true,"roundness":20},"type":"VectorGeometry"}},{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53F4C327-4868-48DA-8FC8-4FD577D63D34","userData":{"parameters":{"width":160,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}}],"materials":[{"uuid":"76695E13-4AF2-4CA4-9285-331E4B18BB9F","type":"ShaderMaterial","reflectivity":{"uuid":"6E757205-20D6-4410-B648-620E552BDAB4","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"91678DE9-BB0B-4085-AC70-E41AA243F34E","f0_alpha":"3079D4CC-3CCF-4D1C-A124-42A0EC457A4A","f0_mode":"0C14754C-6E5D-486E-8422-FC002DED04F9"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"34C525EF-5E42-4E08-BCC5-5479FF78E00E","f1_mode":"75B99FCC-9B4E-498C-9387-FA8A75380C3C","f1_roughness":"7113B62F-FA30-438F-B2E7-28393CB39D28","f1_metalness":"21B63E01-7561-4D92-8980-56B741703C05","f1_reflectivity":"6E757205-20D6-4410-B648-620E552BDAB4"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"EF8D8166-5E1E-4ABB-939F-5454440A93CD","fragment":"EF8D8166-5E1E-4ABB-939F-5454440A93CD"},{"uuid":"1D33948A-8224-40DE-80A5-A8D439996797","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2CB6D271-E804-408A-A095-5A6B199C0DEC","f1_mode":"A3F466D5-4BA6-4C1C-8F01-0C2EA6A0B861","f1_shininess":"8DF0A6CE-8CCC-4305-88F9-E41A20320C35","f1_specular":"B791D3F3-826A-4187-9B5F-D1BACB8A5B58"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B52B7238-BCA3-47BE-BF5B-2519F0F94F5F","f2_ior":"2D475BD1-067D-420D-AA18-80E92DD96472","f2_roughness":"F13FF362-3897-448C-A2E1-695F40D8B2F3","f2_transmissionSamplerSize":"C791364F-08C9-4638-A90E-CE63A8AD538F","f2_transmissionSamplerMap":"2171407C-100F-467B-B2D9-DFDE64A7E817","f2_transmissionDepthMap":"269E8DF4-33A7-47CC-B4BA-250218381AC2","f2_aspectRatio":"4CA00501-0997-4ED8-91C4-59B1782778D5","f2_alpha":"2F2960FC-B5D9-4CF2-9D70-F1207749EF6E","f2_mode":"CEDED1FA-0F33-496A-9072-50F8A22E82C3"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"3444D12F-FCE3-4052-B161-35C4AF0B0241","f4_far":"F286E9FC-276A-4FAE-B8DE-A52EFCCFCF7E","f4_isVector":"5F2B01E0-4E97-4939-9C39-8A37BE50FB51","f4_isWorldSpace":"88330AA2-B275-4F2A-9D32-F0E7D5061EA6","f4_origin":"3436755B-7A3D-4640-88ED-C09F07130C5C","f4_colorA":"2E654354-570E-4323-9059-119FE0A7B54C","f4_colorB":"663862E0-483A-4588-9996-C225CA21C548","f4_alpha":"812EFC2D-BB3B-49B8-BD70-F8ABE6BA8560","f4_mode":"00409CCB-CFA6-4FC3-B510-2B7288973075"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A2184CB3-82EF-45BE-BEDF-7292CF9C1B44","f3_bias":"797DBF6A-E58E-425D-A151-33C666422CA8","f3_scale":"BD2DE2B0-C29B-4EF9-9717-9BC58E2F3FFB","f3_intensity":"5284FF17-A89D-4038-A12E-767ED1ACF32F","f3_factor":"3AEDFBCC-32A1-4B7A-B27E-2EAF64FC05E7","f3_alpha":"8CE74A8E-9620-4022-BF4E-B4CC79177153","f3_mode":"18366593-921A-4B89-8608-8779FB2C158E"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"0F59CE8D-F19B-4BDF-8D43-0FD5CA68316F","fragment":"0F59CE8D-F19B-4BDF-8D43-0FD5CA68316F"},{"uuid":"DAC69E6D-8162-46E1-BDB8-32921538BC79","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9FEE4170-F1A7-4526-8350-A577F5EE762B","f1_mode":"D8BB62B0-C077-407B-B398-9691FE474915","f1_shininess":"EA879A0E-35FC-405C-AE99-06E58D8268FE","f1_specular":"E0ACEC6B-0A1D-4710-B5FE-F64161AE4D60"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"38D6E03D-DC5F-47B3-9D20-9BEDA5934F11","f2_ior":"754B0446-67FE-4F64-9541-E8E9A3C59D5C","f2_roughness":"1199C73D-55A0-454B-BEA2-174966052DB1","f2_transmissionSamplerSize":"A697082B-F971-4F66-8D61-E9EAF99651F1","f2_transmissionSamplerMap":"22BCAE0A-C2CF-4A1A-841F-A0D284CC508A","f2_transmissionDepthMap":"BF81C2EA-F9C3-40D6-9D0C-FF520A556101","f2_aspectRatio":"873685EC-9FB3-4730-B73E-97A7E60F0C64","f2_alpha":"9AFCF48E-05F4-49E9-9513-F68D84308126","f2_mode":"1EDF083B-0124-425B-9079-76882C2400C5"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"3447FDF5-3B9A-46AA-A5A0-288CB52CD9D9","f4_far":"B717158E-478A-4E74-ADE4-3DCDC37606DB","f4_isVector":"D97760FB-3771-47BB-A76A-F2345767D524","f4_isWorldSpace":"5EF79ABF-A16A-42CA-816D-CDD4D7B6C172","f4_origin":"60EA6596-D83C-4888-9A03-28D37025F6E3","f4_colorA":"82789E71-B21C-4ECB-A330-63A8E7EE2D10","f4_colorB":"B4BD1B62-3705-46EE-89CC-A2A84760D962","f4_alpha":"A8D4B19E-021B-4B7D-A509-9D70802D4ECD","f4_mode":"B3EEEFE7-06D1-45A9-808A-486E8402F285"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"7EBA9DDA-9030-46BF-AC79-6CB340C6B72C","f3_bias":"A682A9CC-9C49-4E2E-9733-91119E53B914","f3_scale":"5A01E9A8-8A89-4379-80BB-6B5145A73A8B","f3_intensity":"06ECDBD9-FD02-452C-948C-22DF375FFB68","f3_factor":"2B76FAA1-3B39-4857-8C22-04D0BF4A75E7","f3_alpha":"78DD188B-786D-4CD0-A9C5-DECE803169DE","f3_mode":"4BE553B5-704C-4553-8C4A-4DE0BE7F8D6C"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"46AD0CA3-B54D-4580-8426-513FCE85F8C8","fragment":"46AD0CA3-B54D-4580-8426-513FCE85F8C8"},{"uuid":"92B2CFCD-8116-4CE7-8DD8-EA2CAF09F11C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0F3994BC-9882-4D19-8241-EB24B17A7165","f1_mode":"45A2BA62-3813-4B9B-89F0-EFBCD8AEAD4B","f1_shininess":"50A339BB-FA29-4384-902C-D617CD086AF4","f1_specular":"CDB67885-F25D-4588-A8C6-C019DAA4AEFC"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6CC6F9D3-39A6-4233-9B1E-6F8E7792DE81","f2_ior":"DDF44261-563F-4E4B-AB62-945FDB75D4FA","f2_roughness":"133F962C-C647-4B35-9ACD-C1745193805A","f2_transmissionSamplerSize":"82DFEBEF-EDEC-46C2-9AF2-C5009CD5AB0C","f2_transmissionSamplerMap":"575ACC27-BD5C-4275-9129-60DBD3593447","f2_transmissionDepthMap":"3BAA132C-FFE1-430E-B2D2-C63B738E180C","f2_aspectRatio":"06A5472A-FCA5-46D8-8463-4410B2B32811","f2_alpha":"0ABC3804-8B23-49D3-865E-D294D7E78DAB","f2_mode":"1C36850B-A5AE-4C55-9907-12F36D9E4390"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"67B0C4C2-2A21-49D6-8609-F9D7C87BB3E5","f4_far":"B5D15FE9-E1B3-40FD-841A-89363AC94556","f4_isVector":"0AAE9D65-4E32-4F14-8B17-FFFF9AEFFA52","f4_isWorldSpace":"8CECB5EB-B19D-4B60-81B5-722B3D0504D4","f4_origin":"D5FAAA95-4C7B-49E7-903C-A81A7DCAD0C2","f4_colorA":"7A5CA8E5-F8DB-40DB-8375-F99FC8BFC8A0","f4_colorB":"CD521158-C290-4299-A7DC-64F512F5BDE5","f4_alpha":"58A561BC-1861-42D5-9ED6-3E66332D2129","f4_mode":"AD372098-47E3-4612-8D66-1A8CEA97776B"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6FF7F73B-C1AA-4548-A479-3FA13B6E2EF7","f3_bias":"5F0EE479-E6DB-467D-B47D-339E013F6E62","f3_scale":"2BF98769-4520-4C29-B51D-D8BBF303A468","f3_intensity":"994DC51F-E3E7-4D86-9628-B3B26E02121F","f3_factor":"3EF9D632-C98A-4349-9592-BA70CBA6FA5F","f3_alpha":"1352DE26-B1C0-4921-AA5A-4A726F582D64","f3_mode":"596946BB-00F3-4A5F-93FD-0A2D376AF86E"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F70CF1FF-B4DD-4AFD-9FF7-F2B240BC206F","fragment":"F70CF1FF-B4DD-4AFD-9FF7-F2B240BC206F"},{"uuid":"186C536D-6BA5-4402-9E81-FCE02D40E9F5","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4440195B-45F0-4136-B442-AF778B774084","f1_mode":"1BF9EB7D-6E0A-42CE-B111-816B34B36E3F","f1_shininess":"AED9406A-D759-4D86-9FD5-CB43DD98FEAA","f1_specular":"F8B35015-DDA3-4E51-B4F4-935EC0BBAAEF"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"55B9E71B-0C67-4272-BA74-F07440054FA6","f2_ior":"67B0E6E6-106F-42C8-875F-FCEAFA36625F","f2_roughness":"109FD23D-E31F-4490-8AA2-F0E83F7F70D8","f2_transmissionSamplerSize":"C32FA4D2-C4B2-4968-BDFA-75A51505E146","f2_transmissionSamplerMap":"85030321-C3A9-4085-B749-BD7D97361827","f2_transmissionDepthMap":"33664B63-5E1A-4632-80C0-B2516FC177DB","f2_aspectRatio":"1B55A3E2-5F46-42FB-80B7-EBF9ECA3EDF4","f2_alpha":"11B9D285-0ADD-4BF4-B311-AFE8F3563E66","f2_mode":"1C84A60F-D312-4014-A2FD-1B8AA95406CB"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"53399336-C070-4CFB-B628-0FF6CC4705EB","f4_far":"18567C11-F773-4001-B3A3-D1CADF6A14BB","f4_isVector":"E28B4A80-8BEB-49FD-ABFC-DD28ED088CA2","f4_isWorldSpace":"553655A1-9074-484B-A35B-125BCA6109F5","f4_origin":"08CD572A-A605-4F0C-9526-21BBBEF93577","f4_colorA":"9EA35503-F6D2-4D0F-B5F4-E036000B5DB9","f4_colorB":"88CA35CB-1AA1-4DFF-8B90-6C312625AF5D","f4_alpha":"A723CEB8-DFE7-460A-9DAA-16DD6BA4EAE1","f4_mode":"6A4C9209-B945-4934-9CEA-5233D400626D"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"CB837AF7-974B-4734-AFA3-655423785F71","f3_bias":"AEAFA3F2-CB36-4BE5-8745-1F93D739419D","f3_scale":"BB8F65D0-4E57-4FEA-85F7-C1F911F2891B","f3_intensity":"CB0E6084-EE11-4668-8CA5-5D6AAB4EE654","f3_factor":"31707326-8461-4FB0-B4B9-CD4CB04052A4","f3_alpha":"2FD89FF0-8BCC-4E11-9E63-3710100ECD58","f3_mode":"91366E00-2E8B-4BCF-8188-30CEBB7314DF"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"DF38B24E-BA24-4C54-813E-193A7E76E851","fragment":"DF38B24E-BA24-4C54-813E-193A7E76E851"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"C2126691-6153-4287-8203-07B7BE69A8EF","name":"Base State","position":[34.522355355824786,2.1240479310930604,-19.792513368034697],"rotation":[-0.34906585039886645,0,0,"XYZ"],"scale":[1,0.9999999999999991,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"92C76C91-C572-439B-805D-6BE41924A872","name":"State 1","position":[34.522355355824786,2.1240479310930604,-19.792513368034697],"rotation":[-0.3490658503988665,0,-0.08726646259971646,"XYZ"],"scale":[1,0.9999999999999991,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"FDA5FA53-EEA4-4EBB-9AD2-47C50DD19BF9","name":"Base State","position":[123.2332767836149,54.059594317155856,-77.05647762613687],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5CBFB442-1672-476F-A294-083C1152C05A","f1_mode":"8BBDC6A0-5A3D-4857-8882-D2B36D7F8E52","f1_shininess":"7B9E74DF-5463-4827-9311-E651EF0A6301","f1_specular":"DF3E7A3F-A7AE-436A-9AF3-C6B82CE95C44"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"0D47687A-754E-4004-9D2C-AB51AB2EDC00","f2_ior":"7A80E96C-A290-4A3D-99D7-B79DB04CCEF8","f2_roughness":"DBBEE708-6CEE-41C6-A918-12DB1212E314","f2_transmissionSamplerSize":"D27BA626-FAF9-46CF-9B90-00E755638C83","f2_aspectRatio":"2DFEA673-0A87-4D75-849E-5F649AE9B2DC","f2_alpha":"846D927A-A1E0-41F7-8770-BBA9F478C224","f2_mode":"A87FDC59-CBF1-479B-AFE5-2255435265EC"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"FD56A9C7-AFFC-4C73-9027-355CCD70ED48","f4_far":"A700D940-FCEE-4F76-8CD3-09B0B8FB971A","f4_isVector":"817E95EB-6214-45C0-8C29-FEAD64078CDF","f4_isWorldSpace":"F554CF08-6C91-4061-9A8A-9564A18951D4","f4_origin":"1FFAD7A0-8D62-4B60-905C-3D9B4DEDE15D","f4_colorA":"9B28158B-E6FC-4DA5-8648-3F6D22F2CBD9","f4_colorB":"5D0D0D1A-3656-4FD8-98E8-99AE2C8B6DE0","f4_alpha":"4984E86B-8D3B-494D-B1DB-F3BF4C97C154","f4_mode":"B24EF2B2-5AE8-46CB-A7EE-592DECDF9A10"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B7422566-614E-4A46-9C64-5F0E483796EC","f3_bias":"C677D601-F31F-4A14-9874-BB5988AB3789","f3_scale":"1AEFD45D-0270-4DD5-AEAD-2B7F28A37B3E","f3_intensity":"561FB9EA-19A6-41D9-B0E4-144BA207F743","f3_factor":"2483AC9A-2F53-454E-8A4C-9AF1FC312B41","f3_alpha":"59FB5D1C-8AF2-4918-9044-4A2C47C79297","f3_mode":"AAD5766E-27D5-436A-BAA3-C1B9FF952A2C"}}]}},{"uuid":"7603BBA4-0FEC-4C3A-8039-BE7E8AF37981","name":"State 1","position":[123.2332767836149,54.059594317155856,-77.05647762613687],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"FC5B706B-72A6-447E-B845-0E89CE525E90","f1_mode":"82B7F7D8-CB1A-452D-B02D-624DB2C5FBB9","f1_shininess":"DF7A449B-794E-491E-A4DE-7897473FC22A","f1_specular":"BFD6EFDD-92A3-4A3E-A26F-A512C3E9F4CE"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"EFE21BA4-13E8-4AB6-B973-F1E4A0A92482","f2_ior":"162A666D-7CEA-4AD1-A410-9B8E0E8FEFD8","f2_roughness":"AB08A003-B58D-4201-8345-B783AF2C16DA","f2_transmissionSamplerSize":"A1314F89-B7E4-4D08-B770-D9FD4603DB56","f2_aspectRatio":"304458B3-2214-4FF4-A279-8CB6644923F0","f2_alpha":"330E525F-5137-4707-8E81-13BF58DDB414","f2_mode":"D621EB40-FD41-41AA-B009-451203E212B9"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"0095612B-AF9D-4645-8FD7-0B89581C19E0","f4_far":"108DFFE1-BA42-435C-8984-87D87ABF9A39","f4_isVector":"2AFE91F4-2B2C-48DB-A783-85DB1A7D278D","f4_isWorldSpace":"CB0E4B33-45FE-449D-82DA-A2CF26C8B441","f4_origin":"D88BBA62-C040-4243-B93A-963DF64E2B05","f4_colorA":"DE0F6BD7-84EA-4290-9DCA-D3098161EF58","f4_colorB":"5B8B28FF-43ED-4B06-8516-A6DB083819D9","f4_alpha":"6DE06534-9985-4B21-B733-BDA9955DD242","f4_mode":"5BB18D46-9861-4EC8-9D8A-BDE037CD4BB4"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8E176593-4D1F-4750-B1C8-68BE81DC1CAF","f3_bias":"4853A4B5-C5D5-4CF9-B38D-11F60E42D208","f3_scale":"858E96BD-4365-4D14-8AC3-3E0CBAE756C5","f3_intensity":"5070C1E1-14B0-4D2E-A022-D9FF8C9AA597","f3_factor":"9AA7CEA5-61B9-4382-AFD5-759F57E80F36","f3_alpha":"C6A3334A-5B26-4651-98CD-20F728004AB2","f3_mode":"65487876-4FAE-4AEC-AA92-F0EF818F1DC3"}}]}},{"uuid":"B72A6BC8-8701-4997-B8AD-2EC36F1356EC","name":"Base State","position":[-444.36428618166275,-124.22591305881565,186.43581367365115],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"18D6529B-E34A-406A-B73F-D52A41140560","f1_mode":"2ED702DD-45E9-461E-B294-90BAEA363AD1","f1_shininess":"5DFD4FC5-C122-4E74-BE7E-E2D7C8EECAA9","f1_specular":"7CAABD40-7893-4655-BAAA-FA68FACFA9C0"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"2A7F3D3D-0782-45F9-97F9-86481E72AFBE","f2_ior":"A5663FA5-87E4-4058-8529-A75F9A8A604A","f2_roughness":"F0E29D6D-29EB-49B2-9511-567407711745","f2_transmissionSamplerSize":"D7F11ADD-44C8-4BBA-8366-BC652153EC4F","f2_aspectRatio":"65D37099-2EDB-4F41-9059-86302FAD69E9","f2_alpha":"52CC02F0-F28D-43E0-A770-2403FF4FB2E3","f2_mode":"84EA05A2-609C-4A71-9DF7-163DF84A8730"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"27055E9E-DD84-43C1-96F7-AEB4057CCE77","f4_far":"0F5600CB-65E7-460E-BDD9-345A8187E194","f4_isVector":"076C2DCD-2DB8-424E-A79B-5C102BFE484B","f4_isWorldSpace":"DCCE9A35-DD06-4A10-A322-743437B4B83F","f4_origin":"17C07D00-4032-4E1F-B29B-2EE64E6F335E","f4_colorA":"72B07781-8ECB-4118-84BB-195B39B313DE","f4_colorB":"1E11120A-2B3A-47C2-96CB-C0639DE6F2EE","f4_alpha":"2AAE8F98-54AF-47DC-BAB8-28FC1B96D0D7","f4_mode":"36F961B0-9832-422B-8E2D-221CC0403D57"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A31A811A-3DA7-48D2-BB65-E275728B781E","f3_bias":"241CCA79-045E-4165-AD9D-68CB72978717","f3_scale":"DEAFF133-4CB1-4B82-9733-E83DDA9F7C52","f3_intensity":"B2F8C036-7065-46DC-B6D2-27F1CB6B21CB","f3_factor":"A24BF3EB-0373-45A2-B89D-70D5A5F67425","f3_alpha":"8D8A07B7-F6B1-4869-81DC-34BEB06A648F","f3_mode":"EB7972C7-F75A-4933-BA58-22E9B86A4D86"}}]}},{"uuid":"69D68840-C232-4B4C-88A0-02688BC6C662","name":"State 1","position":[-444.36428618166275,-124.22591305881565,186.43581367365115],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1229F3E6-EF8C-4E17-A4D2-31C3C39BE435","f1_mode":"CE31F311-C4F2-4146-8FAB-90BF9989FA34","f1_shininess":"1D25F405-575E-441A-AAA8-124AB716620B","f1_specular":"D1E16EA8-F27F-4D5A-A321-F943F079FFE1"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6EA18715-4DBC-4BD3-B4A5-B45C1E2DEB00","f2_ior":"216AA44C-3551-42D7-AD36-A9CC4EA92DBC","f2_roughness":"D9B23B1C-338D-4D39-A844-CC71DDA7BCA6","f2_transmissionSamplerSize":"CA46E4B2-1DA2-4F1A-9A98-BC43DF697416","f2_aspectRatio":"B17C500D-769A-4C20-B4DE-C0779896ED1B","f2_alpha":"D514AB06-D406-4A77-B823-1F8D76A418C1","f2_mode":"47AF38E8-E25D-48D8-A8C6-5F64E7C71E48"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"82BDC5ED-32D8-48BC-8192-ED7030369BD4","f4_far":"954A78EF-D855-4DD7-8C63-16FE2CD117BF","f4_isVector":"D8386A2D-96CE-40D9-98D8-78D83FBC3D1E","f4_isWorldSpace":"41DE6DE7-1CED-4777-AB6F-6D45E76B7BC1","f4_origin":"761265BF-832C-443C-B355-B05AC19C6606","f4_colorA":"FF4E2A23-2E92-4B32-9B94-501CC98C484A","f4_colorB":"C68C3735-D183-4396-B04B-3B1BF8CCACF1","f4_alpha":"D2838303-B47A-46A8-9CA9-B5456265815C","f4_mode":"DEA5BBF6-6EA3-401D-B678-BF90F3812E77"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6B786FD2-8868-45E1-8E88-2A54C85EA5D1","f3_bias":"8DE77443-8874-49D6-92F7-921C33721FD0","f3_scale":"61E2EEFD-112B-46A4-A6F1-91EA6F6D17F6","f3_intensity":"35E1B287-AFE6-4026-890A-7D428A8DBEA4","f3_factor":"769845DD-A2A9-46A8-9431-489F0D964E31","f3_alpha":"A7B847FA-21A6-41DA-99B4-2F4DB62B7D4C","f3_mode":"A5470ED2-0F86-4896-86A4-D547F1A88FA8"}}]}},{"uuid":"3B418A74-2EF9-4F23-A5CC-962566D50AB5","name":"Base State","position":[-7.8879806217634325,-12.538128902116185,138.06153221290793],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E47AC13A-6CFA-4992-BD61-1576FD91E11A","f1_mode":"6FB6165B-0106-4841-9492-45700809C3B5","f1_shininess":"377EBCD9-BA02-4331-9206-31C12E3F8D67","f1_specular":"5E4E2689-A6E9-473D-9F76-13C494124DB3"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"FFF94F77-5643-486F-A4CC-E24ABEB75BFA","f2_ior":"E4D8C1C2-8A10-4A7D-A1AA-88CEC08CF9D3","f2_roughness":"9CE01F53-BFB9-415F-867F-FDAFD74B6E1B","f2_transmissionSamplerSize":"4085B714-9AB8-4642-8CEF-84D0C5A33071","f2_aspectRatio":"9DCF746F-E70C-4A6D-92BE-4B0B64867454","f2_alpha":"EA83AAAA-A74B-422D-BDCB-41396637BBA7","f2_mode":"7BFB3823-C131-4565-A1C5-F8B7E858CCA6"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"669998A2-9A3A-4F49-AE8F-F83C8DCC3B33","f4_far":"12548306-EE2B-47C2-9DE0-D2EB638DD29B","f4_isVector":"7B2CCD4D-2E84-44C1-8F47-644B2C47341C","f4_isWorldSpace":"F1C8582E-7515-4D88-847F-904470DA88F4","f4_origin":"2060DDA0-BA63-4589-914F-65D4C176F98A","f4_colorA":"A843F48A-B68E-4C5B-97F3-E41A938ED008","f4_colorB":"FBA727EC-CC64-4D82-8F7F-71A6788A0718","f4_alpha":"7826E882-A77F-4949-9B4A-C48569690D78","f4_mode":"4EBFF65A-D81B-48CE-AD27-EB4321EC119D"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E573192C-60BA-4081-A17C-B8BC0F7118B5","f3_bias":"977E1C42-1DE0-40F8-AB10-1AEC901C645C","f3_scale":"B767A36B-182E-4D3B-AD90-BC06D7C2F556","f3_intensity":"1A0326DD-2DDB-4D1D-922A-B3E9F063B30C","f3_factor":"C565F207-029C-490A-8945-AEE80C2B3764","f3_alpha":"28102F98-859F-473E-96BE-6FCD947C3EB9","f3_mode":"D2A0291D-3354-43BD-8EA6-41A74D020A3C"}}]}},{"uuid":"100B2EEF-4D8A-422E-9ECF-744E8B7C9725","name":"State 1","position":[-7.8879806217634325,-12.538128902116185,138.06153221290793],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1F6C658B-AD1E-41E0-A181-66DAB407BCE0","f1_mode":"D9B8F957-D7C3-465B-A0B7-0CDC2A72C892","f1_shininess":"8B90120B-1798-4892-80D8-FAB9E902085F","f1_specular":"2FD33471-3580-4B34-8D05-33A37655AD2C"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"698D883A-D083-41FE-8F42-32567A3C459F","f2_ior":"A1344A98-49F9-44A2-8CE2-3E5CFE130401","f2_roughness":"6433E6EF-3FBE-46CE-91E6-6768D8CB6B4A","f2_transmissionSamplerSize":"956948E9-7292-449A-B569-A6C87918156F","f2_aspectRatio":"75132D1D-9D2E-4F3C-88A4-BB05AEA8296E","f2_alpha":"98F6A627-656B-44FA-A4F2-D3EF861F84D6","f2_mode":"AB20926C-E474-4BC8-A8EF-D2509464D7D2"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"572EE4A9-3FF9-49DB-B5A0-702876EAB1C8","f4_far":"0EE7F767-43C1-420E-B277-2B90C85F007A","f4_isVector":"F759BF11-76C3-4BD0-9BEF-3E2C1787DB77","f4_isWorldSpace":"383D6EC7-2A59-4C25-BA43-FA1F42DD1B9B","f4_origin":"C85052E0-5A69-41D6-BEA9-79A991744437","f4_colorA":"AF333F46-8650-4032-8414-0956D9C2E708","f4_colorB":"E542712C-0A6A-4A21-9DA2-C042DFD52293","f4_alpha":"8A0F9014-3089-4D1F-9836-6827D20CE751","f4_mode":"AC8CE320-FB16-440C-8FF0-FC2B87AD0CE3"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"14F9C742-3EB9-423E-8E3C-D9E98692A3AD","f3_bias":"BD4C991A-9C9E-4EF9-9A86-27AE1E4B72D8","f3_scale":"5E043359-AF18-49D9-99A1-6A0D0301C455","f3_intensity":"C83526BC-B868-40B5-8AB2-112C09FBFC1D","f3_factor":"B6E4886A-1B67-43F9-914A-A6FA5AA0EC2E","f3_alpha":"DA710739-ACD7-4BC1-8704-BBDBD6445871","f3_mode":"69A6D19F-753F-4C54-9653-EC40DF61CFE4"}}]}},{"uuid":"FB5D512A-A8F2-423F-B59B-95AEB5936F4A","name":"Base State","position":[-39.93883535642771,17.162956902988817,-63.62719986286736],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DC0A61A1-CB62-49B6-B210-6F4E3D08C5E7","f1_mode":"5B406F84-FBFF-439D-A7D9-05AAA5346365","f1_shininess":"3A15FC52-10BF-41BF-964D-D1064B1AC49F","f1_specular":"F1B033E0-AB23-48A9-8982-220D2CFAE7B2"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B03E14E7-4CEE-4F73-B395-244D5E97C291","f2_ior":"12EC4CD5-0DB8-4742-A52F-E8653C5D09B9","f2_roughness":"C5BF113E-0532-4D85-A5C3-2069592AD8C1","f2_transmissionSamplerSize":"296ACBBD-ACFC-422A-8F85-A75F235FBEE7","f2_aspectRatio":"31E98920-79BA-42FA-A523-6948DFCE5CC2","f2_alpha":"44190E28-4E3F-454D-91BA-1E6C5DC1E68F","f2_mode":"A84C45B7-9488-4C72-AC4F-5413226CCC70"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"8B7A4226-55F8-427C-B42B-A6A0AB017809","f4_far":"26AAACBA-891D-4376-842A-02AEAA89C00D","f4_isVector":"1F5CF9EA-0A6B-401C-9D99-663819A51FA9","f4_isWorldSpace":"811421D0-4346-4F58-91BD-58402222D109","f4_origin":"F93C5035-9330-4976-A69D-9FD0E06859D6","f4_colorA":"6359CBB4-772A-4D5E-A9AC-2BFF2FCCE4B9","f4_colorB":"B8FEB41A-2F92-4CB4-9C0C-E5E0A77C9E07","f4_alpha":"BCD20AB9-C66D-495D-852A-C9E75EFE5A95","f4_mode":"523CC25B-B082-4296-A32F-F27CF9781197"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"2349F279-BC68-4CB0-8891-C00D0FB56F3A","f3_bias":"6D187E01-92BC-4472-9C22-BE7D53A91DA5","f3_scale":"5B119376-7301-4369-9833-85F39745CE51","f3_intensity":"7C66DF9C-C643-422E-AC88-56E4811FE60A","f3_factor":"A23BE53F-9E18-477A-A867-12B16CEEE7FD","f3_alpha":"DFF0FA3C-93C8-4488-8941-B510CCC1DD7E","f3_mode":"51C375C7-6148-4388-85DD-BDEC2FFB2BFC"}}]}},{"uuid":"12E65104-9142-43EF-9ADC-50C614076EA3","name":"State 1","position":[-39.93883535642771,17.162956902988817,-63.62719986286736],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"53FC7D39-8925-4301-9112-58109BAE285C","f1_mode":"13309F45-B9DF-4FC5-820F-486105B63EA7","f1_shininess":"46A3F77E-B4E8-4220-9866-4732D2F7B9FB","f1_specular":"3A0BB354-38DA-4AB3-A9D0-45B22EAF0A96"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DD4EA74A-CDCD-423A-A3D6-7C01F491CDC1","f2_ior":"0530B3C3-D679-44E9-902F-C6E2834535C9","f2_roughness":"EA8522DE-C7C3-41F3-A33F-C19C58966243","f2_transmissionSamplerSize":"0598C0DC-15BF-4A15-BB0A-98972BB13417","f2_aspectRatio":"551084AB-9890-49F0-9818-8077F2DA24FE","f2_alpha":"3B68A297-C03E-4E09-B8FE-C8C20B13904E","f2_mode":"395BF310-E70B-4CAA-83FB-AD78197E9DDF"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"9DE405E8-E2F4-4546-BDBB-0C508F87D8DE","f4_far":"C0587BEE-ED02-4046-B8E0-9F94C52B4530","f4_isVector":"AE457173-15A0-4148-893D-459E29ABBC42","f4_isWorldSpace":"B1F62984-1AEF-404B-AAEB-E71A38984C4D","f4_origin":"A3BFBE85-F1B6-4CB0-8CFD-40F3EF5558BB","f4_colorA":"0DC0E14E-D1A8-409C-AAAB-C86710C1CE73","f4_colorB":"9574145F-E5B9-4CDF-92D8-4589495CA573","f4_alpha":"59856B2E-4E4C-476B-BB9D-32FB01943491","f4_mode":"7083D5D2-0659-41C0-9E73-E7DD5D827E32"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B95070B3-BD3B-405F-99B7-2220771113C4","f3_bias":"5BCF8249-A105-465D-8729-BC9094AB8007","f3_scale":"F19410EE-5CC0-4DC7-A368-D3389E7CA4B0","f3_intensity":"B076BDD0-2EDC-4877-95E2-53CC58AD9B17","f3_factor":"9AD9B416-F18E-4D78-A118-607EFDA86079","f3_alpha":"3AB3849A-6945-4357-9CBC-13C32F9E538C","f3_mode":"22DCCF5E-B036-488A-9F6A-3D842757ED9A"}}]}}],"nodes":[{"uuid":"91678DE9-BB0B-4085-AC70-E41AA243F34E","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"3079D4CC-3CCF-4D1C-A124-42A0EC457A4A","nodeType":"Color"},{"uuid":"3079D4CC-3CCF-4D1C-A124-42A0EC457A4A","type":"f","value":1,"nodeType":"Float"},{"uuid":"0C14754C-6E5D-486E-8422-FC002DED04F9","type":"i","value":0,"nodeType":"Int"},{"uuid":"34C525EF-5E42-4E08-BCC5-5479FF78E00E","type":"f","value":1,"nodeType":"Float"},{"uuid":"75B99FCC-9B4E-498C-9387-FA8A75380C3C","type":"i","value":0,"nodeType":"Int"},{"uuid":"7113B62F-FA30-438F-B2E7-28393CB39D28","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"21B63E01-7561-4D92-8980-56B741703C05","type":"f","value":0,"nodeType":"Float"},{"uuid":"6E757205-20D6-4410-B648-620E552BDAB4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"EF8D8166-5E1E-4ABB-939F-5454440A93CD","type":"standard","color":"91678DE9-BB0B-4085-AC70-E41AA243F34E","roughness":"7113B62F-FA30-438F-B2E7-28393CB39D28","metalness":"21B63E01-7561-4D92-8980-56B741703C05","alpha":"B632CB71-6B80-4D91-A5B6-94F3839E5123","reflectivity":"6E757205-20D6-4410-B648-620E552BDAB4","shadingAlpha":"34C525EF-5E42-4E08-BCC5-5479FF78E00E","shadingBlend":"75B99FCC-9B4E-498C-9387-FA8A75380C3C","nodeType":"Standard"},{"uuid":"B632CB71-6B80-4D91-A5B6-94F3839E5123","type":"f","value":1,"nodeType":"Float"},{"uuid":"5CBFB442-1672-476F-A294-083C1152C05A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8BBDC6A0-5A3D-4857-8882-D2B36D7F8E52","type":"i","value":0,"nodeType":"Int"},{"uuid":"7B9E74DF-5463-4827-9311-E651EF0A6301","type":"f","value":30,"nodeType":"Float"},{"uuid":"DF3E7A3F-A7AE-436A-9AF3-C6B82CE95C44","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"0D47687A-754E-4004-9D2C-AB51AB2EDC00","type":"f","value":10,"nodeType":"Float"},{"uuid":"7A80E96C-A290-4A3D-99D7-B79DB04CCEF8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"DBBEE708-6CEE-41C6-A918-12DB1212E314","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"D27BA626-FAF9-46CF-9B90-00E755638C83","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2DFEA673-0A87-4D75-849E-5F649AE9B2DC","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"846D927A-A1E0-41F7-8770-BBA9F478C224","type":"f","value":1,"nodeType":"Float"},{"uuid":"A87FDC59-CBF1-479B-AFE5-2255435265EC","type":"i","value":0,"nodeType":"Int"},{"uuid":"FD56A9C7-AFFC-4C73-9027-355CCD70ED48","type":"f","value":50,"nodeType":"Float"},{"uuid":"A700D940-FCEE-4F76-8CD3-09B0B8FB971A","type":"f","value":118,"nodeType":"Float"},{"uuid":"817E95EB-6214-45C0-8C29-FEAD64078CDF","type":"f","value":1,"nodeType":"Float"},{"uuid":"F554CF08-6C91-4061-9A8A-9564A18951D4","type":"f","value":0,"nodeType":"Float"},{"uuid":"1FFAD7A0-8D62-4B60-905C-3D9B4DEDE15D","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"9B28158B-E6FC-4DA5-8648-3F6D22F2CBD9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"5D0D0D1A-3656-4FD8-98E8-99AE2C8B6DE0","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"4984E86B-8D3B-494D-B1DB-F3BF4C97C154","type":"f","value":1,"nodeType":"Float"},{"uuid":"B24EF2B2-5AE8-46CB-A7EE-592DECDF9A10","type":"i","value":2,"nodeType":"Int"},{"uuid":"B7422566-614E-4A46-9C64-5F0E483796EC","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"C677D601-F31F-4A14-9874-BB5988AB3789","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1AEFD45D-0270-4DD5-AEAD-2B7F28A37B3E","type":"f","value":1,"nodeType":"Float"},{"uuid":"561FB9EA-19A6-41D9-B0E4-144BA207F743","type":"f","value":2,"nodeType":"Float"},{"uuid":"2483AC9A-2F53-454E-8A4C-9AF1FC312B41","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"59FB5D1C-8AF2-4918-9044-4A2C47C79297","type":"f","value":1,"nodeType":"Float"},{"uuid":"AAD5766E-27D5-436A-BAA3-C1B9FF952A2C","type":"i","value":2,"nodeType":"Int"},{"uuid":"FC5B706B-72A6-447E-B845-0E89CE525E90","type":"f","value":1,"nodeType":"Float"},{"uuid":"82B7F7D8-CB1A-452D-B02D-624DB2C5FBB9","type":"i","value":0,"nodeType":"Int"},{"uuid":"DF7A449B-794E-491E-A4DE-7897473FC22A","type":"f","value":30,"nodeType":"Float"},{"uuid":"BFD6EFDD-92A3-4A3E-A26F-A512C3E9F4CE","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"EFE21BA4-13E8-4AB6-B973-F1E4A0A92482","type":"f","value":10,"nodeType":"Float"},{"uuid":"162A666D-7CEA-4AD1-A410-9B8E0E8FEFD8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"AB08A003-B58D-4201-8345-B783AF2C16DA","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A1314F89-B7E4-4D08-B770-D9FD4603DB56","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"304458B3-2214-4FF4-A279-8CB6644923F0","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"330E525F-5137-4707-8E81-13BF58DDB414","type":"f","value":1,"nodeType":"Float"},{"uuid":"D621EB40-FD41-41AA-B009-451203E212B9","type":"i","value":0,"nodeType":"Int"},{"uuid":"0095612B-AF9D-4645-8FD7-0B89581C19E0","type":"f","value":50,"nodeType":"Float"},{"uuid":"108DFFE1-BA42-435C-8984-87D87ABF9A39","type":"f","value":118,"nodeType":"Float"},{"uuid":"2AFE91F4-2B2C-48DB-A783-85DB1A7D278D","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB0E4B33-45FE-449D-82DA-A2CF26C8B441","type":"f","value":0,"nodeType":"Float"},{"uuid":"D88BBA62-C040-4243-B93A-963DF64E2B05","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"DE0F6BD7-84EA-4290-9DCA-D3098161EF58","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"5B8B28FF-43ED-4B06-8516-A6DB083819D9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"6DE06534-9985-4B21-B733-BDA9955DD242","type":"f","value":1,"nodeType":"Float"},{"uuid":"5BB18D46-9861-4EC8-9D8A-BDE037CD4BB4","type":"i","value":2,"nodeType":"Int"},{"uuid":"8E176593-4D1F-4750-B1C8-68BE81DC1CAF","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"4853A4B5-C5D5-4CF9-B38D-11F60E42D208","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"858E96BD-4365-4D14-8AC3-3E0CBAE756C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"5070C1E1-14B0-4D2E-A022-D9FF8C9AA597","type":"f","value":2,"nodeType":"Float"},{"uuid":"9AA7CEA5-61B9-4382-AFD5-759F57E80F36","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"C6A3334A-5B26-4651-98CD-20F728004AB2","type":"f","value":1,"nodeType":"Float"},{"uuid":"65487876-4FAE-4AEC-AA92-F0EF818F1DC3","type":"i","value":2,"nodeType":"Int"},{"uuid":"2CB6D271-E804-408A-A095-5A6B199C0DEC","type":"f","value":1,"nodeType":"Float"},{"uuid":"A3F466D5-4BA6-4C1C-8F01-0C2EA6A0B861","type":"i","value":0,"nodeType":"Int"},{"uuid":"8DF0A6CE-8CCC-4305-88F9-E41A20320C35","type":"f","value":30,"nodeType":"Float"},{"uuid":"B791D3F3-826A-4187-9B5F-D1BACB8A5B58","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"B52B7238-BCA3-47BE-BF5B-2519F0F94F5F","type":"f","value":10,"nodeType":"Float"},{"uuid":"2D475BD1-067D-420D-AA18-80E92DD96472","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F13FF362-3897-448C-A2E1-695F40D8B2F3","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C791364F-08C9-4638-A90E-CE63A8AD538F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2171407C-100F-467B-B2D9-DFDE64A7E817","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"CF9BCB2E-BC7D-4FE7-9951-7B45FFAF3DA2","project":false,"nodeType":"Texture"},{"uuid":"CF9BCB2E-BC7D-4FE7-9951-7B45FFAF3DA2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"269E8DF4-33A7-47CC-B4BA-250218381AC2","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"8EA85687-CDAB-4FA2-BDCC-C87B097FBB5C","project":false,"nodeType":"Texture"},{"uuid":"8EA85687-CDAB-4FA2-BDCC-C87B097FBB5C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"4CA00501-0997-4ED8-91C4-59B1782778D5","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"2F2960FC-B5D9-4CF2-9D70-F1207749EF6E","type":"f","value":1,"nodeType":"Float"},{"uuid":"CEDED1FA-0F33-496A-9072-50F8A22E82C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"3444D12F-FCE3-4052-B161-35C4AF0B0241","type":"f","value":50,"nodeType":"Float"},{"uuid":"F286E9FC-276A-4FAE-B8DE-A52EFCCFCF7E","type":"f","value":118,"nodeType":"Float"},{"uuid":"5F2B01E0-4E97-4939-9C39-8A37BE50FB51","type":"f","value":1,"nodeType":"Float"},{"uuid":"88330AA2-B275-4F2A-9D32-F0E7D5061EA6","type":"f","value":0,"nodeType":"Float"},{"uuid":"3436755B-7A3D-4640-88ED-C09F07130C5C","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"2E654354-570E-4323-9059-119FE0A7B54C","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"663862E0-483A-4588-9996-C225CA21C548","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"812EFC2D-BB3B-49B8-BD70-F8ABE6BA8560","type":"f","value":1,"nodeType":"Float"},{"uuid":"00409CCB-CFA6-4FC3-B510-2B7288973075","type":"i","value":2,"nodeType":"Int"},{"uuid":"A2184CB3-82EF-45BE-BEDF-7292CF9C1B44","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"797DBF6A-E58E-425D-A151-33C666422CA8","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BD2DE2B0-C29B-4EF9-9717-9BC58E2F3FFB","type":"f","value":1,"nodeType":"Float"},{"uuid":"5284FF17-A89D-4038-A12E-767ED1ACF32F","type":"f","value":2,"nodeType":"Float"},{"uuid":"3AEDFBCC-32A1-4B7A-B27E-2EAF64FC05E7","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"8CE74A8E-9620-4022-BF4E-B4CC79177153","type":"f","value":1,"nodeType":"Float"},{"uuid":"18366593-921A-4B89-8608-8779FB2C158E","type":"i","value":2,"nodeType":"Int"},{"uuid":"0F59CE8D-F19B-4BDF-8D43-0FD5CA68316F","type":"phong","color":"03F74EDA-247F-4392-A3F8-33591DFA13C5","specular":"B791D3F3-826A-4187-9B5F-D1BACB8A5B58","shininess":"8DF0A6CE-8CCC-4305-88F9-E41A20320C35","shadingAlpha":"2CB6D271-E804-408A-A095-5A6B199C0DEC","shadingBlend":"A3F466D5-4BA6-4C1C-8F01-0C2EA6A0B861","afterColor":"A8899657-69AF-4EE0-83AC-25D50FF46D32","alpha":"126271FC-62EE-4CB0-9204-0BDDE774D11E","nodeType":"Phong"},{"uuid":"03F74EDA-247F-4392-A3F8-33591DFA13C5","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"A8899657-69AF-4EE0-83AC-25D50FF46D32","type":"v3","a":"455F75BC-E8D7-4CE9-A79B-CC81D4D07702","b":"F5E1210D-2CEC-4495-8D75-863EE0F1745B","alpha":"58314DC9-6770-4DA6-BB8A-A152722219CD","mode":"18366593-921A-4B89-8608-8779FB2C158E","nodeType":"Blend"},{"uuid":"455F75BC-E8D7-4CE9-A79B-CC81D4D07702","type":"v3","a":"EFEC3B20-D57D-4FE6-80AB-5FBE6D9016A1","b":"549A60F0-63FC-4BC5-BB9D-19CB1B40E903","alpha":"1726D80C-4348-425B-949F-C4DD02C71B07","mode":"00409CCB-CFA6-4FC3-B510-2B7288973075","nodeType":"Blend"},{"uuid":"EFEC3B20-D57D-4FE6-80AB-5FBE6D9016A1","type":"v3","a":"363AEDF3-E07F-4DE7-9C88-337A60499D2D","b":"3FF572EE-16D3-480B-A92A-E9B0149258B1","alpha":"8830DE45-8413-4936-AC99-D58557D9BC18","mode":"CEDED1FA-0F33-496A-9072-50F8A22E82C3","nodeType":"Blend"},{"uuid":"363AEDF3-E07F-4DE7-9C88-337A60499D2D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3FF572EE-16D3-480B-A92A-E9B0149258B1","type":"v3","thickness":"B52B7238-BCA3-47BE-BF5B-2519F0F94F5F","ior":"2D475BD1-067D-420D-AA18-80E92DD96472","roughness":"F13FF362-3897-448C-A2E1-695F40D8B2F3","alpha":"2F2960FC-B5D9-4CF2-9D70-F1207749EF6E","calpha":"g3FF572EE16D3480BA92AE9B0149258B1_calpha","nodeType":"Transmission"},{"uuid":"8830DE45-8413-4936-AC99-D58557D9BC18","type":"f","src":"g3FF572EE16D3480BA92AE9B0149258B1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"549A60F0-63FC-4BC5-BB9D-19CB1B40E903","type":"v3","near":"3444D12F-FCE3-4052-B161-35C4AF0B0241","far":"F286E9FC-276A-4FAE-B8DE-A52EFCCFCF7E","isVector":"5F2B01E0-4E97-4939-9C39-8A37BE50FB51","isWorldSpace":"88330AA2-B275-4F2A-9D32-F0E7D5061EA6","origin":"3436755B-7A3D-4640-88ED-C09F07130C5C","colorA":"2E654354-570E-4323-9059-119FE0A7B54C","colorB":"663862E0-483A-4588-9996-C225CA21C548","alpha":"812EFC2D-BB3B-49B8-BD70-F8ABE6BA8560","nodeType":"Depth"},{"uuid":"1726D80C-4348-425B-949F-C4DD02C71B07","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"812EFC2D-BB3B-49B8-BD70-F8ABE6BA8560"},"nodeType":"Expression"},{"uuid":"F5E1210D-2CEC-4495-8D75-863EE0F1745B","type":"v3","color":"A2184CB3-82EF-45BE-BEDF-7292CF9C1B44","bias":"797DBF6A-E58E-425D-A151-33C666422CA8","scale":"BD2DE2B0-C29B-4EF9-9717-9BC58E2F3FFB","intensity":"5284FF17-A89D-4038-A12E-767ED1ACF32F","factor":"3AEDFBCC-32A1-4B7A-B27E-2EAF64FC05E7","alpha":"8CE74A8E-9620-4022-BF4E-B4CC79177153","mode":"18366593-921A-4B89-8608-8779FB2C158E","calpha":"gF5E1210D2CEC44958D75863EE0F1745B_calpha","nodeType":"Fresnel"},{"uuid":"58314DC9-6770-4DA6-BB8A-A152722219CD","type":"f","src":"gF5E1210D2CEC44958D75863EE0F1745B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"126271FC-62EE-4CB0-9204-0BDDE774D11E","type":"f","value":1,"nodeType":"Float"},{"uuid":"18D6529B-E34A-406A-B73F-D52A41140560","type":"f","value":1,"nodeType":"Float"},{"uuid":"2ED702DD-45E9-461E-B294-90BAEA363AD1","type":"i","value":0,"nodeType":"Int"},{"uuid":"5DFD4FC5-C122-4E74-BE7E-E2D7C8EECAA9","type":"f","value":30,"nodeType":"Float"},{"uuid":"7CAABD40-7893-4655-BAAA-FA68FACFA9C0","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"2A7F3D3D-0782-45F9-97F9-86481E72AFBE","type":"f","value":10,"nodeType":"Float"},{"uuid":"A5663FA5-87E4-4058-8529-A75F9A8A604A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F0E29D6D-29EB-49B2-9511-567407711745","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"D7F11ADD-44C8-4BBA-8366-BC652153EC4F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"65D37099-2EDB-4F41-9059-86302FAD69E9","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"52CC02F0-F28D-43E0-A770-2403FF4FB2E3","type":"f","value":1,"nodeType":"Float"},{"uuid":"84EA05A2-609C-4A71-9DF7-163DF84A8730","type":"i","value":0,"nodeType":"Int"},{"uuid":"27055E9E-DD84-43C1-96F7-AEB4057CCE77","type":"f","value":50,"nodeType":"Float"},{"uuid":"0F5600CB-65E7-460E-BDD9-345A8187E194","type":"f","value":118,"nodeType":"Float"},{"uuid":"076C2DCD-2DB8-424E-A79B-5C102BFE484B","type":"f","value":1,"nodeType":"Float"},{"uuid":"DCCE9A35-DD06-4A10-A322-743437B4B83F","type":"f","value":0,"nodeType":"Float"},{"uuid":"17C07D00-4032-4E1F-B29B-2EE64E6F335E","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"72B07781-8ECB-4118-84BB-195B39B313DE","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"1E11120A-2B3A-47C2-96CB-C0639DE6F2EE","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"2AAE8F98-54AF-47DC-BAB8-28FC1B96D0D7","type":"f","value":1,"nodeType":"Float"},{"uuid":"36F961B0-9832-422B-8E2D-221CC0403D57","type":"i","value":2,"nodeType":"Int"},{"uuid":"A31A811A-3DA7-48D2-BB65-E275728B781E","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"241CCA79-045E-4165-AD9D-68CB72978717","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DEAFF133-4CB1-4B82-9733-E83DDA9F7C52","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2F8C036-7065-46DC-B6D2-27F1CB6B21CB","type":"f","value":2,"nodeType":"Float"},{"uuid":"A24BF3EB-0373-45A2-B89D-70D5A5F67425","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"8D8A07B7-F6B1-4869-81DC-34BEB06A648F","type":"f","value":1,"nodeType":"Float"},{"uuid":"EB7972C7-F75A-4933-BA58-22E9B86A4D86","type":"i","value":2,"nodeType":"Int"},{"uuid":"1229F3E6-EF8C-4E17-A4D2-31C3C39BE435","type":"f","value":1,"nodeType":"Float"},{"uuid":"CE31F311-C4F2-4146-8FAB-90BF9989FA34","type":"i","value":0,"nodeType":"Int"},{"uuid":"1D25F405-575E-441A-AAA8-124AB716620B","type":"f","value":30,"nodeType":"Float"},{"uuid":"D1E16EA8-F27F-4D5A-A321-F943F079FFE1","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"6EA18715-4DBC-4BD3-B4A5-B45C1E2DEB00","type":"f","value":10,"nodeType":"Float"},{"uuid":"216AA44C-3551-42D7-AD36-A9CC4EA92DBC","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D9B23B1C-338D-4D39-A844-CC71DDA7BCA6","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CA46E4B2-1DA2-4F1A-9A98-BC43DF697416","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"B17C500D-769A-4C20-B4DE-C0779896ED1B","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"D514AB06-D406-4A77-B823-1F8D76A418C1","type":"f","value":1,"nodeType":"Float"},{"uuid":"47AF38E8-E25D-48D8-A8C6-5F64E7C71E48","type":"i","value":0,"nodeType":"Int"},{"uuid":"82BDC5ED-32D8-48BC-8192-ED7030369BD4","type":"f","value":50,"nodeType":"Float"},{"uuid":"954A78EF-D855-4DD7-8C63-16FE2CD117BF","type":"f","value":118,"nodeType":"Float"},{"uuid":"D8386A2D-96CE-40D9-98D8-78D83FBC3D1E","type":"f","value":1,"nodeType":"Float"},{"uuid":"41DE6DE7-1CED-4777-AB6F-6D45E76B7BC1","type":"f","value":0,"nodeType":"Float"},{"uuid":"761265BF-832C-443C-B355-B05AC19C6606","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FF4E2A23-2E92-4B32-9B94-501CC98C484A","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"C68C3735-D183-4396-B04B-3B1BF8CCACF1","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"D2838303-B47A-46A8-9CA9-B5456265815C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DEA5BBF6-6EA3-401D-B678-BF90F3812E77","type":"i","value":2,"nodeType":"Int"},{"uuid":"6B786FD2-8868-45E1-8E88-2A54C85EA5D1","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"8DE77443-8874-49D6-92F7-921C33721FD0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"61E2EEFD-112B-46A4-A6F1-91EA6F6D17F6","type":"f","value":1,"nodeType":"Float"},{"uuid":"35E1B287-AFE6-4026-890A-7D428A8DBEA4","type":"f","value":2,"nodeType":"Float"},{"uuid":"769845DD-A2A9-46A8-9431-489F0D964E31","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"A7B847FA-21A6-41DA-99B4-2F4DB62B7D4C","type":"f","value":1,"nodeType":"Float"},{"uuid":"A5470ED2-0F86-4896-86A4-D547F1A88FA8","type":"i","value":2,"nodeType":"Int"},{"uuid":"9FEE4170-F1A7-4526-8350-A577F5EE762B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8BB62B0-C077-407B-B398-9691FE474915","type":"i","value":0,"nodeType":"Int"},{"uuid":"EA879A0E-35FC-405C-AE99-06E58D8268FE","type":"f","value":30,"nodeType":"Float"},{"uuid":"E0ACEC6B-0A1D-4710-B5FE-F64161AE4D60","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"38D6E03D-DC5F-47B3-9D20-9BEDA5934F11","type":"f","value":10,"nodeType":"Float"},{"uuid":"754B0446-67FE-4F64-9541-E8E9A3C59D5C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"1199C73D-55A0-454B-BEA2-174966052DB1","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A697082B-F971-4F66-8D61-E9EAF99651F1","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"22BCAE0A-C2CF-4A1A-841F-A0D284CC508A","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"9C2CEA16-FC90-43E2-8010-77F4ADBD42C1","project":false,"nodeType":"Texture"},{"uuid":"9C2CEA16-FC90-43E2-8010-77F4ADBD42C1","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BF81C2EA-F9C3-40D6-9D0C-FF520A556101","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"3A54D54E-19CE-4643-A1B3-BCBCD8FDC713","project":false,"nodeType":"Texture"},{"uuid":"3A54D54E-19CE-4643-A1B3-BCBCD8FDC713","type":"v2","index":0,"nodeType":"UV"},{"uuid":"873685EC-9FB3-4730-B73E-97A7E60F0C64","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"9AFCF48E-05F4-49E9-9513-F68D84308126","type":"f","value":1,"nodeType":"Float"},{"uuid":"1EDF083B-0124-425B-9079-76882C2400C5","type":"i","value":0,"nodeType":"Int"},{"uuid":"3447FDF5-3B9A-46AA-A5A0-288CB52CD9D9","type":"f","value":50,"nodeType":"Float"},{"uuid":"B717158E-478A-4E74-ADE4-3DCDC37606DB","type":"f","value":118,"nodeType":"Float"},{"uuid":"D97760FB-3771-47BB-A76A-F2345767D524","type":"f","value":1,"nodeType":"Float"},{"uuid":"5EF79ABF-A16A-42CA-816D-CDD4D7B6C172","type":"f","value":0,"nodeType":"Float"},{"uuid":"60EA6596-D83C-4888-9A03-28D37025F6E3","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"82789E71-B21C-4ECB-A330-63A8E7EE2D10","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"B4BD1B62-3705-46EE-89CC-A2A84760D962","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"A8D4B19E-021B-4B7D-A509-9D70802D4ECD","type":"f","value":1,"nodeType":"Float"},{"uuid":"B3EEEFE7-06D1-45A9-808A-486E8402F285","type":"i","value":2,"nodeType":"Int"},{"uuid":"7EBA9DDA-9030-46BF-AC79-6CB340C6B72C","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"A682A9CC-9C49-4E2E-9733-91119E53B914","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5A01E9A8-8A89-4379-80BB-6B5145A73A8B","type":"f","value":1,"nodeType":"Float"},{"uuid":"06ECDBD9-FD02-452C-948C-22DF375FFB68","type":"f","value":2,"nodeType":"Float"},{"uuid":"2B76FAA1-3B39-4857-8C22-04D0BF4A75E7","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"78DD188B-786D-4CD0-A9C5-DECE803169DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"4BE553B5-704C-4553-8C4A-4DE0BE7F8D6C","type":"i","value":2,"nodeType":"Int"},{"uuid":"46AD0CA3-B54D-4580-8426-513FCE85F8C8","type":"phong","color":"F8EED3F7-84FA-4DD4-A65C-48107A765BF9","specular":"E0ACEC6B-0A1D-4710-B5FE-F64161AE4D60","shininess":"EA879A0E-35FC-405C-AE99-06E58D8268FE","shadingAlpha":"9FEE4170-F1A7-4526-8350-A577F5EE762B","shadingBlend":"D8BB62B0-C077-407B-B398-9691FE474915","afterColor":"3761E9D1-52B5-470E-B594-E4F0DEDC8184","alpha":"91E1D97F-B807-4201-89E2-323AE86C5A4F","nodeType":"Phong"},{"uuid":"F8EED3F7-84FA-4DD4-A65C-48107A765BF9","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"3761E9D1-52B5-470E-B594-E4F0DEDC8184","type":"v3","a":"858B5402-2DBB-462B-A490-F13BCC5A4476","b":"411E19AC-4D88-47E7-A1DC-173BC6592C3F","alpha":"228D5A95-8CC7-476C-A4C4-D5CB3B9086B9","mode":"4BE553B5-704C-4553-8C4A-4DE0BE7F8D6C","nodeType":"Blend"},{"uuid":"858B5402-2DBB-462B-A490-F13BCC5A4476","type":"v3","a":"29461DEF-C198-489D-9A3A-F77FB95045BF","b":"EB6EA7C6-0D37-4C9D-93E9-2991711592B5","alpha":"B51B7A31-DC82-42DA-8EEF-BE6CD40002DC","mode":"B3EEEFE7-06D1-45A9-808A-486E8402F285","nodeType":"Blend"},{"uuid":"29461DEF-C198-489D-9A3A-F77FB95045BF","type":"v3","a":"DAA77EA6-7D4A-4264-9530-86E93DA3A013","b":"C925914F-FEC6-4616-841D-48FB9AD35920","alpha":"FD22C8A5-4EE9-4922-A566-6AD42C69E860","mode":"1EDF083B-0124-425B-9079-76882C2400C5","nodeType":"Blend"},{"uuid":"DAA77EA6-7D4A-4264-9530-86E93DA3A013","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C925914F-FEC6-4616-841D-48FB9AD35920","type":"v3","thickness":"38D6E03D-DC5F-47B3-9D20-9BEDA5934F11","ior":"754B0446-67FE-4F64-9541-E8E9A3C59D5C","roughness":"1199C73D-55A0-454B-BEA2-174966052DB1","alpha":"9AFCF48E-05F4-49E9-9513-F68D84308126","calpha":"gC925914FFEC64616841D48FB9AD35920_calpha","nodeType":"Transmission"},{"uuid":"FD22C8A5-4EE9-4922-A566-6AD42C69E860","type":"f","src":"gC925914FFEC64616841D48FB9AD35920_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"EB6EA7C6-0D37-4C9D-93E9-2991711592B5","type":"v3","near":"3447FDF5-3B9A-46AA-A5A0-288CB52CD9D9","far":"B717158E-478A-4E74-ADE4-3DCDC37606DB","isVector":"D97760FB-3771-47BB-A76A-F2345767D524","isWorldSpace":"5EF79ABF-A16A-42CA-816D-CDD4D7B6C172","origin":"60EA6596-D83C-4888-9A03-28D37025F6E3","colorA":"82789E71-B21C-4ECB-A330-63A8E7EE2D10","colorB":"B4BD1B62-3705-46EE-89CC-A2A84760D962","alpha":"A8D4B19E-021B-4B7D-A509-9D70802D4ECD","nodeType":"Depth"},{"uuid":"B51B7A31-DC82-42DA-8EEF-BE6CD40002DC","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A8D4B19E-021B-4B7D-A509-9D70802D4ECD"},"nodeType":"Expression"},{"uuid":"411E19AC-4D88-47E7-A1DC-173BC6592C3F","type":"v3","color":"7EBA9DDA-9030-46BF-AC79-6CB340C6B72C","bias":"A682A9CC-9C49-4E2E-9733-91119E53B914","scale":"5A01E9A8-8A89-4379-80BB-6B5145A73A8B","intensity":"06ECDBD9-FD02-452C-948C-22DF375FFB68","factor":"2B76FAA1-3B39-4857-8C22-04D0BF4A75E7","alpha":"78DD188B-786D-4CD0-A9C5-DECE803169DE","mode":"4BE553B5-704C-4553-8C4A-4DE0BE7F8D6C","calpha":"g411E19AC4D8847E7A1DC173BC6592C3F_calpha","nodeType":"Fresnel"},{"uuid":"228D5A95-8CC7-476C-A4C4-D5CB3B9086B9","type":"f","src":"g411E19AC4D8847E7A1DC173BC6592C3F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"91E1D97F-B807-4201-89E2-323AE86C5A4F","type":"f","value":1,"nodeType":"Float"},{"uuid":"E47AC13A-6CFA-4992-BD61-1576FD91E11A","type":"f","value":1,"nodeType":"Float"},{"uuid":"6FB6165B-0106-4841-9492-45700809C3B5","type":"i","value":0,"nodeType":"Int"},{"uuid":"377EBCD9-BA02-4331-9206-31C12E3F8D67","type":"f","value":30,"nodeType":"Float"},{"uuid":"5E4E2689-A6E9-473D-9F76-13C494124DB3","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"FFF94F77-5643-486F-A4CC-E24ABEB75BFA","type":"f","value":10,"nodeType":"Float"},{"uuid":"E4D8C1C2-8A10-4A7D-A1AA-88CEC08CF9D3","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"9CE01F53-BFB9-415F-867F-FDAFD74B6E1B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4085B714-9AB8-4642-8CEF-84D0C5A33071","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9DCF746F-E70C-4A6D-92BE-4B0B64867454","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"EA83AAAA-A74B-422D-BDCB-41396637BBA7","type":"f","value":1,"nodeType":"Float"},{"uuid":"7BFB3823-C131-4565-A1C5-F8B7E858CCA6","type":"i","value":0,"nodeType":"Int"},{"uuid":"669998A2-9A3A-4F49-AE8F-F83C8DCC3B33","type":"f","value":50,"nodeType":"Float"},{"uuid":"12548306-EE2B-47C2-9DE0-D2EB638DD29B","type":"f","value":168,"nodeType":"Float"},{"uuid":"7B2CCD4D-2E84-44C1-8F47-644B2C47341C","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1C8582E-7515-4D88-847F-904470DA88F4","type":"f","value":0,"nodeType":"Float"},{"uuid":"2060DDA0-BA63-4589-914F-65D4C176F98A","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A843F48A-B68E-4C5B-97F3-E41A938ED008","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"FBA727EC-CC64-4D82-8F7F-71A6788A0718","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"7826E882-A77F-4949-9B4A-C48569690D78","type":"f","value":1,"nodeType":"Float"},{"uuid":"4EBFF65A-D81B-48CE-AD27-EB4321EC119D","type":"i","value":2,"nodeType":"Int"},{"uuid":"E573192C-60BA-4081-A17C-B8BC0F7118B5","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"977E1C42-1DE0-40F8-AB10-1AEC901C645C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B767A36B-182E-4D3B-AD90-BC06D7C2F556","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A0326DD-2DDB-4D1D-922A-B3E9F063B30C","type":"f","value":2,"nodeType":"Float"},{"uuid":"C565F207-029C-490A-8945-AEE80C2B3764","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"28102F98-859F-473E-96BE-6FCD947C3EB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"D2A0291D-3354-43BD-8EA6-41A74D020A3C","type":"i","value":2,"nodeType":"Int"},{"uuid":"1F6C658B-AD1E-41E0-A181-66DAB407BCE0","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9B8F957-D7C3-465B-A0B7-0CDC2A72C892","type":"i","value":0,"nodeType":"Int"},{"uuid":"8B90120B-1798-4892-80D8-FAB9E902085F","type":"f","value":30,"nodeType":"Float"},{"uuid":"2FD33471-3580-4B34-8D05-33A37655AD2C","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"698D883A-D083-41FE-8F42-32567A3C459F","type":"f","value":10,"nodeType":"Float"},{"uuid":"A1344A98-49F9-44A2-8CE2-3E5CFE130401","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"6433E6EF-3FBE-46CE-91E6-6768D8CB6B4A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"956948E9-7292-449A-B569-A6C87918156F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"75132D1D-9D2E-4F3C-88A4-BB05AEA8296E","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"98F6A627-656B-44FA-A4F2-D3EF861F84D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"AB20926C-E474-4BC8-A8EF-D2509464D7D2","type":"i","value":0,"nodeType":"Int"},{"uuid":"572EE4A9-3FF9-49DB-B5A0-702876EAB1C8","type":"f","value":50,"nodeType":"Float"},{"uuid":"0EE7F767-43C1-420E-B277-2B90C85F007A","type":"f","value":168,"nodeType":"Float"},{"uuid":"F759BF11-76C3-4BD0-9BEF-3E2C1787DB77","type":"f","value":1,"nodeType":"Float"},{"uuid":"383D6EC7-2A59-4C25-BA43-FA1F42DD1B9B","type":"f","value":0,"nodeType":"Float"},{"uuid":"C85052E0-5A69-41D6-BEA9-79A991744437","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"AF333F46-8650-4032-8414-0956D9C2E708","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"E542712C-0A6A-4A21-9DA2-C042DFD52293","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"8A0F9014-3089-4D1F-9836-6827D20CE751","type":"f","value":1,"nodeType":"Float"},{"uuid":"AC8CE320-FB16-440C-8FF0-FC2B87AD0CE3","type":"i","value":2,"nodeType":"Int"},{"uuid":"14F9C742-3EB9-423E-8E3C-D9E98692A3AD","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"BD4C991A-9C9E-4EF9-9A86-27AE1E4B72D8","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5E043359-AF18-49D9-99A1-6A0D0301C455","type":"f","value":1,"nodeType":"Float"},{"uuid":"C83526BC-B868-40B5-8AB2-112C09FBFC1D","type":"f","value":2,"nodeType":"Float"},{"uuid":"B6E4886A-1B67-43F9-914A-A6FA5AA0EC2E","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"DA710739-ACD7-4BC1-8704-BBDBD6445871","type":"f","value":1,"nodeType":"Float"},{"uuid":"69A6D19F-753F-4C54-9653-EC40DF61CFE4","type":"i","value":2,"nodeType":"Int"},{"uuid":"0F3994BC-9882-4D19-8241-EB24B17A7165","type":"f","value":1,"nodeType":"Float"},{"uuid":"45A2BA62-3813-4B9B-89F0-EFBCD8AEAD4B","type":"i","value":0,"nodeType":"Int"},{"uuid":"50A339BB-FA29-4384-902C-D617CD086AF4","type":"f","value":30,"nodeType":"Float"},{"uuid":"CDB67885-F25D-4588-A8C6-C019DAA4AEFC","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"6CC6F9D3-39A6-4233-9B1E-6F8E7792DE81","type":"f","value":10,"nodeType":"Float"},{"uuid":"DDF44261-563F-4E4B-AB62-945FDB75D4FA","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"133F962C-C647-4B35-9ACD-C1745193805A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"82DFEBEF-EDEC-46C2-9AF2-C5009CD5AB0C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"575ACC27-BD5C-4275-9129-60DBD3593447","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"B1B6A6C4-B16D-4D5B-A68E-00ECD406FBDD","project":false,"nodeType":"Texture"},{"uuid":"B1B6A6C4-B16D-4D5B-A68E-00ECD406FBDD","type":"v2","index":0,"nodeType":"UV"},{"uuid":"3BAA132C-FFE1-430E-B2D2-C63B738E180C","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"C1921857-BB18-4B06-A71D-D9A55F59D60C","project":false,"nodeType":"Texture"},{"uuid":"C1921857-BB18-4B06-A71D-D9A55F59D60C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"06A5472A-FCA5-46D8-8463-4410B2B32811","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"0ABC3804-8B23-49D3-865E-D294D7E78DAB","type":"f","value":1,"nodeType":"Float"},{"uuid":"1C36850B-A5AE-4C55-9907-12F36D9E4390","type":"i","value":0,"nodeType":"Int"},{"uuid":"67B0C4C2-2A21-49D6-8609-F9D7C87BB3E5","type":"f","value":50,"nodeType":"Float"},{"uuid":"B5D15FE9-E1B3-40FD-841A-89363AC94556","type":"f","value":168,"nodeType":"Float"},{"uuid":"0AAE9D65-4E32-4F14-8B17-FFFF9AEFFA52","type":"f","value":1,"nodeType":"Float"},{"uuid":"8CECB5EB-B19D-4B60-81B5-722B3D0504D4","type":"f","value":0,"nodeType":"Float"},{"uuid":"D5FAAA95-4C7B-49E7-903C-A81A7DCAD0C2","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7A5CA8E5-F8DB-40DB-8375-F99FC8BFC8A0","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"CD521158-C290-4299-A7DC-64F512F5BDE5","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"58A561BC-1861-42D5-9ED6-3E66332D2129","type":"f","value":1,"nodeType":"Float"},{"uuid":"AD372098-47E3-4612-8D66-1A8CEA97776B","type":"i","value":2,"nodeType":"Int"},{"uuid":"6FF7F73B-C1AA-4548-A479-3FA13B6E2EF7","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"5F0EE479-E6DB-467D-B47D-339E013F6E62","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2BF98769-4520-4C29-B51D-D8BBF303A468","type":"f","value":1,"nodeType":"Float"},{"uuid":"994DC51F-E3E7-4D86-9628-B3B26E02121F","type":"f","value":2,"nodeType":"Float"},{"uuid":"3EF9D632-C98A-4349-9592-BA70CBA6FA5F","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"1352DE26-B1C0-4921-AA5A-4A726F582D64","type":"f","value":1,"nodeType":"Float"},{"uuid":"596946BB-00F3-4A5F-93FD-0A2D376AF86E","type":"i","value":2,"nodeType":"Int"},{"uuid":"F70CF1FF-B4DD-4AFD-9FF7-F2B240BC206F","type":"phong","color":"CE2135A5-A8DA-411C-B534-D0E2B7979D25","specular":"CDB67885-F25D-4588-A8C6-C019DAA4AEFC","shininess":"50A339BB-FA29-4384-902C-D617CD086AF4","shadingAlpha":"0F3994BC-9882-4D19-8241-EB24B17A7165","shadingBlend":"45A2BA62-3813-4B9B-89F0-EFBCD8AEAD4B","afterColor":"D6687A68-1CD7-49F0-8F3E-8ABF2AD6E95A","alpha":"5AD340C9-C25D-4A9C-B1E7-7B0128029A1C","nodeType":"Phong"},{"uuid":"CE2135A5-A8DA-411C-B534-D0E2B7979D25","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D6687A68-1CD7-49F0-8F3E-8ABF2AD6E95A","type":"v3","a":"7784733E-C038-42B8-A72D-8815763DB316","b":"2F61DADB-CDFC-44D2-95F9-87E2BC3B51EE","alpha":"9AAB0CC1-9235-42E6-B62D-169CEB961E0F","mode":"596946BB-00F3-4A5F-93FD-0A2D376AF86E","nodeType":"Blend"},{"uuid":"7784733E-C038-42B8-A72D-8815763DB316","type":"v3","a":"B6C61104-D22E-4811-A16F-97E42674F9E6","b":"CA5006A9-31C9-4162-B4D1-29118D069835","alpha":"64481AD5-4D3D-4C18-A712-299EA91D4C52","mode":"AD372098-47E3-4612-8D66-1A8CEA97776B","nodeType":"Blend"},{"uuid":"B6C61104-D22E-4811-A16F-97E42674F9E6","type":"v3","a":"F9D8F168-DC5A-4712-B3D8-C4239B5C917C","b":"003F9DBF-76EA-4B2F-AB1E-4DE6D95A0EA5","alpha":"9108EB0B-B0CD-4876-A820-5009E66CC90C","mode":"1C36850B-A5AE-4C55-9907-12F36D9E4390","nodeType":"Blend"},{"uuid":"F9D8F168-DC5A-4712-B3D8-C4239B5C917C","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"003F9DBF-76EA-4B2F-AB1E-4DE6D95A0EA5","type":"v3","thickness":"6CC6F9D3-39A6-4233-9B1E-6F8E7792DE81","ior":"DDF44261-563F-4E4B-AB62-945FDB75D4FA","roughness":"133F962C-C647-4B35-9ACD-C1745193805A","alpha":"0ABC3804-8B23-49D3-865E-D294D7E78DAB","calpha":"g003F9DBF76EA4B2FAB1E4DE6D95A0EA5_calpha","nodeType":"Transmission"},{"uuid":"9108EB0B-B0CD-4876-A820-5009E66CC90C","type":"f","src":"g003F9DBF76EA4B2FAB1E4DE6D95A0EA5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CA5006A9-31C9-4162-B4D1-29118D069835","type":"v3","near":"67B0C4C2-2A21-49D6-8609-F9D7C87BB3E5","far":"B5D15FE9-E1B3-40FD-841A-89363AC94556","isVector":"0AAE9D65-4E32-4F14-8B17-FFFF9AEFFA52","isWorldSpace":"8CECB5EB-B19D-4B60-81B5-722B3D0504D4","origin":"D5FAAA95-4C7B-49E7-903C-A81A7DCAD0C2","colorA":"7A5CA8E5-F8DB-40DB-8375-F99FC8BFC8A0","colorB":"CD521158-C290-4299-A7DC-64F512F5BDE5","alpha":"58A561BC-1861-42D5-9ED6-3E66332D2129","nodeType":"Depth"},{"uuid":"64481AD5-4D3D-4C18-A712-299EA91D4C52","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"58A561BC-1861-42D5-9ED6-3E66332D2129"},"nodeType":"Expression"},{"uuid":"2F61DADB-CDFC-44D2-95F9-87E2BC3B51EE","type":"v3","color":"6FF7F73B-C1AA-4548-A479-3FA13B6E2EF7","bias":"5F0EE479-E6DB-467D-B47D-339E013F6E62","scale":"2BF98769-4520-4C29-B51D-D8BBF303A468","intensity":"994DC51F-E3E7-4D86-9628-B3B26E02121F","factor":"3EF9D632-C98A-4349-9592-BA70CBA6FA5F","alpha":"1352DE26-B1C0-4921-AA5A-4A726F582D64","mode":"596946BB-00F3-4A5F-93FD-0A2D376AF86E","calpha":"g2F61DADBCDFC44D295F987E2BC3B51EE_calpha","nodeType":"Fresnel"},{"uuid":"9AAB0CC1-9235-42E6-B62D-169CEB961E0F","type":"f","src":"g2F61DADBCDFC44D295F987E2BC3B51EE_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5AD340C9-C25D-4A9C-B1E7-7B0128029A1C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DC0A61A1-CB62-49B6-B210-6F4E3D08C5E7","type":"f","value":1,"nodeType":"Float"},{"uuid":"5B406F84-FBFF-439D-A7D9-05AAA5346365","type":"i","value":0,"nodeType":"Int"},{"uuid":"3A15FC52-10BF-41BF-964D-D1064B1AC49F","type":"f","value":30,"nodeType":"Float"},{"uuid":"F1B033E0-AB23-48A9-8982-220D2CFAE7B2","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"B03E14E7-4CEE-4F73-B395-244D5E97C291","type":"f","value":10,"nodeType":"Float"},{"uuid":"12EC4CD5-0DB8-4742-A52F-E8653C5D09B9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"C5BF113E-0532-4D85-A5C3-2069592AD8C1","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"296ACBBD-ACFC-422A-8F85-A75F235FBEE7","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"31E98920-79BA-42FA-A523-6948DFCE5CC2","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"44190E28-4E3F-454D-91BA-1E6C5DC1E68F","type":"f","value":1,"nodeType":"Float"},{"uuid":"A84C45B7-9488-4C72-AC4F-5413226CCC70","type":"i","value":0,"nodeType":"Int"},{"uuid":"8B7A4226-55F8-427C-B42B-A6A0AB017809","type":"f","value":50,"nodeType":"Float"},{"uuid":"26AAACBA-891D-4376-842A-02AEAA89C00D","type":"f","value":168,"nodeType":"Float"},{"uuid":"1F5CF9EA-0A6B-401C-9D99-663819A51FA9","type":"f","value":1,"nodeType":"Float"},{"uuid":"811421D0-4346-4F58-91BD-58402222D109","type":"f","value":0,"nodeType":"Float"},{"uuid":"F93C5035-9330-4976-A69D-9FD0E06859D6","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"6359CBB4-772A-4D5E-A9AC-2BFF2FCCE4B9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"B8FEB41A-2F92-4CB4-9C0C-E5E0A77C9E07","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"BCD20AB9-C66D-495D-852A-C9E75EFE5A95","type":"f","value":1,"nodeType":"Float"},{"uuid":"523CC25B-B082-4296-A32F-F27CF9781197","type":"i","value":2,"nodeType":"Int"},{"uuid":"2349F279-BC68-4CB0-8891-C00D0FB56F3A","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6D187E01-92BC-4472-9C22-BE7D53A91DA5","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"5B119376-7301-4369-9833-85F39745CE51","type":"f","value":1,"nodeType":"Float"},{"uuid":"7C66DF9C-C643-422E-AC88-56E4811FE60A","type":"f","value":2,"nodeType":"Float"},{"uuid":"A23BE53F-9E18-477A-A867-12B16CEEE7FD","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"DFF0FA3C-93C8-4488-8941-B510CCC1DD7E","type":"f","value":1,"nodeType":"Float"},{"uuid":"51C375C7-6148-4388-85DD-BDEC2FFB2BFC","type":"i","value":2,"nodeType":"Int"},{"uuid":"53FC7D39-8925-4301-9112-58109BAE285C","type":"f","value":1,"nodeType":"Float"},{"uuid":"13309F45-B9DF-4FC5-820F-486105B63EA7","type":"i","value":0,"nodeType":"Int"},{"uuid":"46A3F77E-B4E8-4220-9866-4732D2F7B9FB","type":"f","value":30,"nodeType":"Float"},{"uuid":"3A0BB354-38DA-4AB3-A9D0-45B22EAF0A96","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"DD4EA74A-CDCD-423A-A3D6-7C01F491CDC1","type":"f","value":10,"nodeType":"Float"},{"uuid":"0530B3C3-D679-44E9-902F-C6E2834535C9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"EA8522DE-C7C3-41F3-A33F-C19C58966243","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0598C0DC-15BF-4A15-BB0A-98972BB13417","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"551084AB-9890-49F0-9818-8077F2DA24FE","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"3B68A297-C03E-4E09-B8FE-C8C20B13904E","type":"f","value":1,"nodeType":"Float"},{"uuid":"395BF310-E70B-4CAA-83FB-AD78197E9DDF","type":"i","value":0,"nodeType":"Int"},{"uuid":"9DE405E8-E2F4-4546-BDBB-0C508F87D8DE","type":"f","value":50,"nodeType":"Float"},{"uuid":"C0587BEE-ED02-4046-B8E0-9F94C52B4530","type":"f","value":168,"nodeType":"Float"},{"uuid":"AE457173-15A0-4148-893D-459E29ABBC42","type":"f","value":1,"nodeType":"Float"},{"uuid":"B1F62984-1AEF-404B-AAEB-E71A38984C4D","type":"f","value":0,"nodeType":"Float"},{"uuid":"A3BFBE85-F1B6-4CB0-8CFD-40F3EF5558BB","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"0DC0E14E-D1A8-409C-AAAB-C86710C1CE73","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"9574145F-E5B9-4CDF-92D8-4589495CA573","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"59856B2E-4E4C-476B-BB9D-32FB01943491","type":"f","value":1,"nodeType":"Float"},{"uuid":"7083D5D2-0659-41C0-9E73-E7DD5D827E32","type":"i","value":2,"nodeType":"Int"},{"uuid":"B95070B3-BD3B-405F-99B7-2220771113C4","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"5BCF8249-A105-465D-8729-BC9094AB8007","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F19410EE-5CC0-4DC7-A368-D3389E7CA4B0","type":"f","value":1,"nodeType":"Float"},{"uuid":"B076BDD0-2EDC-4877-95E2-53CC58AD9B17","type":"f","value":2,"nodeType":"Float"},{"uuid":"9AD9B416-F18E-4D78-A118-607EFDA86079","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"3AB3849A-6945-4357-9CBC-13C32F9E538C","type":"f","value":1,"nodeType":"Float"},{"uuid":"22DCCF5E-B036-488A-9F6A-3D842757ED9A","type":"i","value":2,"nodeType":"Int"},{"uuid":"4440195B-45F0-4136-B442-AF778B774084","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BF9EB7D-6E0A-42CE-B111-816B34B36E3F","type":"i","value":0,"nodeType":"Int"},{"uuid":"AED9406A-D759-4D86-9FD5-CB43DD98FEAA","type":"f","value":30,"nodeType":"Float"},{"uuid":"F8B35015-DDA3-4E51-B4F4-935EC0BBAAEF","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"55B9E71B-0C67-4272-BA74-F07440054FA6","type":"f","value":10,"nodeType":"Float"},{"uuid":"67B0E6E6-106F-42C8-875F-FCEAFA36625F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"109FD23D-E31F-4490-8AA2-F0E83F7F70D8","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C32FA4D2-C4B2-4968-BDFA-75A51505E146","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"85030321-C3A9-4085-B749-BD7D97361827","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"12817CD3-B2AB-4E2D-B315-8507A8EAC67E","project":false,"nodeType":"Texture"},{"uuid":"12817CD3-B2AB-4E2D-B315-8507A8EAC67E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"33664B63-5E1A-4632-80C0-B2516FC177DB","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"2B4B0F1F-82BC-4485-81CF-265AD21FAE36","project":false,"nodeType":"Texture"},{"uuid":"2B4B0F1F-82BC-4485-81CF-265AD21FAE36","type":"v2","index":0,"nodeType":"UV"},{"uuid":"1B55A3E2-5F46-42FB-80B7-EBF9ECA3EDF4","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"11B9D285-0ADD-4BF4-B311-AFE8F3563E66","type":"f","value":1,"nodeType":"Float"},{"uuid":"1C84A60F-D312-4014-A2FD-1B8AA95406CB","type":"i","value":0,"nodeType":"Int"},{"uuid":"53399336-C070-4CFB-B628-0FF6CC4705EB","type":"f","value":50,"nodeType":"Float"},{"uuid":"18567C11-F773-4001-B3A3-D1CADF6A14BB","type":"f","value":168,"nodeType":"Float"},{"uuid":"E28B4A80-8BEB-49FD-ABFC-DD28ED088CA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"553655A1-9074-484B-A35B-125BCA6109F5","type":"f","value":0,"nodeType":"Float"},{"uuid":"08CD572A-A605-4F0C-9526-21BBBEF93577","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"9EA35503-F6D2-4D0F-B5F4-E036000B5DB9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"88CA35CB-1AA1-4DFF-8B90-6C312625AF5D","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"A723CEB8-DFE7-460A-9DAA-16DD6BA4EAE1","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A4C9209-B945-4934-9CEA-5233D400626D","type":"i","value":2,"nodeType":"Int"},{"uuid":"CB837AF7-974B-4734-AFA3-655423785F71","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"AEAFA3F2-CB36-4BE5-8745-1F93D739419D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BB8F65D0-4E57-4FEA-85F7-C1F911F2891B","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB0E6084-EE11-4668-8CA5-5D6AAB4EE654","type":"f","value":2,"nodeType":"Float"},{"uuid":"31707326-8461-4FB0-B4B9-CD4CB04052A4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"2FD89FF0-8BCC-4E11-9E63-3710100ECD58","type":"f","value":1,"nodeType":"Float"},{"uuid":"91366E00-2E8B-4BCF-8188-30CEBB7314DF","type":"i","value":2,"nodeType":"Int"},{"uuid":"DF38B24E-BA24-4C54-813E-193A7E76E851","type":"phong","color":"BAD00BDB-E739-4D26-A107-9D0D2C24733D","specular":"F8B35015-DDA3-4E51-B4F4-935EC0BBAAEF","shininess":"AED9406A-D759-4D86-9FD5-CB43DD98FEAA","shadingAlpha":"4440195B-45F0-4136-B442-AF778B774084","shadingBlend":"1BF9EB7D-6E0A-42CE-B111-816B34B36E3F","afterColor":"FF27F93D-B3F1-461F-9188-1C4BABCF1F81","alpha":"5D525231-91A2-46AA-8AF2-B3BE071A4217","nodeType":"Phong"},{"uuid":"BAD00BDB-E739-4D26-A107-9D0D2C24733D","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"FF27F93D-B3F1-461F-9188-1C4BABCF1F81","type":"v3","a":"541E841F-61E4-41B3-ABB3-D539E234C8FB","b":"BBD915CF-558F-49BB-8268-965541A7724E","alpha":"3F9DE7BB-8062-4CB5-A965-5BBA0582FD0D","mode":"91366E00-2E8B-4BCF-8188-30CEBB7314DF","nodeType":"Blend"},{"uuid":"541E841F-61E4-41B3-ABB3-D539E234C8FB","type":"v3","a":"3D518A48-E2E4-49DB-B4D4-69A9DC619F9C","b":"063611F5-E7CE-4E5D-9F92-FCF89237E76C","alpha":"B8267002-C9E3-488B-886F-DF2DF90E43DB","mode":"6A4C9209-B945-4934-9CEA-5233D400626D","nodeType":"Blend"},{"uuid":"3D518A48-E2E4-49DB-B4D4-69A9DC619F9C","type":"v3","a":"9A064376-DB06-4942-8188-3E3428F546E2","b":"A0F659DE-2434-44AA-BFF9-92740B7272D8","alpha":"7D935512-BC31-4314-ABCE-29702B72AF71","mode":"1C84A60F-D312-4014-A2FD-1B8AA95406CB","nodeType":"Blend"},{"uuid":"9A064376-DB06-4942-8188-3E3428F546E2","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A0F659DE-2434-44AA-BFF9-92740B7272D8","type":"v3","thickness":"55B9E71B-0C67-4272-BA74-F07440054FA6","ior":"67B0E6E6-106F-42C8-875F-FCEAFA36625F","roughness":"109FD23D-E31F-4490-8AA2-F0E83F7F70D8","alpha":"11B9D285-0ADD-4BF4-B311-AFE8F3563E66","calpha":"gA0F659DE243444AABFF992740B7272D8_calpha","nodeType":"Transmission"},{"uuid":"7D935512-BC31-4314-ABCE-29702B72AF71","type":"f","src":"gA0F659DE243444AABFF992740B7272D8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"063611F5-E7CE-4E5D-9F92-FCF89237E76C","type":"v3","near":"53399336-C070-4CFB-B628-0FF6CC4705EB","far":"18567C11-F773-4001-B3A3-D1CADF6A14BB","isVector":"E28B4A80-8BEB-49FD-ABFC-DD28ED088CA2","isWorldSpace":"553655A1-9074-484B-A35B-125BCA6109F5","origin":"08CD572A-A605-4F0C-9526-21BBBEF93577","colorA":"9EA35503-F6D2-4D0F-B5F4-E036000B5DB9","colorB":"88CA35CB-1AA1-4DFF-8B90-6C312625AF5D","alpha":"A723CEB8-DFE7-460A-9DAA-16DD6BA4EAE1","nodeType":"Depth"},{"uuid":"B8267002-C9E3-488B-886F-DF2DF90E43DB","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A723CEB8-DFE7-460A-9DAA-16DD6BA4EAE1"},"nodeType":"Expression"},{"uuid":"BBD915CF-558F-49BB-8268-965541A7724E","type":"v3","color":"CB837AF7-974B-4734-AFA3-655423785F71","bias":"AEAFA3F2-CB36-4BE5-8745-1F93D739419D","scale":"BB8F65D0-4E57-4FEA-85F7-C1F911F2891B","intensity":"CB0E6084-EE11-4668-8CA5-5D6AAB4EE654","factor":"31707326-8461-4FB0-B4B9-CD4CB04052A4","alpha":"2FD89FF0-8BCC-4E11-9E63-3710100ECD58","mode":"91366E00-2E8B-4BCF-8188-30CEBB7314DF","calpha":"gBBD915CF558F49BB8268965541A7724E_calpha","nodeType":"Fresnel"},{"uuid":"3F9DE7BB-8062-4CB5-A965-5BBA0582FD0D","type":"f","src":"gBBD915CF558F49BB8268965541A7724E_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5D525231-91A2-46AA-8AF2-B3BE071A4217","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1280,942],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/mode_light/index.html b/site/spline/design/mode_light/index.html deleted file mode 100644 index 2401b868e..000000000 --- a/site/spline/design/mode_light/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - - diff --git a/site/spline/design/mode_light/runtime.js b/site/spline/design/mode_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/mode_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWw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LOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/mode_light/scene.json b/site/spline/design/mode_light/scene.json deleted file mode 100644 index 2e49b510b..000000000 --- a/site/spline/design/mode_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"67F8D276-3D18-496C-921F-5DB3B8803A83","objectType":"EmptyObject","name":"Empty Object","matrix":[0.9961946980917455,-0.08189960831908931,0.02980901962620921,0,0.08715574274765807,0.9361168066628581,-0.3407186534216104,0,0,0.34202014332566905,0.9396926207859073,0,34.522355355824786,2.1240479310930604,-19.792513368034697,1],"layers":1,"children":[{"uuid":"18E7565A-CFED-4765-BE1E-54206DF02272","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,0.9999999999999999,-2.220446049250313e-16,0,0,2.220446049250313e-16,0.9999999999999999,0,-54.77215097629973,120.46812647189498,-35.79251336803469,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-37.62507774150423,-2.1240479310929743,19.79251336803467,1],"interaction":{"uuid":"DCAE3C3C-6C08-4978-98C6-0428FEB569AF"},"geometry":"5E325399-FB4E-4A1E-99B9-C24ADB4371BA","material":"4BF376DE-724C-4480-9DFB-7DF1B1606028"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"F77390CB-258F-4BDB-A31F-39C22D5AD30E","selectedState":1,"states":["C2126691-6153-4287-8203-07B7BE69A8EF","92C76C91-C572-439B-805D-6BE41924A872"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"67F8D276-3D18-496C-921F-5DB3B8803A83","state":"92C76C91-C572-439B-805D-6BE41924A872"}]}]},"enableHelper":true},{"uuid":"48C98966-C341-457B-A325-6AAF364439CF","objectType":"CombinedCamera","name":"Camera","matrix":[0.9388103300153909,-1.3877787807814457e-17,-0.3444345572912115,0,-0.16237037618502853,0.8819134276109325,-0.442565890164469,0,0.3037614610083464,0.4714113980373582,0.827949436020424,0,-129.1867267408416,471.41139803735894,986.7912303741133,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":15000804,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"3402377A-D443-455F-A96A-C9713772EE32"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000001,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.7350918906249999,"nearOrtho":50,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","objectType":"Mesh3D","name":"Cube copy 11","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,123.2332767836149,54.059594317155856,-77.05647762613687,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D39BB98C-D635-4862-947B-5F248815B382","selectedState":0,"states":["FDA5FA53-EEA4-4EBB-9AD2-47C50DD19BF9","7603BBA4-0FEC-4C3A-8039-BE7E8AF37981"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"A255E2B3-07A4-48BE-9A7A-DB60B7CBB605","state":"7603BBA4-0FEC-4C3A-8039-BE7E8AF37981"}]}]},"geometry":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","material":"7D853783-86FE-4605-A695-4A55D46B88BA"},{"uuid":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","objectType":"Mesh3D","name":"Cube copy 10","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-444.36428618166275,-124.22591305881565,186.43581367365115,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"interaction":{"uuid":"4E317D27-3986-451E-AA1F-478CDB6D387F","selectedState":0,"states":["B72A6BC8-8701-4997-B8AD-2EC36F1356EC","69D68840-C232-4B4C-88A0-02688BC6C662"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6FFAAD76-B638-42DE-9A26-3AA5BC1E5F25","state":"69D68840-C232-4B4C-88A0-02688BC6C662"}]}]},"geometry":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","material":"2DE692AB-9A48-4A66-955C-3EC6DDAB614E"},{"uuid":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","objectType":"Mesh3D","name":"Cube copy 9","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-7.8879806217634325,-12.538128902116185,138.06153221290793,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"interaction":{"uuid":"87E66C6B-1573-4DB3-BEF3-C467BD8FEA0A","selectedState":0,"states":["3B418A74-2EF9-4F23-A5CC-962566D50AB5","100B2EEF-4D8A-422E-9ECF-744E8B7C9725"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"282E92DB-E85C-48FD-BAA4-407BAAE5ED53","state":"100B2EEF-4D8A-422E-9ECF-744E8B7C9725"}]}]},"geometry":"53F4C327-4868-48DA-8FC8-4FD577D63D34","material":"D26D46E7-B457-40DF-B8DA-300446AE89F8"},{"uuid":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","objectType":"Mesh3D","name":"Cube copy 8","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-39.93883535642771,17.162956902988817,-63.62719986286736,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"CEC9AA49-9F05-4D97-8ABD-993B7453E916","selectedState":0,"states":["FB5D512A-A8F2-423F-B59B-95AEB5936F4A","12E65104-9142-43EF-9ADC-50C614076EA3"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"7882D4B6-0888-4A96-BF48-4AA070F0A80E","state":"12E65104-9142-43EF-9ADC-50C614076EA3"}]}]},"geometry":"411BA438-FCED-4380-B716-7FE4330791FE","material":"4E76320D-06C7-434C-8805-AE85B9F54815"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,0,6.123233995736766e-14,1000,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"48C98966-C341-457B-A325-6AAF364439CF","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"5E325399-FB4E-4A1E-99B9-C24ADB4371BA","userData":{"parameters":{"width":118,"subdivisions":40,"roundness":20,"extrudeDepth":32,"surfaceMaxCount":1357,"extrudeBevelSize":8,"extrudeBevelSegments":3,"height":118,"depth":32},"shape":{"points":[0,0,0,0,0,0,20,79.78793586229436,-117.24272612867404,79.78793586229436,-22.56272118097305,79.78793586229436,-208.64174080591005,20,0,-238.24998696717296,0,-238.24998696717296,0,-238.24998696717296,20,131.3880929756492,-208.87420293651823,75.16581190658474,-262.397154350599,193.36772782193438,-149.87031832953974,20,131.3880929756492,-28.549748065144385,173.81211915771698,-65.21622783678866,65.7682875663515,28.164512324320064,20],"shapeHoles":[],"isClosed":true,"roundness":20},"type":"VectorGeometry"}},{"uuid":"DCD9EE92-F55E-47A1-8334-D972A43CAF81","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"8C29065D-8FE2-4402-876C-3B1C93BB87D4","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"53F4C327-4868-48DA-8FC8-4FD577D63D34","userData":{"parameters":{"width":160,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"411BA438-FCED-4380-B716-7FE4330791FE","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}}],"materials":[{"uuid":"4BF376DE-724C-4480-9DFB-7DF1B1606028","type":"ShaderMaterial","emissiveIntensity":{"uuid":"46941BC9-D779-488F-86DB-1BC5CCD4A72C","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"D1D15F03-D40D-4254-963E-4E7CB30140F2","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"9528FF2C-09C7-4BFA-8C50-A8906E49B7DD","f0_alpha":"26BFC0DE-B6FA-4E58-A370-63D426010C1F","f0_mode":"2AA63172-3ACA-4E55-87EF-7AC32FEF8101"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"26711080-4484-4084-97FD-B4C8A58BBB9E","f1_mode":"FDB528A9-95E1-4DFC-88DA-154E3B1FD1C0","f1_emissive":"2AC55BA1-98F2-4C1A-8E6B-021C6270F937"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"7A7CD816-3528-4C3B-857B-B8AF6F9BFF23","f2_bias":"F3BE01F6-3234-4ACC-83C0-7B58EBD26CE2","f2_scale":"BE68D1E5-3572-441D-82F5-03593C1390DA","f2_intensity":"60E02BB3-4161-4DC8-BD87-91C46ACB71B9","f2_factor":"C569F29E-B11E-4B7F-AD3F-03376BBA9E7D","f2_alpha":"4555D0E9-13A9-431D-8196-40D58696658B","f2_mode":"D6FDB3B5-80D1-44FE-9204-F5029BF59732"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"B6886E4F-4BDB-4364-9ADA-BA2675BACB78","fragment":"B6886E4F-4BDB-4364-9ADA-BA2675BACB78"},{"uuid":"7D853783-86FE-4605-A695-4A55D46B88BA","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4BCD0CD8-FA3D-4FDB-B80D-0FFFD56BCCCF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","f1_mode":"97EF242E-3A72-4EB1-9450-30B50662F407","f1_shininess":"F4295F34-7939-4B9E-9120-5DC2F3082D25","f1_specular":"7C84C4D9-A831-4328-9C28-CA9F8E5CD0F0"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"644B92DD-FEC1-41D2-AA62-FE7A60CFB518","f2_ior":"B7D8F639-61BE-4F11-AAC3-CFFD9C4E28A2","f2_roughness":"0A248B5A-B6C5-4C23-A889-C28D348FB834","f2_transmissionSamplerSize":"221006A8-D995-4270-9186-5EB1B6A0609A","f2_transmissionSamplerMap":"F589906D-D705-466D-A4EB-CEF2D44A9EF5","f2_transmissionDepthMap":"FDBB5D1C-2870-49D1-97D2-C0E1CCACB956","f2_aspectRatio":"240907EA-20BB-4AA1-8B21-ECCD5873CCC0","f2_alpha":"6E4E163A-5099-4C52-99F2-546512D188BE","f2_mode":"6B7EAA42-ABC3-4C47-B5FA-543F475709DC"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"67E18630-8ED3-4D73-A3BE-995270C98699","f4_far":"3EEC73D4-9854-4001-BEE4-80AADC298945","f4_isVector":"AF88F9B8-D1E9-4115-8DBB-AC2B5F94FA11","f4_isWorldSpace":"FBAAA647-35E7-4CCD-A656-C2D9E12FC5E5","f4_origin":"2107ED6A-131D-49A3-A1DC-D6F8B609B480","f4_colorA":"159E4E73-0B3F-4B75-9FB4-672937D1A1C0","f4_colorB":"81A430A9-0E42-406E-ACBE-EFF11FD01690","f4_alpha":"C6F6B002-3558-4389-8C49-0B2DF0B618DC","f4_mode":"FB06E98C-FA58-432D-AD0B-6D36E5B1A5E8"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"589A7912-6949-4203-9454-3E1BB71CC843","f3_bias":"3B57FEC6-B0B5-485D-A8E6-79CF13DFE51B","f3_scale":"605850E4-5999-4B53-8BE3-BA720BABA9A7","f3_intensity":"B4E64B8F-2A5A-403D-9B94-39DF6219EA53","f3_factor":"286E8498-C12A-48AA-9BEC-F47C797EA5EB","f3_alpha":"3158B987-2497-45AD-B8A1-A6F692967C12","f3_mode":"24F19F76-B5A4-433E-B136-BA71CA46EE2A"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"82FCED54-F37F-4E88-BA64-B2E125F4D07B","fragment":"82FCED54-F37F-4E88-BA64-B2E125F4D07B"},{"uuid":"2DE692AB-9A48-4A66-955C-3EC6DDAB614E","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4BCD0CD8-FA3D-4FDB-B80D-0FFFD56BCCCF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","f1_mode":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","f1_shininess":"1E51144E-D8E0-486D-9B6E-D50E7121A3DA","f1_specular":"29D84BC1-9F8B-4CCB-A579-D9B9F50E0409"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B97B676C-B8C0-4F39-9B56-637BAE6C6F15","f2_ior":"B1000437-0922-4226-846E-D21350A6561D","f2_roughness":"3A6BED93-56B7-4F25-B67D-314D892D94AD","f2_transmissionSamplerSize":"304D2278-1EE2-47DA-9785-3A6E509EBC9C","f2_transmissionSamplerMap":"6D02CEC5-049E-425B-9FCE-1C914215426B","f2_transmissionDepthMap":"DCC62030-FF02-4AEA-BCEF-AD249937CC02","f2_aspectRatio":"3D93DA05-E5AA-46BA-99C5-24337A7449B4","f2_alpha":"5D9E27A8-016A-4C1C-B746-9DE817BE35F8","f2_mode":"79931641-B24B-411D-98E5-74D0DA84D0A0"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"16082D61-98CC-423B-8594-4778CAE08326","f4_far":"B07AF806-0CAC-4326-A7CC-A814620B6483","f4_isVector":"3EC60D88-167A-4D00-8B63-8B0D2E2BDB9A","f4_isWorldSpace":"D8E3DB7B-D28A-4C88-B7ED-62083EFF7A1F","f4_origin":"1933179A-BC37-475B-9219-0908C1CC3932","f4_colorA":"32D65B23-C86F-47F5-A6BE-D7858ADE9535","f4_colorB":"0ED04730-127E-4739-9B55-6CA7C838D6FA","f4_alpha":"B7BA5606-E181-4C0C-ACF4-383CE5623D43","f4_mode":"1DC6FE71-AEE4-4E65-A23A-F245CF564847"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"38A03602-C62B-446C-8F6D-28C6DC475B44","f3_bias":"80EF1342-EEDC-4B71-8887-93978FABF621","f3_scale":"3933822A-1BDD-4986-AEC4-FCDB0C4FACDB","f3_intensity":"BC398DDE-CF5C-4D6D-8624-2CB07C7CD9E3","f3_factor":"A9C27E07-636C-41D5-83C3-C713BB3B541B","f3_alpha":"9FD597D8-A0D8-4D93-9B03-3AE5F47FED8C","f3_mode":"1A8B33E4-8EC3-40AF-9F36-D804E18BA55A"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"B875D127-D743-45D2-8D31-F232DBC4ED8E","fragment":"B875D127-D743-45D2-8D31-F232DBC4ED8E"},{"uuid":"D26D46E7-B457-40DF-B8DA-300446AE89F8","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E5FA876-21E5-4F39-B865-119366769E99","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","f1_mode":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","f1_shininess":"26EAA259-513A-49ED-A990-0AC161A7FD9D","f1_specular":"30D99DC4-7306-4460-A28C-C3B531B3A64D"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"200BCC68-DA9F-40C8-9095-4048E62679F3","f2_ior":"3AD28BA6-4E77-45F2-9AB5-51B92044CF5B","f2_roughness":"0BD98F64-36E6-4C24-B3EC-365941530EDC","f2_transmissionSamplerSize":"A0D55355-19E1-4F05-879E-CA747F0EF74E","f2_transmissionSamplerMap":"75A92C81-0B49-4B49-91C6-E2E195143FE3","f2_transmissionDepthMap":"B39FBF35-86C5-4565-ACE0-8546E3DC0252","f2_aspectRatio":"A4A44A40-2C15-468F-9E14-4FA0591FF383","f2_alpha":"06ECCB20-EC12-4DD5-96F1-807EEA7B055E","f2_mode":"23AC0410-447F-423A-A289-7EBBB47406DB"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"5A3E49A9-D2BD-46BA-8899-E697096BE2A8","f4_far":"01C0F73F-9ACF-415A-AC9F-58B341D3DC49","f4_isVector":"F7911B01-2576-4E5B-9CDB-37945C2C55E1","f4_isWorldSpace":"A50D4CA6-BFB2-4118-8876-CF9A5DFE6DAD","f4_origin":"A93AA962-1F95-4F40-B4AC-D878A761D0EC","f4_colorA":"C2958E75-B7CA-48C5-9F72-BDE0EEB3B7D2","f4_colorB":"539DFB9B-E86A-4E3D-90F3-074E92CE013A","f4_alpha":"21141165-B5A2-4B05-BB40-233DE992A34D","f4_mode":"CA9836D6-1249-4488-B53D-4D85602DCBBD"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A06A2494-C3A5-48A8-B6D9-A38783DB78ED","f3_bias":"26FD50F9-562B-48BF-B533-86BD877E0446","f3_scale":"37757160-FAF3-49DB-A740-7FA8241B46E1","f3_intensity":"6A1FDEFC-D1D7-4CF4-9C40-CF46E2283CC3","f3_factor":"9F68D3D5-84C2-4D54-A9FA-15F4690DBE15","f3_alpha":"E1A77911-CB22-4062-9068-C15B30676CA1","f3_mode":"C91C5A9E-55A9-4F95-B33A-6132DADF284A"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"045370D6-0EE1-4BAD-87D3-B9DF86841131","fragment":"045370D6-0EE1-4BAD-87D3-B9DF86841131"},{"uuid":"4E76320D-06C7-434C-8805-AE85B9F54815","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E5FA876-21E5-4F39-B865-119366769E99","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E580F990-A83F-4809-ADC2-95CE2B455A52","f1_mode":"13D6E696-B3BE-439D-81DA-300B0D2A1691","f1_shininess":"E22307B5-3535-4FE2-88C5-84B35F489961","f1_specular":"8ECA9995-50CD-495C-8EC9-AD4E5B64103F"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"417B91D0-6EFB-4458-B57E-9493D1EF5123","f2_ior":"3722C9AC-2309-441E-8281-D0135D49C5A2","f2_roughness":"E32213C3-C712-4802-ABCC-819462F429A7","f2_transmissionSamplerSize":"B8AF1EEF-7ABB-4AF5-84F1-C3D8BD0DFEF2","f2_transmissionSamplerMap":"2D1778BD-130F-42C5-B5B6-E0430B5EA083","f2_transmissionDepthMap":"ADD0AC0C-982D-4DAC-A695-9E334E75EB38","f2_aspectRatio":"A8942F68-99AB-4107-9A91-F1E293BF452C","f2_alpha":"3DA698D1-7E36-49C2-B5AF-D2E8CFC987C2","f2_mode":"148227CA-B136-4855-AD24-E5A8FD386B82"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"FFFB9455-821F-4A9E-8E08-CFCC657A9860","f4_far":"A2B7357D-4B21-45BB-8904-FBC354BAC852","f4_isVector":"B947304C-0448-4F1C-9874-AB1C9B1164CE","f4_isWorldSpace":"242467C0-77F1-44B2-A14D-5383A52F8CE3","f4_origin":"D5B92B8A-8A15-43AC-9F99-2696FEE45445","f4_colorA":"21D676C2-DC03-4669-85EF-1868BD5742DE","f4_colorB":"DB354058-22D7-4C17-B466-B77577721C59","f4_alpha":"184DF8A0-515A-4BD0-8247-2AD1D39D95EB","f4_mode":"9B604177-6436-44AE-9317-FA738645091E"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"934C3D5B-EF7F-42DF-9A6A-8889A765A782","f3_bias":"C267B1EA-F53A-4512-B121-5A61AC2A9E25","f3_scale":"6CD932F2-E931-4023-B714-23CD7D3F8750","f3_intensity":"115B4115-485C-4461-94DE-9E7E4D18A439","f3_factor":"C3A2D026-BE3C-4D40-A78E-2B15B23A190C","f3_alpha":"F1ED38E0-BAD1-4B31-A468-33E3209BF642","f3_mode":"4B6AF487-F6AF-413E-BBC6-89E76D3FE86E"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33","fragment":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"C2126691-6153-4287-8203-07B7BE69A8EF","name":"Base State","position":[34.522355355824786,2.1240479310930604,-19.792513368034697],"rotation":[-0.34906585039886645,0,0,"XYZ"],"scale":[1,0.9999999999999991,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"92C76C91-C572-439B-805D-6BE41924A872","name":"State 1","position":[34.522355355824786,2.1240479310930604,-19.792513368034697],"rotation":[-0.3490658503988665,0,-0.08726646259971646,"XYZ"],"scale":[1,0.9999999999999991,0.9999999999999991],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"FDA5FA53-EEA4-4EBB-9AD2-47C50DD19BF9","name":"Base State","position":[123.2332767836149,54.059594317155856,-77.05647762613687],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BCD97BE2-C73C-4578-B2E4-15836BBB024D","f1_mode":"F7EC53B2-2B9B-476A-A363-47098AB0A426","f1_shininess":"4827798B-6E7C-439A-89D9-D4D459D4CC62","f1_specular":"65219004-E5E7-4595-8931-3B75371B787C"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4EFC302E-A468-4F00-B4A1-62946AA52621","f2_ior":"23639224-5F75-42AA-BAD8-5BB334875083","f2_roughness":"C4628252-52C1-4478-A263-DEDBC4EAB1C1","f2_transmissionSamplerSize":"8C7DC0DC-E7C7-40E9-AF7A-5E2293819A02","f2_aspectRatio":"150FC8AB-5CE7-4207-9E72-78C3E6E91D37","f2_alpha":"044F2A76-E7A6-4C35-9148-900B2AE16339","f2_mode":"91A0F2E1-0B1D-455D-8154-089CC5DAD2A3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"FC5E9E41-8941-4926-B244-B47E81553499","f4_far":"D0E9CC0F-E856-43E2-B8F6-3891CAB5AB96","f4_isVector":"AB524852-3570-42DF-A59E-90FE8ABBB5E4","f4_isWorldSpace":"E2318EEB-74A4-4135-AF83-1749ED63AE8A","f4_origin":"1541A248-9A8A-4A8F-96B8-858C573177AF","f4_colorA":"246B48B1-7DFA-4520-831D-9E33E1E2F263","f4_colorB":"84613092-E065-4601-9100-A2DA29285ECE","f4_alpha":"767758AF-3129-48F8-AAD7-C6E22A0C8F0F","f4_mode":"50E8C0C5-B4FD-4810-B498-7A8F2C041A89"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E5747375-6E5D-4C4B-8668-F07D18489D3A","f3_bias":"675B01F3-8882-438D-AB95-C9E8D7910489","f3_scale":"71ADF1D8-FC55-45AF-AFAA-812F0A6FA405","f3_intensity":"E18E205B-1C3E-4050-8F14-524C160B4A97","f3_factor":"56B1B770-B97B-4A3B-9054-AB0332049621","f3_alpha":"F6207B59-BEC3-41A7-82C7-5D7F308DE060","f3_mode":"6AE44235-A3FB-4C87-A8E6-64862F9DBF99"}}]}},{"uuid":"7603BBA4-0FEC-4C3A-8039-BE7E8AF37981","name":"State 1","position":[123.2332767836149,54.059594317155856,-77.05647762613687],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"15B486F4-A1F9-42A4-9652-7A5BC470649D","f1_mode":"1DA255C9-8D77-4892-97C2-8677A8372631","f1_shininess":"8DB19381-87E8-4AF3-8EBA-9D15D2B3930F","f1_specular":"39FCA606-1622-4F02-ABF7-FBD2BCBC908E"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8F994F94-0ABF-489F-AE16-B77C475F2940","f2_ior":"76B30887-4CDA-45E1-AEC9-5FD15E22D51F","f2_roughness":"F40EF9B4-1337-4B22-B865-B70AEE760B5F","f2_transmissionSamplerSize":"79778AE8-9EB1-4278-9C0C-A0FE45C3A324","f2_aspectRatio":"D901C136-ED5D-40E5-B7FA-4FA89F88B102","f2_alpha":"C1150A4A-2684-4F5B-BB66-214C669DABA4","f2_mode":"E09B0018-EA1E-44C9-9652-AB9A8A556D96"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"50329D24-6E31-4805-BC44-9F3F714DD582","f4_far":"897E5AF8-BAAD-41A7-B86E-0C438BA827A2","f4_isVector":"E5CA2D92-1A34-423D-BC48-8F91C5170C44","f4_isWorldSpace":"DB804334-4525-4AD3-9EB9-AC28D59F3311","f4_origin":"7038D901-DB80-4C7D-8F8C-103BBA8E761B","f4_colorA":"4A687505-4AE3-48BB-83EA-8FFC9BB93789","f4_colorB":"500AC45D-2F80-48CC-82D9-6850A8F7B048","f4_alpha":"9C924156-901E-4056-88CB-ACC49F67DD42","f4_mode":"C3FF7E64-C7F4-4245-970D-24ADE310669A"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3AD124AA-DAFC-4E5D-B921-EB6B3890BE2A","f3_bias":"1A8A044C-262E-4375-842B-839BE840569A","f3_scale":"57DA142A-777F-440B-BF4A-0D1E19601C19","f3_intensity":"9B3F00C9-B897-4F0C-9822-5CC90D116E42","f3_factor":"ECBD587D-35B0-4C25-AE1D-DBCFBC88B6B4","f3_alpha":"3BD753E5-B330-4E08-A46D-A07FB78DAEAB","f3_mode":"F1E058AD-13B5-4B8F-8C3F-0EC49D552784"}}]}},{"uuid":"B72A6BC8-8701-4997-B8AD-2EC36F1356EC","name":"Base State","position":[-444.36428618166275,-124.22591305881565,186.43581367365115],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"10243827-CEF9-4B2C-9014-7443F1054896","f1_mode":"EA1EECA0-7161-468F-8E61-EBC8AA6B2892","f1_shininess":"2263B8CB-2738-484A-88F9-44254729C4CC","f1_specular":"B2A30C30-3D5F-4B63-BDCB-E9ACA9A5B81B"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4F575F1F-5CCD-4CAA-BEB5-AF4ABDDE19BF","f2_ior":"5C240FDB-0A78-4F61-B7AE-88E6EE5BA070","f2_roughness":"B8C35C4A-9020-4072-B72B-14E4F6BCCEED","f2_transmissionSamplerSize":"0D4ADB0E-7AD7-425E-A8F5-2884066831D9","f2_aspectRatio":"03BCD85C-02D0-4E84-AECB-DD4FD6F5B720","f2_alpha":"E7E6D61C-F934-4240-9DA5-6BB3A4C3F221","f2_mode":"430A6DB3-DACE-45FF-B0D6-3D14F1539513"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"9AC2DA4A-3028-4841-9F21-A3BB158F1670","f4_far":"8243D00A-15B7-4EF1-A854-E18F869320BD","f4_isVector":"C156DB53-1A14-49E3-99F6-31DC8051FBFF","f4_isWorldSpace":"B23C957A-76C8-4FBE-98E9-AA289C4B3C2E","f4_origin":"05D5A93E-91C3-49D9-962B-504CBD30E3CA","f4_colorA":"9502FECD-155C-420D-9AA7-624DA66AFC13","f4_colorB":"2FFA5A49-B079-4582-ABD5-A73E22FA45AD","f4_alpha":"1BE6A29D-684A-4404-A3D0-728B26120F9C","f4_mode":"00B2FA17-CB31-466D-AD23-FCCC2C0A54B7"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"5A6E3B56-A0BE-48B1-9821-082B27E44D89","f3_bias":"64F36D10-CB01-4B7C-A8A1-1E98D7E20C8F","f3_scale":"74E46E2D-00F1-4A22-BA7D-989224CFB122","f3_intensity":"9967D17C-38D9-42C2-B30D-DF4752D251AC","f3_factor":"39EB9D76-C768-47BE-BB81-1A76493C99ED","f3_alpha":"61B3562B-8A59-4903-9C4E-DE468B0EA200","f3_mode":"FAB3E6BB-6262-4A8A-93DE-8018FE7D146D"}}]}},{"uuid":"69D68840-C232-4B4C-88A0-02688BC6C662","name":"State 1","position":[-444.36428618166275,-124.22591305881565,186.43581367365115],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,387.17919074786647,89.2520785228927,-26.90606602599712,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C2F08D6B-8F65-42C1-A78B-4119B8512D04","f1_mode":"7DBC9423-AE56-4E70-8E93-E2948E5B1C23","f1_shininess":"51D9651F-E4F8-494E-B246-DD0835D5E566","f1_specular":"462C6FBE-FD4E-4FA7-8EB3-32DED071D391"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"E904463B-BDEE-4CF5-AA76-F39BE4FD5C9C","f2_ior":"F6510DFC-A9FC-4D34-8803-EE0CBEC588E7","f2_roughness":"51288AC3-71B0-4D1C-AD3E-59A8108062BC","f2_transmissionSamplerSize":"0F8AC313-3774-4DB4-AF20-9ADF32C750F2","f2_aspectRatio":"4444B40F-E087-4A0D-B13F-48BBFAD842CB","f2_alpha":"D8AD819C-37DB-44CB-BCED-23A930686A7A","f2_mode":"BE632A0C-8DF7-4DB0-B2AD-EE05012444B4"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"51B4BF98-F4F3-49D6-83AC-342C11176472","f4_far":"615722EF-15C8-4296-92CF-759020E10996","f4_isVector":"55E2CA2C-D0EF-4852-A3A7-94EC7A0DE103","f4_isWorldSpace":"744A0ED5-5DFB-4579-B20A-48D583EDA36E","f4_origin":"994682F6-4E55-473F-B2DF-DF1013B3C8A5","f4_colorA":"D227475C-A236-4EA8-8BBF-5B72EEBD1B2D","f4_colorB":"8A45109A-18AB-4C3B-A743-BD52A581CFBA","f4_alpha":"9773E723-D7A3-4372-86AD-39925416F775","f4_mode":"55857E83-333C-44EC-9455-DA8575CB1ED2"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"753C156D-6637-410C-A0E3-EAF13A5C02E0","f3_bias":"C167DAF0-95F3-40DB-8E36-2A0CF996C2AA","f3_scale":"FD54C4D9-AFC2-4124-86F4-F6FED04FDF32","f3_intensity":"2E4FA95B-C14F-4B88-9FA4-B2C391A53283","f3_factor":"B767C09C-0551-4B9C-B263-A8992ADFC890","f3_alpha":"50BA5C21-FF29-4E4E-9536-C105AEED439C","f3_mode":"938878D0-3F1F-41D3-8865-0CC7CDE9F4F3"}}]}},{"uuid":"3B418A74-2EF9-4F23-A5CC-962566D50AB5","name":"Base State","position":[-7.8879806217634325,-12.538128902116185,138.06153221290793],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"840FEE52-3254-43FE-A37D-0D7DC7CE60E7","f1_mode":"2EA83C8D-A28C-433B-9220-4D9F4026DD84","f1_shininess":"F0D6E663-6D91-4E51-B6E0-9669B7625164","f1_specular":"B224EA54-7065-4488-8F43-EB3BD9CFC65F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F5FE2E1F-99A9-448C-BB07-964E30B2F8DA","f2_ior":"7C2FEE2A-1A9E-4BFD-A6BC-80E485D0075A","f2_roughness":"FFAF3C70-7C94-49A9-9062-66F11C487856","f2_transmissionSamplerSize":"05A253A4-1727-4C79-B536-46A7F07409A6","f2_aspectRatio":"FA5988FC-0D47-4BDD-B5EE-B61B3C2C8CD8","f2_alpha":"D1582FAA-F81E-450E-8E06-E0C394942187","f2_mode":"D8FCAB28-2086-4ABF-855F-3515D735B541"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4D5185F3-C910-4DD6-ACCA-44335E8C16CA","f4_far":"036C4EFB-BC35-43EF-BDDF-AAEBA4A1AFD6","f4_isVector":"3CEA4A23-C977-4710-BB2F-BAEDD0F63995","f4_isWorldSpace":"6FE24B4F-E1F7-492A-BBC1-6A98D984CADF","f4_origin":"E30AB035-7F7E-45D5-A62F-B173DD1E1AC9","f4_colorA":"FE7F3145-558E-42A7-988F-BC6E6EB21CFE","f4_colorB":"497D0334-0C13-444C-B932-8064ECB77EDE","f4_alpha":"8C8B817C-834D-4660-81BC-AD7C5C4500B2","f4_mode":"5E21DD61-6491-4361-9326-E929343B3ED2"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8177D53A-595A-4BC5-8617-787C0A5029BC","f3_bias":"624B0771-CE81-492A-9D83-78D4EDCED988","f3_scale":"FEE4D63B-B7D7-49F8-8E07-11241E8618D3","f3_intensity":"FE9F4F08-0C08-45DD-B287-D00CA37ECA80","f3_factor":"D61CA7E7-FE36-4B18-AF49-4228F50A834A","f3_alpha":"BE68A43D-3996-4B6A-87A6-9713B79C0E22","f3_mode":"B12CA968-743D-4DF0-B076-3C802E21E3E7"}}]}},{"uuid":"100B2EEF-4D8A-422E-9ECF-744E8B7C9725","name":"State 1","position":[-7.8879806217634325,-12.538128902116185,138.06153221290793],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,168.1162697532913,16.43016383461969,26.1939954957827,1],"geometry":{"width":160,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"A595BAB8-784A-4DA1-99D9-F8951B6C423A","f1_mode":"C635374C-890A-4A33-8807-EEFB65BB6A7A","f1_shininess":"B6D224DA-CA2F-4145-9852-83D39161595E","f1_specular":"841249CF-E802-44E5-A9CB-79FF76962821"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DB03E633-33CE-410B-BC63-E7C6B10A8D94","f2_ior":"6605CAE1-FBE2-4908-A6BE-91FA245F0360","f2_roughness":"D4444CF0-B073-4448-B2A3-F321353E1672","f2_transmissionSamplerSize":"AF9BA58B-0500-4DFA-BD34-E56F41B5B435","f2_aspectRatio":"6370876B-829B-439F-B7E6-F7C80628FC54","f2_alpha":"24171A0E-66ED-40E9-9E85-9D68CD4444E7","f2_mode":"12F2A011-8854-4054-B20F-B3DC9EB7BC47"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"630E47A9-3AD7-4873-98C7-8B766E7D9EB2","f4_far":"2E0F6353-03B1-4D60-A053-EEE365B2CBB0","f4_isVector":"798533EE-05E2-425C-BF4F-C00D2E2770C6","f4_isWorldSpace":"A2F4249A-9798-4817-A690-619E77356F32","f4_origin":"FB006ED2-EEA0-4C97-BC2D-89BB122796A5","f4_colorA":"77201A22-54B0-49AD-AE51-2918D19A34DC","f4_colorB":"5F2C12F4-91E4-4A61-8D44-5EF27853002F","f4_alpha":"D10B9F35-1906-4216-97F5-8CAFCB38CBDF","f4_mode":"CB9CDC15-EF2E-42B2-AC58-2FD1855131A0"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E387CC80-01B8-4721-BCCD-661FDEA335D1","f3_bias":"AD39F318-8DC5-410F-BE32-7E686C09ACD1","f3_scale":"043DFD3B-F7E2-4591-AFF1-6E72D00BAC0B","f3_intensity":"15B5DCF2-919E-4DB0-8420-8060F0C0E5A8","f3_factor":"6B2B677E-936C-489C-8594-08A0F822F740","f3_alpha":"5DC0EECF-A6F9-425C-9079-FC5B31647E1F","f3_mode":"F00AB0EC-7600-4648-8B60-5DA1EDF39A1F"}}]}},{"uuid":"FB5D512A-A8F2-423F-B59B-95AEB5936F4A","name":"Base State","position":[-39.93883535642771,17.162956902988817,-63.62719986286736],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"23AF1275-2A5C-472A-8A35-E0BA55149FBB","f1_mode":"355CDA1B-E1CA-45D1-8F86-D0E2F3FA694A","f1_shininess":"A636C7FB-BEAC-46EE-A695-3AC629C92BBD","f1_specular":"FFF3E784-1F6A-4A36-82F1-BD53FB2A2518"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"DF55D1BB-5CDF-420D-85BF-A1143FAD23B9","f2_ior":"FEE42FD2-31E2-4873-ABBC-D9B7AAB19311","f2_roughness":"8026BAE6-0B7C-48F1-B160-482F5CC78D70","f2_transmissionSamplerSize":"8801479B-B3AB-4232-A4D9-053BAF322D51","f2_aspectRatio":"E4FE5718-1B88-4044-A0EC-7E6C22FAEC39","f2_alpha":"1CBCC15B-AAC5-47B7-86AD-F54FB48615A2","f2_mode":"B1575335-5942-49BB-8586-BAAD8E9C8E51"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E381E00D-CD83-46BB-9B84-E6F84A784166","f4_far":"EC7872E8-69FC-40BB-9306-5B59046A99E0","f4_isVector":"F6A5EE42-3208-4ABB-8815-BF1D370FB8FE","f4_isWorldSpace":"5E5187A8-7911-45EA-BEA6-183DEA3212A2","f4_origin":"9B5AE5D2-15DB-45FB-8928-CD6D364F070D","f4_colorA":"4882A344-B754-4712-BED7-7AA96C26DD8D","f4_colorB":"56ADD38F-760E-4139-A4C4-43E48B70BD98","f4_alpha":"A89168A8-C33C-4152-9824-3BB6E0BA4594","f4_mode":"E5C49550-AF21-4A13-B416-C719B3A186D0"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6223E778-EFEF-435F-B667-C29C69657376","f3_bias":"DDF97204-F5D5-4389-96C0-10C69B04B102","f3_scale":"D4CDE62E-F880-4250-8E42-5C196AE03A7C","f3_intensity":"09F87260-97F0-4857-BF5E-1048A72C964B","f3_factor":"0217F182-3A1A-4BD4-B520-940CB0B92D00","f3_alpha":"8517F9CF-2CF7-4559-B25B-D16FB5B183ED","f3_mode":"F87EC7FE-2F4E-4604-AAA6-DBAF13E890A2"}}]}},{"uuid":"12E65104-9142-43EF-9ADC-50C614076EA3","name":"State 1","position":[-39.93883535642771,17.162956902988817,-63.62719986286736],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"625745D4-6EC7-4DC0-AE3E-3E63FD2FCF5D","f1_mode":"B05725E6-75F1-4501-8FB9-764F7CEBC00A","f1_shininess":"438C0A3C-6FF3-458E-BFC7-636DD110948A","f1_specular":"A67FA534-0DC9-4639-BC90-CC73AE137B9D"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"32923DF7-43EF-49C8-8459-E7BDE46DDE87","f2_ior":"ED8969CD-8D69-4B8D-A9AB-C1F528B5CBEC","f2_roughness":"89BB18DC-44DC-4212-8C91-FE486E78476D","f2_transmissionSamplerSize":"6DF40A13-2B32-4D68-992D-09D6296A67AB","f2_aspectRatio":"0D9339FA-3F8E-404E-9678-E49F77CA4EED","f2_alpha":"9D694CBC-D262-4B38-9F32-20F4CE2050AB","f2_mode":"CFBB80B8-C6A4-4970-88BB-5B0CC8291098"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"BD45FE4A-DF5C-4CA2-9439-7C020764F3A4","f4_far":"470B1005-9D85-4D6E-897B-FECE4C605786","f4_isVector":"4EC170EF-D657-4C82-B941-FCD093FA8C1B","f4_isWorldSpace":"D63002A0-95D0-45F0-9F90-437F31A37E17","f4_origin":"1DF22467-D7A0-411C-A839-FDEF8ADFC936","f4_colorA":"0A95535C-57DB-48C6-A9A2-C1AF4691E5CA","f4_colorB":"4D6D71C2-26F9-479B-80D3-B3F9CF50FDFE","f4_alpha":"7EBAF9E9-E441-43E5-A6B6-555FD43403D0","f4_mode":"814DE14F-07E4-429B-A26A-EDE53536CA64"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"8D43D247-0B3D-49A5-9E1F-494D266487FB","f3_bias":"2DA686A1-CDC7-4BBD-8D59-62FA7788667B","f3_scale":"C6C98562-F74C-4E62-9BCC-416D2B90CB1A","f3_intensity":"FC07F089-F733-466F-9D51-2C481FCCF628","f3_factor":"FBD6321D-745C-450F-ADBC-010437916D90","f3_alpha":"5C9C0CBA-40D9-4F8A-B797-6FEC7EBC7959","f3_mode":"3D9BF42B-6165-40C3-AE44-D0BF6216144D"}}]}}],"nodes":[{"uuid":"9528FF2C-09C7-4BFA-8C50-A8906E49B7DD","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"26BFC0DE-B6FA-4E58-A370-63D426010C1F","nodeType":"Color"},{"uuid":"26BFC0DE-B6FA-4E58-A370-63D426010C1F","type":"f","value":1,"nodeType":"Float"},{"uuid":"2AA63172-3ACA-4E55-87EF-7AC32FEF8101","type":"i","value":0,"nodeType":"Int"},{"uuid":"26711080-4484-4084-97FD-B4C8A58BBB9E","type":"f","value":1,"nodeType":"Float"},{"uuid":"FDB528A9-95E1-4DFC-88DA-154E3B1FD1C0","type":"i","value":0,"nodeType":"Int"},{"uuid":"2AC55BA1-98F2-4C1A-8E6B-021C6270F937","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"7A7CD816-3528-4C3B-857B-B8AF6F9BFF23","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"F3BE01F6-3234-4ACC-83C0-7B58EBD26CE2","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BE68D1E5-3572-441D-82F5-03593C1390DA","type":"f","value":1,"nodeType":"Float"},{"uuid":"60E02BB3-4161-4DC8-BD87-91C46ACB71B9","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"C569F29E-B11E-4B7F-AD3F-03376BBA9E7D","type":"f","value":1,"nodeType":"Float"},{"uuid":"4555D0E9-13A9-431D-8196-40D58696658B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6FDB3B5-80D1-44FE-9204-F5029BF59732","type":"i","value":0,"nodeType":"Int"},{"uuid":"B6886E4F-4BDB-4364-9ADA-BA2675BACB78","type":"lambert","color":"9528FF2C-09C7-4BFA-8C50-A8906E49B7DD","emissiveIntensity":"46941BC9-D779-488F-86DB-1BC5CCD4A72C","shadingAlpha":"26711080-4484-4084-97FD-B4C8A58BBB9E","shadingBlend":"FDB528A9-95E1-4DFC-88DA-154E3B1FD1C0","afterColor":"12FD9EE5-7CBA-4A96-969F-0BD8CBA7C5A8","alpha":"C1A08326-55EF-409D-8EB1-AC7CA50A9AB2","emissive":"2AC55BA1-98F2-4C1A-8E6B-021C6270F937","nodeType":"Lambert"},{"uuid":"46941BC9-D779-488F-86DB-1BC5CCD4A72C","type":"f","value":1,"nodeType":"Float"},{"uuid":"12FD9EE5-7CBA-4A96-969F-0BD8CBA7C5A8","type":"v3","a":"80D6E7D7-5F1D-4584-A590-C621D1FDC74D","b":"B088FC68-F8BE-4026-8100-EE4F4A745E4C","alpha":"F7F4A77F-FA4C-4E4E-A61C-6062DE207F43","mode":"D6FDB3B5-80D1-44FE-9204-F5029BF59732","nodeType":"Blend"},{"uuid":"80D6E7D7-5F1D-4584-A590-C621D1FDC74D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B088FC68-F8BE-4026-8100-EE4F4A745E4C","type":"v3","color":"7A7CD816-3528-4C3B-857B-B8AF6F9BFF23","bias":"F3BE01F6-3234-4ACC-83C0-7B58EBD26CE2","scale":"BE68D1E5-3572-441D-82F5-03593C1390DA","intensity":"60E02BB3-4161-4DC8-BD87-91C46ACB71B9","factor":"C569F29E-B11E-4B7F-AD3F-03376BBA9E7D","alpha":"4555D0E9-13A9-431D-8196-40D58696658B","mode":"D6FDB3B5-80D1-44FE-9204-F5029BF59732","calpha":"gB088FC68F8BE40268100EE4F4A745E4C_calpha","nodeType":"Fresnel"},{"uuid":"F7F4A77F-FA4C-4E4E-A61C-6062DE207F43","type":"f","src":"gB088FC68F8BE40268100EE4F4A745E4C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C1A08326-55EF-409D-8EB1-AC7CA50A9AB2","type":"f","value":1,"nodeType":"Float"},{"uuid":"BCD97BE2-C73C-4578-B2E4-15836BBB024D","type":"f","value":1,"nodeType":"Float"},{"uuid":"F7EC53B2-2B9B-476A-A363-47098AB0A426","type":"i","value":0,"nodeType":"Int"},{"uuid":"4827798B-6E7C-439A-89D9-D4D459D4CC62","type":"f","value":30,"nodeType":"Float"},{"uuid":"65219004-E5E7-4595-8931-3B75371B787C","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"4EFC302E-A468-4F00-B4A1-62946AA52621","type":"f","value":10,"nodeType":"Float"},{"uuid":"23639224-5F75-42AA-BAD8-5BB334875083","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"C4628252-52C1-4478-A263-DEDBC4EAB1C1","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8C7DC0DC-E7C7-40E9-AF7A-5E2293819A02","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"150FC8AB-5CE7-4207-9E72-78C3E6E91D37","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"044F2A76-E7A6-4C35-9148-900B2AE16339","type":"f","value":1,"nodeType":"Float"},{"uuid":"91A0F2E1-0B1D-455D-8154-089CC5DAD2A3","type":"i","value":0,"nodeType":"Int"},{"uuid":"FC5E9E41-8941-4926-B244-B47E81553499","type":"f","value":50,"nodeType":"Float"},{"uuid":"D0E9CC0F-E856-43E2-B8F6-3891CAB5AB96","type":"f","value":105,"nodeType":"Float"},{"uuid":"AB524852-3570-42DF-A59E-90FE8ABBB5E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2318EEB-74A4-4135-AF83-1749ED63AE8A","type":"f","value":0,"nodeType":"Float"},{"uuid":"1541A248-9A8A-4A8F-96B8-858C573177AF","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"246B48B1-7DFA-4520-831D-9E33E1E2F263","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"84613092-E065-4601-9100-A2DA29285ECE","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"767758AF-3129-48F8-AAD7-C6E22A0C8F0F","type":"f","value":1,"nodeType":"Float"},{"uuid":"50E8C0C5-B4FD-4810-B498-7A8F2C041A89","type":"i","value":1,"nodeType":"Int"},{"uuid":"E5747375-6E5D-4C4B-8668-F07D18489D3A","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"675B01F3-8882-438D-AB95-C9E8D7910489","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"71ADF1D8-FC55-45AF-AFAA-812F0A6FA405","type":"f","value":1,"nodeType":"Float"},{"uuid":"E18E205B-1C3E-4050-8F14-524C160B4A97","type":"f","value":2,"nodeType":"Float"},{"uuid":"56B1B770-B97B-4A3B-9054-AB0332049621","type":"f","value":1,"nodeType":"Float"},{"uuid":"F6207B59-BEC3-41A7-82C7-5D7F308DE060","type":"f","value":1,"nodeType":"Float"},{"uuid":"6AE44235-A3FB-4C87-A8E6-64862F9DBF99","type":"i","value":2,"nodeType":"Int"},{"uuid":"15B486F4-A1F9-42A4-9652-7A5BC470649D","type":"f","value":1,"nodeType":"Float"},{"uuid":"1DA255C9-8D77-4892-97C2-8677A8372631","type":"i","value":0,"nodeType":"Int"},{"uuid":"8DB19381-87E8-4AF3-8EBA-9D15D2B3930F","type":"f","value":30,"nodeType":"Float"},{"uuid":"39FCA606-1622-4F02-ABF7-FBD2BCBC908E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"8F994F94-0ABF-489F-AE16-B77C475F2940","type":"f","value":10,"nodeType":"Float"},{"uuid":"76B30887-4CDA-45E1-AEC9-5FD15E22D51F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F40EF9B4-1337-4B22-B865-B70AEE760B5F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"79778AE8-9EB1-4278-9C0C-A0FE45C3A324","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D901C136-ED5D-40E5-B7FA-4FA89F88B102","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"C1150A4A-2684-4F5B-BB66-214C669DABA4","type":"f","value":1,"nodeType":"Float"},{"uuid":"E09B0018-EA1E-44C9-9652-AB9A8A556D96","type":"i","value":0,"nodeType":"Int"},{"uuid":"50329D24-6E31-4805-BC44-9F3F714DD582","type":"f","value":50,"nodeType":"Float"},{"uuid":"897E5AF8-BAAD-41A7-B86E-0C438BA827A2","type":"f","value":105,"nodeType":"Float"},{"uuid":"E5CA2D92-1A34-423D-BC48-8F91C5170C44","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB804334-4525-4AD3-9EB9-AC28D59F3311","type":"f","value":0,"nodeType":"Float"},{"uuid":"7038D901-DB80-4C7D-8F8C-103BBA8E761B","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"4A687505-4AE3-48BB-83EA-8FFC9BB93789","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"500AC45D-2F80-48CC-82D9-6850A8F7B048","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"9C924156-901E-4056-88CB-ACC49F67DD42","type":"f","value":1,"nodeType":"Float"},{"uuid":"C3FF7E64-C7F4-4245-970D-24ADE310669A","type":"i","value":1,"nodeType":"Int"},{"uuid":"3AD124AA-DAFC-4E5D-B921-EB6B3890BE2A","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"1A8A044C-262E-4375-842B-839BE840569A","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"57DA142A-777F-440B-BF4A-0D1E19601C19","type":"f","value":1,"nodeType":"Float"},{"uuid":"9B3F00C9-B897-4F0C-9822-5CC90D116E42","type":"f","value":2,"nodeType":"Float"},{"uuid":"ECBD587D-35B0-4C25-AE1D-DBCFBC88B6B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"3BD753E5-B330-4E08-A46D-A07FB78DAEAB","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1E058AD-13B5-4B8F-8C3F-0EC49D552784","type":"i","value":2,"nodeType":"Int"},{"uuid":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","type":"f","value":1,"nodeType":"Float"},{"uuid":"97EF242E-3A72-4EB1-9450-30B50662F407","type":"i","value":0,"nodeType":"Int"},{"uuid":"F4295F34-7939-4B9E-9120-5DC2F3082D25","type":"f","value":30,"nodeType":"Float"},{"uuid":"7C84C4D9-A831-4328-9C28-CA9F8E5CD0F0","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"644B92DD-FEC1-41D2-AA62-FE7A60CFB518","type":"f","value":10,"nodeType":"Float"},{"uuid":"B7D8F639-61BE-4F11-AAC3-CFFD9C4E28A2","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0A248B5A-B6C5-4C23-A889-C28D348FB834","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"221006A8-D995-4270-9186-5EB1B6A0609A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"F589906D-D705-466D-A4EB-CEF2D44A9EF5","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"1D4EC109-B1AD-4124-AEFA-013A8E4B59D9","project":false,"nodeType":"Texture"},{"uuid":"1D4EC109-B1AD-4124-AEFA-013A8E4B59D9","type":"v2","index":0,"nodeType":"UV"},{"uuid":"FDBB5D1C-2870-49D1-97D2-C0E1CCACB956","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"6976B083-297B-4D41-8104-64A372CC19DB","project":false,"nodeType":"Texture"},{"uuid":"6976B083-297B-4D41-8104-64A372CC19DB","type":"v2","index":0,"nodeType":"UV"},{"uuid":"240907EA-20BB-4AA1-8B21-ECCD5873CCC0","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"6E4E163A-5099-4C52-99F2-546512D188BE","type":"f","value":1,"nodeType":"Float"},{"uuid":"6B7EAA42-ABC3-4C47-B5FA-543F475709DC","type":"i","value":0,"nodeType":"Int"},{"uuid":"67E18630-8ED3-4D73-A3BE-995270C98699","type":"f","value":50,"nodeType":"Float"},{"uuid":"3EEC73D4-9854-4001-BEE4-80AADC298945","type":"f","value":105,"nodeType":"Float"},{"uuid":"AF88F9B8-D1E9-4115-8DBB-AC2B5F94FA11","type":"f","value":1,"nodeType":"Float"},{"uuid":"FBAAA647-35E7-4CCD-A656-C2D9E12FC5E5","type":"f","value":0,"nodeType":"Float"},{"uuid":"2107ED6A-131D-49A3-A1DC-D6F8B609B480","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"159E4E73-0B3F-4B75-9FB4-672937D1A1C0","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"81A430A9-0E42-406E-ACBE-EFF11FD01690","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"C6F6B002-3558-4389-8C49-0B2DF0B618DC","type":"f","value":1,"nodeType":"Float"},{"uuid":"FB06E98C-FA58-432D-AD0B-6D36E5B1A5E8","type":"i","value":1,"nodeType":"Int"},{"uuid":"589A7912-6949-4203-9454-3E1BB71CC843","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"3B57FEC6-B0B5-485D-A8E6-79CF13DFE51B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"605850E4-5999-4B53-8BE3-BA720BABA9A7","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4E64B8F-2A5A-403D-9B94-39DF6219EA53","type":"f","value":2,"nodeType":"Float"},{"uuid":"286E8498-C12A-48AA-9BEC-F47C797EA5EB","type":"f","value":1,"nodeType":"Float"},{"uuid":"3158B987-2497-45AD-B8A1-A6F692967C12","type":"f","value":1,"nodeType":"Float"},{"uuid":"24F19F76-B5A4-433E-B136-BA71CA46EE2A","type":"i","value":2,"nodeType":"Int"},{"uuid":"82FCED54-F37F-4E88-BA64-B2E125F4D07B","type":"phong","color":"A4BC9F6A-7FCF-460B-AEAB-96F60993AC79","specular":"7C84C4D9-A831-4328-9C28-CA9F8E5CD0F0","shininess":"F4295F34-7939-4B9E-9120-5DC2F3082D25","shadingAlpha":"09DE6D37-6BEC-4CB0-BFCF-EF67AA461A82","shadingBlend":"97EF242E-3A72-4EB1-9450-30B50662F407","afterColor":"A9A80C34-ED30-4650-B20C-923DDB032483","alpha":"DA2F4B51-F725-4663-9B62-E13C33E560C5","nodeType":"Phong"},{"uuid":"A4BC9F6A-7FCF-460B-AEAB-96F60993AC79","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"A9A80C34-ED30-4650-B20C-923DDB032483","type":"v3","a":"A7D3F7C4-803E-4C94-84B2-A772E9977212","b":"B3678F82-B8CA-4EF4-BD0B-9488E5CAE80E","alpha":"6FFA26BE-33CD-4F29-B461-D44D789ACB58","mode":"24F19F76-B5A4-433E-B136-BA71CA46EE2A","nodeType":"Blend"},{"uuid":"A7D3F7C4-803E-4C94-84B2-A772E9977212","type":"v3","a":"6DFDDAA5-8CD4-40AE-96F4-CA007D495C10","b":"740E2B3D-A3B6-493C-B2A6-BA780A2FBCC1","alpha":"446C5AFC-A234-4945-9CE3-BE5785861F50","mode":"FB06E98C-FA58-432D-AD0B-6D36E5B1A5E8","nodeType":"Blend"},{"uuid":"6DFDDAA5-8CD4-40AE-96F4-CA007D495C10","type":"v3","a":"482BE77A-9F8A-4D0A-9CE4-4D5E319C644D","b":"141655D1-281C-437B-B384-DFD31E25B027","alpha":"E6D93D07-F8D3-4EDC-B7EE-1EA756417DD0","mode":"6B7EAA42-ABC3-4C47-B5FA-543F475709DC","nodeType":"Blend"},{"uuid":"482BE77A-9F8A-4D0A-9CE4-4D5E319C644D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"141655D1-281C-437B-B384-DFD31E25B027","type":"v3","thickness":"644B92DD-FEC1-41D2-AA62-FE7A60CFB518","ior":"B7D8F639-61BE-4F11-AAC3-CFFD9C4E28A2","roughness":"0A248B5A-B6C5-4C23-A889-C28D348FB834","alpha":"6E4E163A-5099-4C52-99F2-546512D188BE","calpha":"g141655D1281C437BB384DFD31E25B027_calpha","nodeType":"Transmission"},{"uuid":"E6D93D07-F8D3-4EDC-B7EE-1EA756417DD0","type":"f","src":"g141655D1281C437BB384DFD31E25B027_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"740E2B3D-A3B6-493C-B2A6-BA780A2FBCC1","type":"v3","near":"67E18630-8ED3-4D73-A3BE-995270C98699","far":"3EEC73D4-9854-4001-BEE4-80AADC298945","isVector":"AF88F9B8-D1E9-4115-8DBB-AC2B5F94FA11","isWorldSpace":"FBAAA647-35E7-4CCD-A656-C2D9E12FC5E5","origin":"2107ED6A-131D-49A3-A1DC-D6F8B609B480","colorA":"159E4E73-0B3F-4B75-9FB4-672937D1A1C0","colorB":"81A430A9-0E42-406E-ACBE-EFF11FD01690","alpha":"C6F6B002-3558-4389-8C49-0B2DF0B618DC","nodeType":"Depth"},{"uuid":"446C5AFC-A234-4945-9CE3-BE5785861F50","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"C6F6B002-3558-4389-8C49-0B2DF0B618DC"},"nodeType":"Expression"},{"uuid":"B3678F82-B8CA-4EF4-BD0B-9488E5CAE80E","type":"v3","color":"589A7912-6949-4203-9454-3E1BB71CC843","bias":"3B57FEC6-B0B5-485D-A8E6-79CF13DFE51B","scale":"605850E4-5999-4B53-8BE3-BA720BABA9A7","intensity":"B4E64B8F-2A5A-403D-9B94-39DF6219EA53","factor":"286E8498-C12A-48AA-9BEC-F47C797EA5EB","alpha":"3158B987-2497-45AD-B8A1-A6F692967C12","mode":"24F19F76-B5A4-433E-B136-BA71CA46EE2A","calpha":"gB3678F82B8CA4EF4BD0B9488E5CAE80E_calpha","nodeType":"Fresnel"},{"uuid":"6FFA26BE-33CD-4F29-B461-D44D789ACB58","type":"f","src":"gB3678F82B8CA4EF4BD0B9488E5CAE80E_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DA2F4B51-F725-4663-9B62-E13C33E560C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"10243827-CEF9-4B2C-9014-7443F1054896","type":"f","value":1,"nodeType":"Float"},{"uuid":"EA1EECA0-7161-468F-8E61-EBC8AA6B2892","type":"i","value":0,"nodeType":"Int"},{"uuid":"2263B8CB-2738-484A-88F9-44254729C4CC","type":"f","value":30,"nodeType":"Float"},{"uuid":"B2A30C30-3D5F-4B63-BDCB-E9ACA9A5B81B","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"4F575F1F-5CCD-4CAA-BEB5-AF4ABDDE19BF","type":"f","value":10,"nodeType":"Float"},{"uuid":"5C240FDB-0A78-4F61-B7AE-88E6EE5BA070","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"B8C35C4A-9020-4072-B72B-14E4F6BCCEED","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0D4ADB0E-7AD7-425E-A8F5-2884066831D9","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"03BCD85C-02D0-4E84-AECB-DD4FD6F5B720","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"E7E6D61C-F934-4240-9DA5-6BB3A4C3F221","type":"f","value":1,"nodeType":"Float"},{"uuid":"430A6DB3-DACE-45FF-B0D6-3D14F1539513","type":"i","value":0,"nodeType":"Int"},{"uuid":"9AC2DA4A-3028-4841-9F21-A3BB158F1670","type":"f","value":50,"nodeType":"Float"},{"uuid":"8243D00A-15B7-4EF1-A854-E18F869320BD","type":"f","value":105,"nodeType":"Float"},{"uuid":"C156DB53-1A14-49E3-99F6-31DC8051FBFF","type":"f","value":1,"nodeType":"Float"},{"uuid":"B23C957A-76C8-4FBE-98E9-AA289C4B3C2E","type":"f","value":0,"nodeType":"Float"},{"uuid":"05D5A93E-91C3-49D9-962B-504CBD30E3CA","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"9502FECD-155C-420D-9AA7-624DA66AFC13","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"2FFA5A49-B079-4582-ABD5-A73E22FA45AD","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"1BE6A29D-684A-4404-A3D0-728B26120F9C","type":"f","value":1,"nodeType":"Float"},{"uuid":"00B2FA17-CB31-466D-AD23-FCCC2C0A54B7","type":"i","value":1,"nodeType":"Int"},{"uuid":"5A6E3B56-A0BE-48B1-9821-082B27E44D89","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"64F36D10-CB01-4B7C-A8A1-1E98D7E20C8F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"74E46E2D-00F1-4A22-BA7D-989224CFB122","type":"f","value":1,"nodeType":"Float"},{"uuid":"9967D17C-38D9-42C2-B30D-DF4752D251AC","type":"f","value":2,"nodeType":"Float"},{"uuid":"39EB9D76-C768-47BE-BB81-1A76493C99ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"61B3562B-8A59-4903-9C4E-DE468B0EA200","type":"f","value":1,"nodeType":"Float"},{"uuid":"FAB3E6BB-6262-4A8A-93DE-8018FE7D146D","type":"i","value":2,"nodeType":"Int"},{"uuid":"C2F08D6B-8F65-42C1-A78B-4119B8512D04","type":"f","value":1,"nodeType":"Float"},{"uuid":"7DBC9423-AE56-4E70-8E93-E2948E5B1C23","type":"i","value":0,"nodeType":"Int"},{"uuid":"51D9651F-E4F8-494E-B246-DD0835D5E566","type":"f","value":30,"nodeType":"Float"},{"uuid":"462C6FBE-FD4E-4FA7-8EB3-32DED071D391","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"E904463B-BDEE-4CF5-AA76-F39BE4FD5C9C","type":"f","value":10,"nodeType":"Float"},{"uuid":"F6510DFC-A9FC-4D34-8803-EE0CBEC588E7","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"51288AC3-71B0-4D1C-AD3E-59A8108062BC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0F8AC313-3774-4DB4-AF20-9ADF32C750F2","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"4444B40F-E087-4A0D-B13F-48BBFAD842CB","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"D8AD819C-37DB-44CB-BCED-23A930686A7A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE632A0C-8DF7-4DB0-B2AD-EE05012444B4","type":"i","value":0,"nodeType":"Int"},{"uuid":"51B4BF98-F4F3-49D6-83AC-342C11176472","type":"f","value":50,"nodeType":"Float"},{"uuid":"615722EF-15C8-4296-92CF-759020E10996","type":"f","value":105,"nodeType":"Float"},{"uuid":"55E2CA2C-D0EF-4852-A3A7-94EC7A0DE103","type":"f","value":1,"nodeType":"Float"},{"uuid":"744A0ED5-5DFB-4579-B20A-48D583EDA36E","type":"f","value":0,"nodeType":"Float"},{"uuid":"994682F6-4E55-473F-B2DF-DF1013B3C8A5","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D227475C-A236-4EA8-8BBF-5B72EEBD1B2D","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"8A45109A-18AB-4C3B-A743-BD52A581CFBA","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"9773E723-D7A3-4372-86AD-39925416F775","type":"f","value":1,"nodeType":"Float"},{"uuid":"55857E83-333C-44EC-9455-DA8575CB1ED2","type":"i","value":1,"nodeType":"Int"},{"uuid":"753C156D-6637-410C-A0E3-EAF13A5C02E0","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"C167DAF0-95F3-40DB-8E36-2A0CF996C2AA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FD54C4D9-AFC2-4124-86F4-F6FED04FDF32","type":"f","value":1,"nodeType":"Float"},{"uuid":"2E4FA95B-C14F-4B88-9FA4-B2C391A53283","type":"f","value":2,"nodeType":"Float"},{"uuid":"B767C09C-0551-4B9C-B263-A8992ADFC890","type":"f","value":1,"nodeType":"Float"},{"uuid":"50BA5C21-FF29-4E4E-9536-C105AEED439C","type":"f","value":1,"nodeType":"Float"},{"uuid":"938878D0-3F1F-41D3-8865-0CC7CDE9F4F3","type":"i","value":2,"nodeType":"Int"},{"uuid":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","type":"i","value":0,"nodeType":"Int"},{"uuid":"1E51144E-D8E0-486D-9B6E-D50E7121A3DA","type":"f","value":30,"nodeType":"Float"},{"uuid":"29D84BC1-9F8B-4CCB-A579-D9B9F50E0409","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"B97B676C-B8C0-4F39-9B56-637BAE6C6F15","type":"f","value":10,"nodeType":"Float"},{"uuid":"B1000437-0922-4226-846E-D21350A6561D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3A6BED93-56B7-4F25-B67D-314D892D94AD","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"304D2278-1EE2-47DA-9785-3A6E509EBC9C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"6D02CEC5-049E-425B-9FCE-1C914215426B","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"91839F32-9883-4595-9D93-1848B4F79E07","project":false,"nodeType":"Texture"},{"uuid":"91839F32-9883-4595-9D93-1848B4F79E07","type":"v2","index":0,"nodeType":"UV"},{"uuid":"DCC62030-FF02-4AEA-BCEF-AD249937CC02","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"F4E3CBDC-E105-422F-8BB5-2556676709CD","project":false,"nodeType":"Texture"},{"uuid":"F4E3CBDC-E105-422F-8BB5-2556676709CD","type":"v2","index":0,"nodeType":"UV"},{"uuid":"3D93DA05-E5AA-46BA-99C5-24337A7449B4","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"5D9E27A8-016A-4C1C-B746-9DE817BE35F8","type":"f","value":1,"nodeType":"Float"},{"uuid":"79931641-B24B-411D-98E5-74D0DA84D0A0","type":"i","value":0,"nodeType":"Int"},{"uuid":"16082D61-98CC-423B-8594-4778CAE08326","type":"f","value":50,"nodeType":"Float"},{"uuid":"B07AF806-0CAC-4326-A7CC-A814620B6483","type":"f","value":105,"nodeType":"Float"},{"uuid":"3EC60D88-167A-4D00-8B63-8B0D2E2BDB9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8E3DB7B-D28A-4C88-B7ED-62083EFF7A1F","type":"f","value":0,"nodeType":"Float"},{"uuid":"1933179A-BC37-475B-9219-0908C1CC3932","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"32D65B23-C86F-47F5-A6BE-D7858ADE9535","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"0ED04730-127E-4739-9B55-6CA7C838D6FA","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"B7BA5606-E181-4C0C-ACF4-383CE5623D43","type":"f","value":1,"nodeType":"Float"},{"uuid":"1DC6FE71-AEE4-4E65-A23A-F245CF564847","type":"i","value":1,"nodeType":"Int"},{"uuid":"38A03602-C62B-446C-8F6D-28C6DC475B44","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"80EF1342-EEDC-4B71-8887-93978FABF621","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3933822A-1BDD-4986-AEC4-FCDB0C4FACDB","type":"f","value":1,"nodeType":"Float"},{"uuid":"BC398DDE-CF5C-4D6D-8624-2CB07C7CD9E3","type":"f","value":2,"nodeType":"Float"},{"uuid":"A9C27E07-636C-41D5-83C3-C713BB3B541B","type":"f","value":1,"nodeType":"Float"},{"uuid":"9FD597D8-A0D8-4D93-9B03-3AE5F47FED8C","type":"f","value":1,"nodeType":"Float"},{"uuid":"1A8B33E4-8EC3-40AF-9F36-D804E18BA55A","type":"i","value":2,"nodeType":"Int"},{"uuid":"B875D127-D743-45D2-8D31-F232DBC4ED8E","type":"phong","color":"464A0D8E-5260-4308-871F-9B6582A76EAC","specular":"29D84BC1-9F8B-4CCB-A579-D9B9F50E0409","shininess":"1E51144E-D8E0-486D-9B6E-D50E7121A3DA","shadingAlpha":"3B5BBDB3-1CB2-4CF3-9818-BD4C790C0F82","shadingBlend":"CB7C8BA8-E2CB-48DB-9442-135931ABB91A","afterColor":"102B57AB-9F9F-4DA2-BC58-2E5782DFBC34","alpha":"9BE7C014-F610-4B48-9558-4116089479E1","nodeType":"Phong"},{"uuid":"464A0D8E-5260-4308-871F-9B6582A76EAC","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"102B57AB-9F9F-4DA2-BC58-2E5782DFBC34","type":"v3","a":"423EC840-07A4-452F-94BF-D1E517B454C6","b":"0E49CC33-9E04-4878-A42E-4D5988D171E5","alpha":"E89487C8-D355-4CC7-8EDB-53A86E084658","mode":"1A8B33E4-8EC3-40AF-9F36-D804E18BA55A","nodeType":"Blend"},{"uuid":"423EC840-07A4-452F-94BF-D1E517B454C6","type":"v3","a":"D2E31BA6-760A-4DE7-989A-350D0CA79D6C","b":"E2D6EBDB-2650-4475-AF05-511984927A2E","alpha":"45E5B3A1-831B-4C27-A309-7D171AE315BD","mode":"1DC6FE71-AEE4-4E65-A23A-F245CF564847","nodeType":"Blend"},{"uuid":"D2E31BA6-760A-4DE7-989A-350D0CA79D6C","type":"v3","a":"5FA6F8D1-C8F8-41B5-A3F4-9C35F4D9F07A","b":"BB3557CD-1ED2-493A-B0A1-276F3E7BECCA","alpha":"14AEB7AF-65BD-49D6-82C4-B17857685085","mode":"79931641-B24B-411D-98E5-74D0DA84D0A0","nodeType":"Blend"},{"uuid":"5FA6F8D1-C8F8-41B5-A3F4-9C35F4D9F07A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BB3557CD-1ED2-493A-B0A1-276F3E7BECCA","type":"v3","thickness":"B97B676C-B8C0-4F39-9B56-637BAE6C6F15","ior":"B1000437-0922-4226-846E-D21350A6561D","roughness":"3A6BED93-56B7-4F25-B67D-314D892D94AD","alpha":"5D9E27A8-016A-4C1C-B746-9DE817BE35F8","calpha":"gBB3557CD1ED2493AB0A1276F3E7BECCA_calpha","nodeType":"Transmission"},{"uuid":"14AEB7AF-65BD-49D6-82C4-B17857685085","type":"f","src":"gBB3557CD1ED2493AB0A1276F3E7BECCA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E2D6EBDB-2650-4475-AF05-511984927A2E","type":"v3","near":"16082D61-98CC-423B-8594-4778CAE08326","far":"B07AF806-0CAC-4326-A7CC-A814620B6483","isVector":"3EC60D88-167A-4D00-8B63-8B0D2E2BDB9A","isWorldSpace":"D8E3DB7B-D28A-4C88-B7ED-62083EFF7A1F","origin":"1933179A-BC37-475B-9219-0908C1CC3932","colorA":"32D65B23-C86F-47F5-A6BE-D7858ADE9535","colorB":"0ED04730-127E-4739-9B55-6CA7C838D6FA","alpha":"B7BA5606-E181-4C0C-ACF4-383CE5623D43","nodeType":"Depth"},{"uuid":"45E5B3A1-831B-4C27-A309-7D171AE315BD","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"B7BA5606-E181-4C0C-ACF4-383CE5623D43"},"nodeType":"Expression"},{"uuid":"0E49CC33-9E04-4878-A42E-4D5988D171E5","type":"v3","color":"38A03602-C62B-446C-8F6D-28C6DC475B44","bias":"80EF1342-EEDC-4B71-8887-93978FABF621","scale":"3933822A-1BDD-4986-AEC4-FCDB0C4FACDB","intensity":"BC398DDE-CF5C-4D6D-8624-2CB07C7CD9E3","factor":"A9C27E07-636C-41D5-83C3-C713BB3B541B","alpha":"9FD597D8-A0D8-4D93-9B03-3AE5F47FED8C","mode":"1A8B33E4-8EC3-40AF-9F36-D804E18BA55A","calpha":"g0E49CC339E044878A42E4D5988D171E5_calpha","nodeType":"Fresnel"},{"uuid":"E89487C8-D355-4CC7-8EDB-53A86E084658","type":"f","src":"g0E49CC339E044878A42E4D5988D171E5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9BE7C014-F610-4B48-9558-4116089479E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"840FEE52-3254-43FE-A37D-0D7DC7CE60E7","type":"f","value":1,"nodeType":"Float"},{"uuid":"2EA83C8D-A28C-433B-9220-4D9F4026DD84","type":"i","value":0,"nodeType":"Int"},{"uuid":"F0D6E663-6D91-4E51-B6E0-9669B7625164","type":"f","value":30,"nodeType":"Float"},{"uuid":"B224EA54-7065-4488-8F43-EB3BD9CFC65F","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"F5FE2E1F-99A9-448C-BB07-964E30B2F8DA","type":"f","value":10,"nodeType":"Float"},{"uuid":"7C2FEE2A-1A9E-4BFD-A6BC-80E485D0075A","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"FFAF3C70-7C94-49A9-9062-66F11C487856","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"05A253A4-1727-4C79-B536-46A7F07409A6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"FA5988FC-0D47-4BDD-B5EE-B61B3C2C8CD8","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"D1582FAA-F81E-450E-8E06-E0C394942187","type":"f","value":1,"nodeType":"Float"},{"uuid":"D8FCAB28-2086-4ABF-855F-3515D735B541","type":"i","value":0,"nodeType":"Int"},{"uuid":"4D5185F3-C910-4DD6-ACCA-44335E8C16CA","type":"f","value":50,"nodeType":"Float"},{"uuid":"036C4EFB-BC35-43EF-BDDF-AAEBA4A1AFD6","type":"f","value":145,"nodeType":"Float"},{"uuid":"3CEA4A23-C977-4710-BB2F-BAEDD0F63995","type":"f","value":1,"nodeType":"Float"},{"uuid":"6FE24B4F-E1F7-492A-BBC1-6A98D984CADF","type":"f","value":0,"nodeType":"Float"},{"uuid":"E30AB035-7F7E-45D5-A62F-B173DD1E1AC9","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FE7F3145-558E-42A7-988F-BC6E6EB21CFE","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"497D0334-0C13-444C-B932-8064ECB77EDE","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"8C8B817C-834D-4660-81BC-AD7C5C4500B2","type":"f","value":1,"nodeType":"Float"},{"uuid":"5E21DD61-6491-4361-9326-E929343B3ED2","type":"i","value":1,"nodeType":"Int"},{"uuid":"8177D53A-595A-4BC5-8617-787C0A5029BC","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"624B0771-CE81-492A-9D83-78D4EDCED988","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FEE4D63B-B7D7-49F8-8E07-11241E8618D3","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE9F4F08-0C08-45DD-B287-D00CA37ECA80","type":"f","value":2,"nodeType":"Float"},{"uuid":"D61CA7E7-FE36-4B18-AF49-4228F50A834A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE68A43D-3996-4B6A-87A6-9713B79C0E22","type":"f","value":1,"nodeType":"Float"},{"uuid":"B12CA968-743D-4DF0-B076-3C802E21E3E7","type":"i","value":2,"nodeType":"Int"},{"uuid":"A595BAB8-784A-4DA1-99D9-F8951B6C423A","type":"f","value":1,"nodeType":"Float"},{"uuid":"C635374C-890A-4A33-8807-EEFB65BB6A7A","type":"i","value":0,"nodeType":"Int"},{"uuid":"B6D224DA-CA2F-4145-9852-83D39161595E","type":"f","value":30,"nodeType":"Float"},{"uuid":"841249CF-E802-44E5-A9CB-79FF76962821","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"DB03E633-33CE-410B-BC63-E7C6B10A8D94","type":"f","value":10,"nodeType":"Float"},{"uuid":"6605CAE1-FBE2-4908-A6BE-91FA245F0360","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D4444CF0-B073-4448-B2A3-F321353E1672","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"AF9BA58B-0500-4DFA-BD34-E56F41B5B435","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"6370876B-829B-439F-B7E6-F7C80628FC54","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"24171A0E-66ED-40E9-9E85-9D68CD4444E7","type":"f","value":1,"nodeType":"Float"},{"uuid":"12F2A011-8854-4054-B20F-B3DC9EB7BC47","type":"i","value":0,"nodeType":"Int"},{"uuid":"630E47A9-3AD7-4873-98C7-8B766E7D9EB2","type":"f","value":50,"nodeType":"Float"},{"uuid":"2E0F6353-03B1-4D60-A053-EEE365B2CBB0","type":"f","value":145,"nodeType":"Float"},{"uuid":"798533EE-05E2-425C-BF4F-C00D2E2770C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"A2F4249A-9798-4817-A690-619E77356F32","type":"f","value":0,"nodeType":"Float"},{"uuid":"FB006ED2-EEA0-4C97-BC2D-89BB122796A5","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"77201A22-54B0-49AD-AE51-2918D19A34DC","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"5F2C12F4-91E4-4A61-8D44-5EF27853002F","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"D10B9F35-1906-4216-97F5-8CAFCB38CBDF","type":"f","value":1,"nodeType":"Float"},{"uuid":"CB9CDC15-EF2E-42B2-AC58-2FD1855131A0","type":"i","value":1,"nodeType":"Int"},{"uuid":"E387CC80-01B8-4721-BCCD-661FDEA335D1","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"AD39F318-8DC5-410F-BE32-7E686C09ACD1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"043DFD3B-F7E2-4591-AFF1-6E72D00BAC0B","type":"f","value":1,"nodeType":"Float"},{"uuid":"15B5DCF2-919E-4DB0-8420-8060F0C0E5A8","type":"f","value":2,"nodeType":"Float"},{"uuid":"6B2B677E-936C-489C-8594-08A0F822F740","type":"f","value":1,"nodeType":"Float"},{"uuid":"5DC0EECF-A6F9-425C-9079-FC5B31647E1F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F00AB0EC-7600-4648-8B60-5DA1EDF39A1F","type":"i","value":2,"nodeType":"Int"},{"uuid":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","type":"f","value":1,"nodeType":"Float"},{"uuid":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","type":"i","value":0,"nodeType":"Int"},{"uuid":"26EAA259-513A-49ED-A990-0AC161A7FD9D","type":"f","value":30,"nodeType":"Float"},{"uuid":"30D99DC4-7306-4460-A28C-C3B531B3A64D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"200BCC68-DA9F-40C8-9095-4048E62679F3","type":"f","value":10,"nodeType":"Float"},{"uuid":"3AD28BA6-4E77-45F2-9AB5-51B92044CF5B","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0BD98F64-36E6-4C24-B3EC-365941530EDC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"A0D55355-19E1-4F05-879E-CA747F0EF74E","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"75A92C81-0B49-4B49-91C6-E2E195143FE3","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"2D580814-3B31-4F69-849C-497F099B4693","project":false,"nodeType":"Texture"},{"uuid":"2D580814-3B31-4F69-849C-497F099B4693","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B39FBF35-86C5-4565-ACE0-8546E3DC0252","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"D8B125F8-00E4-40AA-B31F-CCE835F0F458","project":false,"nodeType":"Texture"},{"uuid":"D8B125F8-00E4-40AA-B31F-CCE835F0F458","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A4A44A40-2C15-468F-9E14-4FA0591FF383","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"06ECCB20-EC12-4DD5-96F1-807EEA7B055E","type":"f","value":1,"nodeType":"Float"},{"uuid":"23AC0410-447F-423A-A289-7EBBB47406DB","type":"i","value":0,"nodeType":"Int"},{"uuid":"5A3E49A9-D2BD-46BA-8899-E697096BE2A8","type":"f","value":50,"nodeType":"Float"},{"uuid":"01C0F73F-9ACF-415A-AC9F-58B341D3DC49","type":"f","value":145,"nodeType":"Float"},{"uuid":"F7911B01-2576-4E5B-9CDB-37945C2C55E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"A50D4CA6-BFB2-4118-8876-CF9A5DFE6DAD","type":"f","value":0,"nodeType":"Float"},{"uuid":"A93AA962-1F95-4F40-B4AC-D878A761D0EC","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C2958E75-B7CA-48C5-9F72-BDE0EEB3B7D2","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"539DFB9B-E86A-4E3D-90F3-074E92CE013A","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"21141165-B5A2-4B05-BB40-233DE992A34D","type":"f","value":1,"nodeType":"Float"},{"uuid":"CA9836D6-1249-4488-B53D-4D85602DCBBD","type":"i","value":1,"nodeType":"Int"},{"uuid":"A06A2494-C3A5-48A8-B6D9-A38783DB78ED","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"26FD50F9-562B-48BF-B533-86BD877E0446","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"37757160-FAF3-49DB-A740-7FA8241B46E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A1FDEFC-D1D7-4CF4-9C40-CF46E2283CC3","type":"f","value":2,"nodeType":"Float"},{"uuid":"9F68D3D5-84C2-4D54-A9FA-15F4690DBE15","type":"f","value":1,"nodeType":"Float"},{"uuid":"E1A77911-CB22-4062-9068-C15B30676CA1","type":"f","value":1,"nodeType":"Float"},{"uuid":"C91C5A9E-55A9-4F95-B33A-6132DADF284A","type":"i","value":2,"nodeType":"Int"},{"uuid":"045370D6-0EE1-4BAD-87D3-B9DF86841131","type":"phong","color":"1DDC6761-B750-4416-B1CA-646F802D4BB9","specular":"30D99DC4-7306-4460-A28C-C3B531B3A64D","shininess":"26EAA259-513A-49ED-A990-0AC161A7FD9D","shadingAlpha":"4F89D7CF-5E16-4D73-90F2-C9F42C617711","shadingBlend":"0AA1ED60-23B6-4B60-9EF3-2CCF5F2D9500","afterColor":"DFD9F259-38D6-4FEA-8CF5-38354DCEF3F8","alpha":"F082178D-D77F-46C6-B057-92B3AF0A6922","nodeType":"Phong"},{"uuid":"1DDC6761-B750-4416-B1CA-646F802D4BB9","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"DFD9F259-38D6-4FEA-8CF5-38354DCEF3F8","type":"v3","a":"181FF582-483C-4010-97BB-A8194CBFAFAF","b":"E3309A09-4EC6-4A64-8778-9C6EAA1CFC5F","alpha":"9362697B-BDE3-4EFB-961D-214BD3855459","mode":"C91C5A9E-55A9-4F95-B33A-6132DADF284A","nodeType":"Blend"},{"uuid":"181FF582-483C-4010-97BB-A8194CBFAFAF","type":"v3","a":"77FE56C4-857B-4969-AB2C-53B8CE7012B6","b":"AD79F79F-EF17-49A9-AF2A-1901F7C25BD4","alpha":"E0DB57C8-2DA0-4662-9828-458654FE8CCE","mode":"CA9836D6-1249-4488-B53D-4D85602DCBBD","nodeType":"Blend"},{"uuid":"77FE56C4-857B-4969-AB2C-53B8CE7012B6","type":"v3","a":"302A1451-06A6-44FD-B40A-94960BD4866E","b":"0167C1A1-56F7-4F54-8C9E-25D30A5D0C02","alpha":"DAD7133C-AD10-4669-B929-C189D13E2988","mode":"23AC0410-447F-423A-A289-7EBBB47406DB","nodeType":"Blend"},{"uuid":"302A1451-06A6-44FD-B40A-94960BD4866E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0167C1A1-56F7-4F54-8C9E-25D30A5D0C02","type":"v3","thickness":"200BCC68-DA9F-40C8-9095-4048E62679F3","ior":"3AD28BA6-4E77-45F2-9AB5-51B92044CF5B","roughness":"0BD98F64-36E6-4C24-B3EC-365941530EDC","alpha":"06ECCB20-EC12-4DD5-96F1-807EEA7B055E","calpha":"g0167C1A156F74F548C9E25D30A5D0C02_calpha","nodeType":"Transmission"},{"uuid":"DAD7133C-AD10-4669-B929-C189D13E2988","type":"f","src":"g0167C1A156F74F548C9E25D30A5D0C02_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AD79F79F-EF17-49A9-AF2A-1901F7C25BD4","type":"v3","near":"5A3E49A9-D2BD-46BA-8899-E697096BE2A8","far":"01C0F73F-9ACF-415A-AC9F-58B341D3DC49","isVector":"F7911B01-2576-4E5B-9CDB-37945C2C55E1","isWorldSpace":"A50D4CA6-BFB2-4118-8876-CF9A5DFE6DAD","origin":"A93AA962-1F95-4F40-B4AC-D878A761D0EC","colorA":"C2958E75-B7CA-48C5-9F72-BDE0EEB3B7D2","colorB":"539DFB9B-E86A-4E3D-90F3-074E92CE013A","alpha":"21141165-B5A2-4B05-BB40-233DE992A34D","nodeType":"Depth"},{"uuid":"E0DB57C8-2DA0-4662-9828-458654FE8CCE","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"21141165-B5A2-4B05-BB40-233DE992A34D"},"nodeType":"Expression"},{"uuid":"E3309A09-4EC6-4A64-8778-9C6EAA1CFC5F","type":"v3","color":"A06A2494-C3A5-48A8-B6D9-A38783DB78ED","bias":"26FD50F9-562B-48BF-B533-86BD877E0446","scale":"37757160-FAF3-49DB-A740-7FA8241B46E1","intensity":"6A1FDEFC-D1D7-4CF4-9C40-CF46E2283CC3","factor":"9F68D3D5-84C2-4D54-A9FA-15F4690DBE15","alpha":"E1A77911-CB22-4062-9068-C15B30676CA1","mode":"C91C5A9E-55A9-4F95-B33A-6132DADF284A","calpha":"gE3309A094EC64A6487789C6EAA1CFC5F_calpha","nodeType":"Fresnel"},{"uuid":"9362697B-BDE3-4EFB-961D-214BD3855459","type":"f","src":"gE3309A094EC64A6487789C6EAA1CFC5F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F082178D-D77F-46C6-B057-92B3AF0A6922","type":"f","value":1,"nodeType":"Float"},{"uuid":"23AF1275-2A5C-472A-8A35-E0BA55149FBB","type":"f","value":1,"nodeType":"Float"},{"uuid":"355CDA1B-E1CA-45D1-8F86-D0E2F3FA694A","type":"i","value":0,"nodeType":"Int"},{"uuid":"A636C7FB-BEAC-46EE-A695-3AC629C92BBD","type":"f","value":30,"nodeType":"Float"},{"uuid":"FFF3E784-1F6A-4A36-82F1-BD53FB2A2518","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"DF55D1BB-5CDF-420D-85BF-A1143FAD23B9","type":"f","value":10,"nodeType":"Float"},{"uuid":"FEE42FD2-31E2-4873-ABBC-D9B7AAB19311","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"8026BAE6-0B7C-48F1-B160-482F5CC78D70","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8801479B-B3AB-4232-A4D9-053BAF322D51","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E4FE5718-1B88-4044-A0EC-7E6C22FAEC39","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"1CBCC15B-AAC5-47B7-86AD-F54FB48615A2","type":"f","value":1,"nodeType":"Float"},{"uuid":"B1575335-5942-49BB-8586-BAAD8E9C8E51","type":"i","value":0,"nodeType":"Int"},{"uuid":"E381E00D-CD83-46BB-9B84-E6F84A784166","type":"f","value":50,"nodeType":"Float"},{"uuid":"EC7872E8-69FC-40BB-9306-5B59046A99E0","type":"f","value":145,"nodeType":"Float"},{"uuid":"F6A5EE42-3208-4ABB-8815-BF1D370FB8FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"5E5187A8-7911-45EA-BEA6-183DEA3212A2","type":"f","value":0,"nodeType":"Float"},{"uuid":"9B5AE5D2-15DB-45FB-8928-CD6D364F070D","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"4882A344-B754-4712-BED7-7AA96C26DD8D","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"56ADD38F-760E-4139-A4C4-43E48B70BD98","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"A89168A8-C33C-4152-9824-3BB6E0BA4594","type":"f","value":1,"nodeType":"Float"},{"uuid":"E5C49550-AF21-4A13-B416-C719B3A186D0","type":"i","value":1,"nodeType":"Int"},{"uuid":"6223E778-EFEF-435F-B667-C29C69657376","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"DDF97204-F5D5-4389-96C0-10C69B04B102","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"D4CDE62E-F880-4250-8E42-5C196AE03A7C","type":"f","value":1,"nodeType":"Float"},{"uuid":"09F87260-97F0-4857-BF5E-1048A72C964B","type":"f","value":2,"nodeType":"Float"},{"uuid":"0217F182-3A1A-4BD4-B520-940CB0B92D00","type":"f","value":1,"nodeType":"Float"},{"uuid":"8517F9CF-2CF7-4559-B25B-D16FB5B183ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"F87EC7FE-2F4E-4604-AAA6-DBAF13E890A2","type":"i","value":2,"nodeType":"Int"},{"uuid":"625745D4-6EC7-4DC0-AE3E-3E63FD2FCF5D","type":"f","value":1,"nodeType":"Float"},{"uuid":"B05725E6-75F1-4501-8FB9-764F7CEBC00A","type":"i","value":0,"nodeType":"Int"},{"uuid":"438C0A3C-6FF3-458E-BFC7-636DD110948A","type":"f","value":30,"nodeType":"Float"},{"uuid":"A67FA534-0DC9-4639-BC90-CC73AE137B9D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"32923DF7-43EF-49C8-8459-E7BDE46DDE87","type":"f","value":10,"nodeType":"Float"},{"uuid":"ED8969CD-8D69-4B8D-A9AB-C1F528B5CBEC","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"89BB18DC-44DC-4212-8C91-FE486E78476D","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"6DF40A13-2B32-4D68-992D-09D6296A67AB","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"0D9339FA-3F8E-404E-9678-E49F77CA4EED","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"9D694CBC-D262-4B38-9F32-20F4CE2050AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"CFBB80B8-C6A4-4970-88BB-5B0CC8291098","type":"i","value":0,"nodeType":"Int"},{"uuid":"BD45FE4A-DF5C-4CA2-9439-7C020764F3A4","type":"f","value":50,"nodeType":"Float"},{"uuid":"470B1005-9D85-4D6E-897B-FECE4C605786","type":"f","value":145,"nodeType":"Float"},{"uuid":"4EC170EF-D657-4C82-B941-FCD093FA8C1B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D63002A0-95D0-45F0-9F90-437F31A37E17","type":"f","value":0,"nodeType":"Float"},{"uuid":"1DF22467-D7A0-411C-A839-FDEF8ADFC936","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"0A95535C-57DB-48C6-A9A2-C1AF4691E5CA","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"4D6D71C2-26F9-479B-80D3-B3F9CF50FDFE","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"7EBAF9E9-E441-43E5-A6B6-555FD43403D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"814DE14F-07E4-429B-A26A-EDE53536CA64","type":"i","value":1,"nodeType":"Int"},{"uuid":"8D43D247-0B3D-49A5-9E1F-494D266487FB","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"2DA686A1-CDC7-4BBD-8D59-62FA7788667B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C6C98562-F74C-4E62-9BCC-416D2B90CB1A","type":"f","value":1,"nodeType":"Float"},{"uuid":"FC07F089-F733-466F-9D51-2C481FCCF628","type":"f","value":2,"nodeType":"Float"},{"uuid":"FBD6321D-745C-450F-ADBC-010437916D90","type":"f","value":1,"nodeType":"Float"},{"uuid":"5C9C0CBA-40D9-4F8A-B797-6FEC7EBC7959","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D9BF42B-6165-40C3-AE44-D0BF6216144D","type":"i","value":2,"nodeType":"Int"},{"uuid":"E580F990-A83F-4809-ADC2-95CE2B455A52","type":"f","value":1,"nodeType":"Float"},{"uuid":"13D6E696-B3BE-439D-81DA-300B0D2A1691","type":"i","value":0,"nodeType":"Int"},{"uuid":"E22307B5-3535-4FE2-88C5-84B35F489961","type":"f","value":30,"nodeType":"Float"},{"uuid":"8ECA9995-50CD-495C-8EC9-AD4E5B64103F","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"417B91D0-6EFB-4458-B57E-9493D1EF5123","type":"f","value":10,"nodeType":"Float"},{"uuid":"3722C9AC-2309-441E-8281-D0135D49C5A2","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"E32213C3-C712-4802-ABCC-819462F429A7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B8AF1EEF-7ABB-4AF5-84F1-C3D8BD0DFEF2","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2D1778BD-130F-42C5-B5B6-E0430B5EA083","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"B3EA9299-9043-48D2-BB34-B3361171826C","project":false,"nodeType":"Texture"},{"uuid":"B3EA9299-9043-48D2-BB34-B3361171826C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"ADD0AC0C-982D-4DAC-A695-9E334E75EB38","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"39468017-09BC-4B2A-8359-F79F2C1AE2A3","project":false,"nodeType":"Texture"},{"uuid":"39468017-09BC-4B2A-8359-F79F2C1AE2A3","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A8942F68-99AB-4107-9A91-F1E293BF452C","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"3DA698D1-7E36-49C2-B5AF-D2E8CFC987C2","type":"f","value":1,"nodeType":"Float"},{"uuid":"148227CA-B136-4855-AD24-E5A8FD386B82","type":"i","value":0,"nodeType":"Int"},{"uuid":"FFFB9455-821F-4A9E-8E08-CFCC657A9860","type":"f","value":50,"nodeType":"Float"},{"uuid":"A2B7357D-4B21-45BB-8904-FBC354BAC852","type":"f","value":145,"nodeType":"Float"},{"uuid":"B947304C-0448-4F1C-9874-AB1C9B1164CE","type":"f","value":1,"nodeType":"Float"},{"uuid":"242467C0-77F1-44B2-A14D-5383A52F8CE3","type":"f","value":0,"nodeType":"Float"},{"uuid":"D5B92B8A-8A15-43AC-9F99-2696FEE45445","type":"v3","x":-61,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"21D676C2-DC03-4669-85EF-1868BD5742DE","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"DB354058-22D7-4C17-B466-B77577721C59","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"184DF8A0-515A-4BD0-8247-2AD1D39D95EB","type":"f","value":1,"nodeType":"Float"},{"uuid":"9B604177-6436-44AE-9317-FA738645091E","type":"i","value":1,"nodeType":"Int"},{"uuid":"934C3D5B-EF7F-42DF-9A6A-8889A765A782","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"C267B1EA-F53A-4512-B121-5A61AC2A9E25","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6CD932F2-E931-4023-B714-23CD7D3F8750","type":"f","value":1,"nodeType":"Float"},{"uuid":"115B4115-485C-4461-94DE-9E7E4D18A439","type":"f","value":2,"nodeType":"Float"},{"uuid":"C3A2D026-BE3C-4D40-A78E-2B15B23A190C","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1ED38E0-BAD1-4B31-A468-33E3209BF642","type":"f","value":1,"nodeType":"Float"},{"uuid":"4B6AF487-F6AF-413E-BBC6-89E76D3FE86E","type":"i","value":2,"nodeType":"Int"},{"uuid":"0ADE87FA-709F-4DED-B5D6-F90DA7179B33","type":"phong","color":"9B370F80-2A52-4501-B28D-C378D978A715","specular":"8ECA9995-50CD-495C-8EC9-AD4E5B64103F","shininess":"E22307B5-3535-4FE2-88C5-84B35F489961","shadingAlpha":"E580F990-A83F-4809-ADC2-95CE2B455A52","shadingBlend":"13D6E696-B3BE-439D-81DA-300B0D2A1691","afterColor":"A367A6CB-7A33-4ECE-8166-AA4561F436BA","alpha":"F2827247-1BDB-408F-8ADD-A56DD2A7C50B","nodeType":"Phong"},{"uuid":"9B370F80-2A52-4501-B28D-C378D978A715","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"A367A6CB-7A33-4ECE-8166-AA4561F436BA","type":"v3","a":"68F6077A-06B9-4A99-8468-64A1016D9EB8","b":"E841CB7D-2A9B-4886-86A8-3DF866D43F4D","alpha":"F9F7B149-D2A4-4C6D-855C-56260B94DF4E","mode":"4B6AF487-F6AF-413E-BBC6-89E76D3FE86E","nodeType":"Blend"},{"uuid":"68F6077A-06B9-4A99-8468-64A1016D9EB8","type":"v3","a":"CD181CE9-9212-412A-9AE3-312EC81C7660","b":"EBB61AB0-593E-4C01-82CB-1F508A092294","alpha":"C3A0170C-FE84-426D-A00B-FED1BD1A4FE2","mode":"9B604177-6436-44AE-9317-FA738645091E","nodeType":"Blend"},{"uuid":"CD181CE9-9212-412A-9AE3-312EC81C7660","type":"v3","a":"5167B7D4-E642-4FFD-9A7E-0F04E630748A","b":"068BB389-01B8-4AD2-BD7B-9DA51AD3B3FA","alpha":"C0E06B3F-E6AF-4736-9CD0-DC07EB4D65C7","mode":"148227CA-B136-4855-AD24-E5A8FD386B82","nodeType":"Blend"},{"uuid":"5167B7D4-E642-4FFD-9A7E-0F04E630748A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"068BB389-01B8-4AD2-BD7B-9DA51AD3B3FA","type":"v3","thickness":"417B91D0-6EFB-4458-B57E-9493D1EF5123","ior":"3722C9AC-2309-441E-8281-D0135D49C5A2","roughness":"E32213C3-C712-4802-ABCC-819462F429A7","alpha":"3DA698D1-7E36-49C2-B5AF-D2E8CFC987C2","calpha":"g068BB38901B84AD2BD7B9DA51AD3B3FA_calpha","nodeType":"Transmission"},{"uuid":"C0E06B3F-E6AF-4736-9CD0-DC07EB4D65C7","type":"f","src":"g068BB38901B84AD2BD7B9DA51AD3B3FA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"EBB61AB0-593E-4C01-82CB-1F508A092294","type":"v3","near":"FFFB9455-821F-4A9E-8E08-CFCC657A9860","far":"A2B7357D-4B21-45BB-8904-FBC354BAC852","isVector":"B947304C-0448-4F1C-9874-AB1C9B1164CE","isWorldSpace":"242467C0-77F1-44B2-A14D-5383A52F8CE3","origin":"D5B92B8A-8A15-43AC-9F99-2696FEE45445","colorA":"21D676C2-DC03-4669-85EF-1868BD5742DE","colorB":"DB354058-22D7-4C17-B466-B77577721C59","alpha":"184DF8A0-515A-4BD0-8247-2AD1D39D95EB","nodeType":"Depth"},{"uuid":"C3A0170C-FE84-426D-A00B-FED1BD1A4FE2","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"184DF8A0-515A-4BD0-8247-2AD1D39D95EB"},"nodeType":"Expression"},{"uuid":"E841CB7D-2A9B-4886-86A8-3DF866D43F4D","type":"v3","color":"934C3D5B-EF7F-42DF-9A6A-8889A765A782","bias":"C267B1EA-F53A-4512-B121-5A61AC2A9E25","scale":"6CD932F2-E931-4023-B714-23CD7D3F8750","intensity":"115B4115-485C-4461-94DE-9E7E4D18A439","factor":"C3A2D026-BE3C-4D40-A78E-2B15B23A190C","alpha":"F1ED38E0-BAD1-4B31-A468-33E3209BF642","mode":"4B6AF487-F6AF-413E-BBC6-89E76D3FE86E","calpha":"gE841CB7D2A9B488686A83DF866D43F4D_calpha","nodeType":"Fresnel"},{"uuid":"F9F7B149-D2A4-4C6D-855C-56260B94DF4E","type":"f","src":"gE841CB7D2A9B488686A83DF866D43F4D_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F2827247-1BDB-408F-8ADD-A56DD2A7C50B","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1280,942],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/motion_dark/index.html b/site/spline/design/motion_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/motion_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/motion_dark/runtime.js b/site/spline/design/motion_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/motion_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQV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m4CwQ9hWIFgBTK0gQHiIAJddKq0ELQh+KL1qUR4MvSEsoENIKrgALHNiMox+94K7tl9qnnMio8MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/motion_dark/scene.json b/site/spline/design/motion_dark/scene.json deleted file mode 100644 index 5b16d88f6..000000000 --- a/site/spline/design/motion_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"B17A57C5-8F51-41A0-8755-72E1FB03E9BC","objectType":"Mesh3D","name":"Cube copy 2","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,137.90758729968002,76.4702603787693,-6.5271211759586265,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"57F7F0F1-9160-4D05-B547-492FD797C0C6","selectedState":0,"states":["76F3D3D8-C0FE-43DB-97E3-24EF46F53E97","6434020B-1738-409D-940A-40BC5E7AFC0E"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"B17A57C5-8F51-41A0-8755-72E1FB03E9BC","state":"6434020B-1738-409D-940A-40BC5E7AFC0E"}]}]},"geometry":"AADA6F5F-F0A7-4393-A05D-AA7C85C12C2E","material":"503711A0-22FA-40CF-AEB2-CC380A4AF5F2"},{"uuid":"C3B2E80D-6C99-48E6-8BD0-73EDB1A5A2D2","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,2.954213988821323,78.13947375637262,-1.8278986208817116,1],"layers":1,"children":[{"uuid":"F97FD6FE-E22D-4DD1-BCE2-2F71029626A1","objectType":"Mesh3D","name":"Cylinder copy","matrix":[2.220446049250313e-16,-1,0,0,1,2.220446049250313e-16,0,0,0,0,1,0,42.05670039544452,21.270172757933196,11.392801428715757,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"47B339E8-A06D-4884-B232-7E753E4FEC6E"},"geometry":"B1A12F64-6790-4718-84AB-2DBE0DCCE1A1","material":"C3DD5022-8493-432D-A617-55FC4590C9F2"},{"uuid":"559A35DF-5BB6-4A83-B12F-73C5429C6C67","objectType":"Mesh3D","name":"Cylinder","matrix":[2.220446049250319e-16,-1.0000000000000027,0,0,1.0000000000000027,2.220446049250319e-16,0,0,0,0,1,0,-36.23980155547658,143.6527982924297,11.392801428715757,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"6E237F15-790D-44CE-9AB0-72F68758A37C"},"geometry":"2192791C-A7AC-42D3-96C3-3E240F1BD070","material":"9E0F3B68-57F6-4B71-B7B6-D702A7527920"},{"uuid":"F425145E-E6ED-4457-881D-378DF6F62DA1","objectType":"Mesh3D","name":"Sphere copy 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,90.56466933672507,21.242780482544255,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"6F0F2894-2EF3-42A2-838F-AB974F041012"},"geometry":"01C7447A-33BC-4B1C-926F-19EF39BB716F","material":"E841A653-618D-4776-BA29-2FB8CE576429"},{"uuid":"C45162AD-DA7E-4281-BCA1-E1D253C8597A","objectType":"Mesh3D","name":"Sphere copy 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,8.80774252186879,143.58618168048997,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"9A591B65-8A73-40DA-A544-D0CC91792CDF"},"geometry":"EAB665F0-1E40-40ED-8A8B-1AF8C8A170F1","material":"4BA93924-95E3-4528-8523-83CFE58A5294"},{"uuid":"67BF6A0B-FC48-40F1-8E98-14FDD90905E0","objectType":"Mesh3D","name":"Sphere copy 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-6.667675768086212,21.534769506883023,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"5B6AA930-EE3A-4AA7-870B-72143B9C2CAD"},"geometry":"EF63957E-2C9F-47E5-8CD3-437DC979027D","material":"BE7CE294-2B22-4BB6-9666-5B094E9FDD18"},{"uuid":"E485A7C6-2777-40E1-96FA-DF2CB158C194","objectType":"Mesh3D","name":"Sphere","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-81.503769157484,143.58618168048997,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"5F1E2E88-30B9-4D84-8313-42AED0AC6242"},"geometry":"2C906C9F-2923-4218-B693-A73CE3780456","material":"8C6DAD48-F9AB-4518-AB2A-472527A999AE"},{"uuid":"2B5541D2-AB4C-41CE-89AD-82B88248DE37","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,-81.35756293409446,147.00027808555518,8.705871452201706,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"8C197049-73D6-4544-B6F0-A476BA07AFEF"},"geometry":"53729C3F-2799-4F0B-A3A5-EBC6A189061D","material":"0EA391CD-6B3A-4B19-9C33-5D3A1DE4E52C"},{"uuid":"B1FB1FBE-AD71-4B9C-9F58-A90D73AB5228","objectType":"Mesh3D","name":"Cube copy","matrix":[-1.000000000000002,1.2246467991473557e-16,-1.2246467991473557e-16,0,1.2246467991473532e-16,1,1.2246467991473532e-16,0,1.2246467991473557e-16,1.2246467991473557e-16,-1.000000000000002,0,2.954213988821323,83.99022153089638,-4.134692519274716,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"560B628E-64D5-4014-9092-06D2B237F31F"},"geometry":"BB1C0DE3-F3CE-48BC-BA42-676289AC1A9B","material":"77E4C3A6-37E2-47F5-8F2B-A0BB9D0E3900"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"47019A9B-7552-4B72-BFCD-80E9E5519C68","selectedState":0,"states":["87316550-1E80-4D93-812A-E30C4F2C1BB8","67F4F780-4587-499B-9C8C-1855F5291534"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C3B2E80D-6C99-48E6-8BD0-73EDB1A5A2D2","state":"67F4F780-4587-499B-9C8C-1855F5291534"}]}]},"enableHelper":true},{"uuid":"6DF8EF9D-4969-49CE-9867-D9DFD3BA5C7B","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,190.26681927331737,-159.5397649553094,-28.830959561123997,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"interaction":{"uuid":"8B68A2AB-CB42-4A68-AE4E-57F410F3AD14","selectedState":0,"states":["E884E1FB-F8AC-4609-88A1-2C3691B8B577","F6E92645-97C1-4C61-BDD0-6F1A023B0AFA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6DF8EF9D-4969-49CE-9867-D9DFD3BA5C7B","state":"F6E92645-97C1-4C61-BDD0-6F1A023B0AFA"}]}]},"geometry":"68ECBCF5-158E-4504-9BAF-937F6946514F","material":"E023AA4E-72C0-45F5-A35C-93AA51F04976"},{"uuid":"2E392C70-83E7-4698-904A-F180E6CE0C6B","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-300.55442995952353,-46.750852213019925,76.91744823804856,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"interaction":{"uuid":"31134673-4CA5-4BBE-B617-C0567EED6A57","selectedState":0,"states":["F8DF091B-7F4E-4E22-AA76-164CA17904BF","78BAA5F5-DCF6-4433-B914-069B752D2512"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"2E392C70-83E7-4698-904A-F180E6CE0C6B","state":"78BAA5F5-DCF6-4433-B914-069B752D2512"}]}]},"geometry":"B10604B8-AE2F-467B-A3AE-03B1D2A699A3","material":"D96682C1-5DAA-4F0B-93A1-8F03D36D37E2"},{"uuid":"FCE0A118-CD8B-412A-BE04-206D71B2D77E","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,322.9830495527491,88.12453841135351,59.80926803392561,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"interaction":{"uuid":"182BA99F-D8FA-418D-ACCD-00844B394AAF","selectedState":0,"states":["BDB622D7-D927-47AC-9E80-49747997AA65","79524652-4473-4CEF-BF5C-86A2B405CE97"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"FCE0A118-CD8B-412A-BE04-206D71B2D77E","state":"79524652-4473-4CEF-BF5C-86A2B405CE97"}]}]},"geometry":"AD29A3D6-6999-4035-B5D6-8DB8FD78CAF2","material":"43DDEC5E-79EA-4DD3-97D5-5606A81A0081"},{"uuid":"EF8D6619-6CF1-4DAB-8DD0-D2B5B82B46C2","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,87.37781944740044,-159.5397649553094,-28.830959561123997,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"interaction":{"uuid":"1D267C79-C77E-45DF-84D7-39246886FDCF","selectedState":0,"states":["12BFC9EE-BBBE-4EC8-91CA-8A4E87E56B42","23D17C53-8A88-4F03-9C13-60DE36EF8546"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"EF8D6619-6CF1-4DAB-8DD0-D2B5B82B46C2","state":"23D17C53-8A88-4F03-9C13-60DE36EF8546"}]}]},"geometry":"9D02F665-0052-48CA-9BAE-0EE141881D0B","material":"DEFAB71C-2BB7-4119-90EE-034DB126D40C"},{"uuid":"C4BB147F-7B94-42D7-8DCC-4F8F5B5CE775","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-132.08367510706478,76.4022285497829,-6.49995961386103,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"480E10DE-E0FA-4EDB-A975-2890EDC3E9BD","selectedState":0,"states":["6D4BDFA3-7BB9-465C-835B-427EAA005D77","F60C7DE0-999F-41F9-9E73-72961BBBE7E1"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C4BB147F-7B94-42D7-8DCC-4F8F5B5CE775","state":"F60C7DE0-999F-41F9-9E73-72961BBBE7E1"}]}]},"geometry":"13B73AF4-801E-43E3-A486-4265268FC915","material":"01E9CFF8-2883-42AE-9C98-E258744C3DCC"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.9371749745620865,0,-0.3488596667064745,0,-0.0902142487257256,0.9659851534004793,-0.2423511352082036,0,0.3369932586586939,0.25859753171647265,0.9052971115654477,0,332.08033859735286,310.4692493894335,892.3968118149419,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000028,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"DF328879-9A33-4E6E-A330-E22695209A02","objectType":"CombinedCamera","name":"Camera","matrix":[0.9173445553172563,-1.3877787807814446e-17,-0.3980941682941157,0,-0.11033006064925811,0.960827922978237,-0.25423803834685715,0,0.38249999287178427,0.2771456339640352,0.8814102637408745,0,-182.44144610539303,338.74895720060044,1005.7887463415708,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9449B3EE-C571-4D0F-8C64-5F87EB3B6B7E"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000055,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50}],"activeCamera":"DF328879-9A33-4E6E-A330-E22695209A02","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"AADA6F5F-F0A7-4393-A05D-AA7C85C12C2E","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}},{"uuid":"B1A12F64-6790-4718-84AB-2DBE0DCCE1A1","userData":{"parameters":{"width":5,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":0,"cornerSegments":8,"hollow":0,"height":88,"depth":5,"radiusTop":2.5,"radiusBottom":2.5},"type":"CylinderGeometry"}},{"uuid":"2192791C-A7AC-42D3-96C3-3E240F1BD070","userData":{"parameters":{"width":5,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":0,"cornerSegments":8,"hollow":0,"height":88,"depth":5,"radiusTop":2.5,"radiusBottom":2.5},"type":"CylinderGeometry"}},{"uuid":"01C7447A-33BC-4B1C-926F-19EF39BB716F","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"EAB665F0-1E40-40ED-8A8B-1AF8C8A170F1","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"EF63957E-2C9F-47E5-8CD3-437DC979027D","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"2C906C9F-2923-4218-B693-A73CE3780456","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"53729C3F-2799-4F0B-A3A5-EBC6A189061D","userData":{"parameters":{"width":68,"subdivisions":40,"roundness":0,"extrudeDepth":10,"surfaceMaxCount":1357,"extrudeBevelSize":4,"extrudeBevelSegments":5,"height":68,"depth":10},"shape":{"points":[0,0,-6.899526655042213,8.449483233729296e-16,96.55999999999992,-1.1825189492566843e-14,0,172.03999999999996,-121.04000000000005,56.44000000000009,-121.04000000000005,178.75441860504114,-121.04000000000005,0,172.03999999999996,-129.7364782131769,179.1922816834845,-129.7364782131769,49.640000000000036,-129.7364782131769,0,0,-8.965789692969132,88.70057880514207,-8.965789692969132,-6.461663576598593,-8.965789692969132,0],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"BB1C0DE3-F3CE-48BC-BA42-676289AC1A9B","userData":{"parameters":{"width":225,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}},{"uuid":"68ECBCF5-158E-4504-9BAF-937F6946514F","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"B10604B8-AE2F-467B-A3AE-03B1D2A699A3","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"AD29A3D6-6999-4035-B5D6-8DB8FD78CAF2","userData":{"parameters":{"width":130,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"9D02F665-0052-48CA-9BAE-0EE141881D0B","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"13B73AF4-801E-43E3-A486-4265268FC915","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"503711A0-22FA-40CF-AEB2-CC380A4AF5F2","type":"ShaderMaterial","reflectivity":{"uuid":"C459FF42-A116-40C2-985D-6C2CA48CDEBC","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"252B575B-A253-4AD1-8B9B-404F376CE582","f0_alpha":"B2E1D314-0D44-4D91-B362-98BF29FF66BA","f0_mode":"3D4590EB-AEA4-4B2F-8FE3-7C03DAD25541"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"35C2306B-821E-47B5-AC1E-0EA893AF1BD7","f1_mode":"D946A313-FC4F-4B3A-98DB-1085FF0BCCBF","f1_roughness":"153E0EC8-D73B-473E-B47E-F5F97AC93CA5","f1_metalness":"4C907E7A-3706-42C3-908D-FA71C68634D1","f1_reflectivity":"C459FF42-A116-40C2-985D-6C2CA48CDEBC"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"16205074-C623-4929-98F7-4F91947C80F2","fragment":"16205074-C623-4929-98F7-4F91947C80F2"},{"uuid":"C3DD5022-8493-432D-A617-55FC4590C9F2","type":"ShaderMaterial","emissiveIntensity":{"uuid":"681485A2-659B-41BC-981C-E8327546AAB5","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"5EA61CA9-B931-46A2-B0BF-FEB360344021","f0_alpha":"614AA6A3-631A-42B0-9557-32F849B3F9ED","f0_mode":"F494F255-5898-4B4E-A056-432B7DDF2BDB"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"70FB7CC4-7FF5-4103-9A82-8CEA2EFC41FE","f1_mode":"E0D08964-14AC-4A90-920C-60DD3CA365D3","f1_emissive":"F14893B0-DFA3-45DE-ACC3-BAB890B358AE"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"B34BB8CC-DB09-478C-BBE8-FF5D83A3DA10","f2_bias":"6F92C17A-D3DC-4003-838B-AD983860B187","f2_scale":"4B5EC93A-8ABB-4E78-B1D9-F99BEE53E014","f2_intensity":"CD6F1C68-A53C-452E-B79A-F75D872D7BB0","f2_factor":"E6EAE69E-3656-4F35-B0FE-969376A4C59D","f2_alpha":"9F236ADE-134E-4B4A-8F36-14DC83E8BDD7","f2_mode":"7090E433-8E3C-4AA3-BF6E-49D0A5041821"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"6A7AAE26-CD50-4D88-B01F-023629105180","fragment":"6A7AAE26-CD50-4D88-B01F-023629105180"},{"uuid":"9E0F3B68-57F6-4B71-B7B6-D702A7527920","type":"ShaderMaterial","emissiveIntensity":{"uuid":"14C59321-AAAD-4EE8-8969-526CAEB8E4D3","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"E256C00C-D2F7-4DB8-8A55-B1117FD49BE9","f0_alpha":"EEF2648F-076A-4D65-8783-712EB8E1FF97","f0_mode":"64E8B203-F73A-4B93-B4C7-AC4A822BAA18"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B61FF07A-18CF-4BAC-B00F-1A4E59C3564E","f1_mode":"BA85F5DD-7D45-452C-950A-1A9A2499D524","f1_emissive":"3453E61A-9C53-48E1-98CF-1817644A5EC4"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"34717949-7F97-464D-8067-0B84D698A2A2","f2_bias":"225A3837-3574-478F-B854-96E408D2496F","f2_scale":"D5C9CC60-92C9-47C6-BFF5-5D53C0DC48EC","f2_intensity":"E9A804CA-0A41-44A3-88EF-65EDEB32E238","f2_factor":"DAF20AB8-367B-421B-BFFE-82BCC9E10743","f2_alpha":"7784C0C3-A5DE-40D3-B2E8-A44979EE02A7","f2_mode":"B5AF7634-D9C8-45FE-8579-870870DF304E"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"6D84001B-386E-4628-B3E7-4DA9432440A3","fragment":"6D84001B-386E-4628-B3E7-4DA9432440A3"},{"uuid":"E841A653-618D-4776-BA29-2FB8CE576429","type":"ShaderMaterial","emissiveIntensity":{"uuid":"60C85E54-3B36-4050-91EE-CE4C17903E17","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"D29BD60A-3D5E-4C2B-A893-38F5B1E5CB06","f0_alpha":"F50AF688-F4F5-4474-868E-DF9F17837767","f0_mode":"1DCF4878-9885-4DD7-BBAB-445251932B2D"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","f1_mode":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","f1_emissive":"3D917379-0998-4D51-9EA3-D5C7365F4D0D"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"E64AE1B9-68F0-4A80-8FC6-3D1E92947BD7","f2_bias":"989B6805-81B5-4712-9E1F-14D82B75265F","f2_scale":"3069171F-7C6A-437E-8FB2-C326653F5BEA","f2_intensity":"C7A1732F-F106-47BD-886E-26F61F0710C4","f2_factor":"4105C692-8752-4315-BBB4-8C997417D136","f2_alpha":"6DFB5718-E8EB-42DA-9C55-604C857E95D4","f2_mode":"57D20FB3-4F57-48C0-9C98-086D43B5AC33"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA","fragment":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA"},{"uuid":"4BA93924-95E3-4528-8523-83CFE58A5294","type":"ShaderMaterial","emissiveIntensity":{"uuid":"8B20C529-AA62-469F-BB75-DB0B8A0450D1","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"EE0EA418-AC33-4B49-BA1F-C2ACC85E7381","f0_alpha":"E9445059-1DE4-45D7-9C26-18A0A851E1A3","f0_mode":"8428A4AF-B9AF-48CC-94C2-AF69FF811DA5"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C45FC0DF-8D80-494E-A3BA-17E02DC52439","f1_mode":"5658B1F2-37D3-4A50-8AE2-65E7C2017256","f1_emissive":"2F21822C-B057-4958-BE46-8C4B765C8828"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"DCCE7E0D-00EC-4F25-9761-9E8403DE1FA3","f2_bias":"406EE507-E5C0-41D7-B8F4-C1ACAF00EC2C","f2_scale":"C1DDC860-59D9-4AE1-9FC4-90B12999D1C5","f2_intensity":"D06E011C-6216-44E8-90A4-91DCB466056E","f2_factor":"3132D6AB-4C06-4AE3-9309-93C2F274A458","f2_alpha":"C9F654FF-901D-486F-B1E7-71081BECFB69","f2_mode":"A2DB18B0-A65D-420A-A5EA-D7C9DDE4CFAD"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"69FECCEB-56C4-4E11-AC0E-B48CEFBD5E6A","fragment":"69FECCEB-56C4-4E11-AC0E-B48CEFBD5E6A"},{"uuid":"BE7CE294-2B22-4BB6-9666-5B094E9FDD18","type":"ShaderMaterial","emissiveIntensity":{"uuid":"CFA0A4D4-57A5-4E03-8925-E3528B642114","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"DB08A76E-9E27-4C9C-AAF8-5FC7079963DF","f0_alpha":"CA89ECFD-A871-47F6-B967-ADD64B964805","f0_mode":"2EF5ADA6-A8E9-4335-8C00-CDD56F52C3D7"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"76CD261D-D0C4-410E-8C8A-1B35E060F74B","f1_mode":"1FB23671-5A6D-4F97-9017-7C2EF9AFA345","f1_emissive":"249F43D3-5E05-4803-9E31-7E7FE0D7708C"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"AF9D9524-D4FF-4142-979D-8DADEEF82398","f2_bias":"74430D8F-5C82-4F39-A1ED-B006B7107F64","f2_scale":"A9D3E0B7-1FF0-4DC3-9389-4BDEBDAC3343","f2_intensity":"40440BBD-DF38-4691-A65E-607F9608E0A5","f2_factor":"BE81D005-0E66-4BA7-9732-A2C96F61D7D9","f2_alpha":"5F1CDE3F-3B06-43F8-A272-56F6D7A42562","f2_mode":"ECD2E5E2-8B8E-42C6-88FD-AFC07010253E"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"134637A2-CF8A-4844-9F32-67B6E363B903","fragment":"134637A2-CF8A-4844-9F32-67B6E363B903"},{"uuid":"8C6DAD48-F9AB-4518-AB2A-472527A999AE","type":"ShaderMaterial","emissiveIntensity":{"uuid":"2207B41C-8D1D-49C0-8BC3-845A0B23381F","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"61D745B5-78FA-4644-AA39-6E64AE3BA5F7","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"0D1A69CD-51FE-46AF-9CC6-262CC5AF8961","f0_alpha":"A3DA701C-3934-4E61-B6B7-D4C60A3E5DA2","f0_mode":"7794005B-AD35-4EC2-BAA4-A5E4B5A0577C"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"EC56F17F-307F-4FA7-A411-604A93E483A4","f1_mode":"70ADDE56-E880-4586-9343-E479934BBA36","f1_emissive":"0D9B1AE4-B313-40E2-AA3B-12F337A9558A"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"B53599A3-AA2F-4EFC-BC3E-8701681875C9","f2_bias":"D5FAE4A3-8670-4829-ACCB-7D3CDDE2AE7A","f2_scale":"3030775E-876A-4F67-A782-BA330F51CD50","f2_intensity":"E9E2AB17-47A1-4AE3-9A6A-24D94FB10792","f2_factor":"EC9385BD-C519-4BCC-AB31-C3A4D94B9B84","f2_alpha":"42087A01-282F-4D11-91CF-D1F93D150D77","f2_mode":"F3B91877-D268-4069-A8FA-584A190982AF"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"FDCDE597-F1F0-4FCD-ACC9-AAEC20BC3831","fragment":"FDCDE597-F1F0-4FCD-ACC9-AAEC20BC3831"},{"uuid":"0EA391CD-6B3A-4B19-9C33-5D3A1DE4E52C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"87E13DA1-42C8-4C17-80B3-F47620FAF571","f1_mode":"7E8A7538-AE30-4E1E-A4EF-D69411DBD202","f1_shininess":"0638749A-8536-4333-B75E-B3F5ED68C3B0","f1_specular":"B16EDF1D-FF51-4252-8050-030FC6A707BE"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"83210073-F315-4A37-B571-4F9F619D8418","f2_ior":"4E3B4D20-E534-4F4B-8198-922A9C53CEAF","f2_roughness":"DF0831F5-C6D6-4A39-8CDE-0EEAB6A01988","f2_transmissionSamplerSize":"C5E8F300-3E56-4C97-8142-CEF6DF818791","f2_transmissionSamplerMap":"203AE677-D7DB-410A-BD73-AB820FE5430F","f2_transmissionDepthMap":"BC931284-B29F-46F7-A290-7562A34085C7","f2_aspectRatio":"76D375B6-A285-4C62-A0F1-D644D2BBB2CF","f2_alpha":"6DD5D33D-0F8B-4375-99DE-A9641DEED01F","f2_mode":"5F1AA961-8D51-4726-A979-99B2CEA050F3"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"DA108BEF-32C2-44E8-98F8-216BFCBC1CFD","f4_far":"F3B7F36F-19D3-4B1E-82CD-68B00B77A42B","f4_isVector":"934FE451-CC20-441C-9EB9-4AA23A81DE23","f4_isWorldSpace":"F85660FD-36B3-4945-8DCE-94BF946D1130","f4_origin":"C946A3EA-80AE-4B9A-B0FD-34A8FD0DFCCD","f4_colorA":"3C0F57FB-6898-4502-BFB5-4A0697546B4F","f4_colorB":"8C705B0F-0964-4945-A663-B8B968651848","f4_alpha":"646F2943-AF0E-4353-814E-A292B0335D10","f4_mode":"90DA77CA-D899-4836-9F9D-5133FB678BFB"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"96DAE8F4-210D-40C5-B850-CC6D742D8912","f3_bias":"2F06FE68-FB68-4707-8516-B60DBA03E7D7","f3_scale":"FB379027-10E1-4978-80A9-509F78D5C95B","f3_intensity":"64322DF6-DCE1-4B43-83CB-E234875F9FB3","f3_factor":"2436F695-E4FC-4E54-BD44-FDBF6AA2AEDE","f3_alpha":"084124E5-82A9-4CFA-8DB4-5D38C2BA52A3","f3_mode":"DB09C976-5506-40FE-91B1-F04085EA06FD"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A0548EAF-25E9-4709-8C52-91E08FB1BF2E","fragment":"A0548EAF-25E9-4709-8C52-91E08FB1BF2E"},{"uuid":"77E4C3A6-37E2-47F5-8F2B-A0BB9D0E3900","type":"ShaderMaterial","reflectivity":{"uuid":"2C22527A-B375-442E-93F4-085D007A3E73","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"95F26D7D-BA27-424E-A4BE-4A01E6A300BC","f0_alpha":"39BA69A0-3834-4F00-84EE-DEA2015A9BA3","f0_mode":"C937F351-D680-480A-9B2C-3B1654DBF0B6"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9EA8F58E-A1DF-4E86-AA79-D19D2069078B","f1_mode":"C6EE4475-6964-47CA-BD89-01618D8CB2EC","f1_roughness":"18553466-292A-483D-BE43-EE84F40039C3","f1_metalness":"79C0247B-DB76-43D6-9840-89E175A57D8D","f1_reflectivity":"2C22527A-B375-442E-93F4-085D007A3E73"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F4E56EA1-3060-4144-B249-3E5C50E85030","fragment":"F4E56EA1-3060-4144-B249-3E5C50E85030"},{"uuid":"E023AA4E-72C0-45F5-A35C-93AA51F04976","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"318F0D77-D7EC-4B82-A7C3-A24697A8048F","f1_mode":"63A5B57B-5561-455E-BEF5-64DA3101DBB7","f1_shininess":"AFAF1D36-4764-4CD9-8219-D16E486CFD93","f1_specular":"91772534-8A5E-4FE2-BCC6-A2C837BBD6B6"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"09A32EFB-4581-47EE-BDE6-CD6A56412B2F","f2_ior":"D6139FAE-3B5E-459C-A4C8-C000D9D2C0F1","f2_roughness":"E2EE7B80-464E-4252-96B7-BC791AE84B26","f2_transmissionSamplerSize":"3ED88640-F460-4E1C-99E1-CA11D991D5F7","f2_transmissionSamplerMap":"2202EAF7-7D14-413E-BAA3-3474168CF641","f2_transmissionDepthMap":"3FF035CB-CF69-4B5D-B07A-75EE1D7A98BC","f2_aspectRatio":"88C1022C-6424-4E13-B9D2-A423FBD3B9CE","f2_alpha":"B3C645B7-A93B-40AD-A095-A7CA8C669721","f2_mode":"8028CD80-BD53-4270-B26A-6BE90B39B51C"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D57B4DCC-61FB-4E80-A64F-899F62D4C92E","f4_far":"05E4A5B3-35F5-4607-B3B1-EF2DA3D8D67B","f4_isVector":"A38E8507-4316-475D-9C1C-3F3423DDC3FB","f4_isWorldSpace":"D7593924-791D-4463-9FBC-0ADD2BDC0696","f4_origin":"B93CD317-8AA9-4C44-AAE2-F846053BA781","f4_colorA":"3D9A6CD8-39B5-40C4-9EF1-59B3258EB964","f4_colorB":"E86089A3-357B-4F5D-A1F9-120F563B16F9","f4_alpha":"4CD15E50-6FF6-4591-90FA-BAC91847B6D4","f4_mode":"3F4F4DBD-1BEC-4064-A905-EF4DA1B0CD78"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"48EA2A22-6B48-4BC6-87AA-0C80C483CBA4","f3_bias":"6BE25311-FB05-4348-BCCA-2B071116A647","f3_scale":"D23FF5A9-DEB4-4E81-8C76-8D6E90F81EA7","f3_intensity":"51EECCE0-C525-4CA5-916A-244DC115F908","f3_factor":"E61D55B6-6B8D-490B-9CA7-0FA1FA2576AB","f3_alpha":"0201118B-7E1F-4D9F-AB4F-02A28DD8FD7B","f3_mode":"2ECDCC4E-BDFC-4B6A-8425-3EE6636EEDBD"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"12461F29-50EA-440F-BBAA-FA3BD60164DF","fragment":"12461F29-50EA-440F-BBAA-FA3BD60164DF"},{"uuid":"D96682C1-5DAA-4F0B-93A1-8F03D36D37E2","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"2F7A48BE-0F5E-4E77-8478-618BB9CBCF20","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0DD29953-061E-47B7-AFB2-7D9C1515BBA0","f1_mode":"A1D0056C-0460-46CE-8CA2-CDC467147739","f1_shininess":"7EA172C3-FFBD-463C-8855-CB5BD609948C","f1_specular":"17165DDB-7B22-416A-BB88-53AF00383BC5"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6678F259-C5C9-497E-8F31-10C0EFB845C6","f2_ior":"7DB8AB38-6FD8-4FC6-9C72-E0D03AA6430B","f2_roughness":"23CA44CA-4F4B-4E66-8FA8-0EABD50452A7","f2_transmissionSamplerSize":"4BE373AA-419D-46AD-B322-345E6F2028C4","f2_transmissionSamplerMap":"330A2E80-ADF4-4412-BCEA-22AC875FD67A","f2_transmissionDepthMap":"24905E61-6034-4CBF-A6C1-6C6DFEA7982D","f2_aspectRatio":"2840E484-F667-4C14-B7CD-236C923F75B1","f2_alpha":"D50BAD37-51E1-482E-B2AA-D5202534EE1D","f2_mode":"C3B2B868-48C7-45FF-8FED-6B50BB8A6BF1"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"BF857070-8FD6-4726-B639-C6ADACC456DD","f4_far":"043B10F2-9D72-4A60-B681-2069FE4D88F6","f4_isVector":"0B493D1A-6C01-465A-B8DA-EE5C055F4885","f4_isWorldSpace":"79A4A3E4-D819-428D-A50B-ABBA1313A4BD","f4_origin":"A407C1D5-F5AB-4F92-B999-529AE1399FF9","f4_colorA":"330FF2F9-ED11-48F7-AE58-6E2C053E6626","f4_colorB":"0BCA820F-5DEB-4A86-84AE-FDCBC88A7D29","f4_alpha":"52471F4B-B7C1-4BBE-A9FE-0BA0B6F87D45","f4_mode":"5F6C7ED5-A279-4841-9111-4F1D28EC1A48"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"0BAD0460-3098-4692-8E1E-B095A72A7153","f3_bias":"980BBE0A-928A-4A10-82DB-79DBA9703D9E","f3_scale":"685FCFF1-A6A0-4E3C-91BB-BD4573C5D0C0","f3_intensity":"521D422C-C4B6-468E-B16C-F8DB5610487E","f3_factor":"40827185-B8F9-4227-A0B3-B27289C04C11","f3_alpha":"3B17C9FD-9884-4BA0-8926-C57885FE149A","f3_mode":"21FDC273-6D98-4DDE-823F-708D6029BF10"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"0B4E2BDC-7596-43EA-855D-ECD5A9BEC36B","fragment":"0B4E2BDC-7596-43EA-855D-ECD5A9BEC36B"},{"uuid":"43DDEC5E-79EA-4DD3-97D5-5606A81A0081","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E4AE45E5-71DC-4B86-84A0-0D41D5C42CAC","f1_mode":"C0F8BB8D-989D-43ED-9D76-630E7A5F175E","f1_shininess":"12663258-A5F9-4BE1-B5B9-0803D809B00E","f1_specular":"9A2933C0-14C9-4844-998A-3FE9FC997053"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"9F3CB2F5-6B00-4890-8A54-08601509117A","f2_ior":"1D8D3D95-3314-4DF5-91F4-0309E1E4318D","f2_roughness":"D4CBAA6E-16DC-41E8-AF5B-45313BBC5CC7","f2_transmissionSamplerSize":"7CC872C8-6250-453E-8E74-D4F1EAD7433A","f2_transmissionSamplerMap":"EFF73A3C-AD95-44D1-B03F-6635888E23A0","f2_transmissionDepthMap":"D33A8471-8821-43F2-914E-0C8A80E6D738","f2_aspectRatio":"77386A90-F434-4705-8805-A031DD263E5B","f2_alpha":"81AF7FAA-7285-4748-8E09-8F05DFAB07BD","f2_mode":"750F1D4B-912A-46A7-9084-7AC44EC573C4"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"7A01D04D-58EA-4FA3-A77A-0B9AC6FAAE5A","f4_far":"C5B56D22-56FC-4E53-B7EF-F08D3F9A1FFE","f4_isVector":"741B31C9-15EC-453C-9DE8-06DA97A224AA","f4_isWorldSpace":"86A9EAB3-6FA9-49A1-A57E-0B416B7CFED6","f4_origin":"67AB4424-4D15-4F54-B3B1-37CA9E1E8CD1","f4_colorA":"BEE365C4-EA46-4B60-9E27-904B627D529A","f4_colorB":"01FAFCD0-13BC-4B43-8818-75D7DAA8F3F9","f4_alpha":"BF08904E-5DBD-4618-8C58-F4F1693C9AA7","f4_mode":"7F214A96-8F56-4976-8D9C-BAE67DA1712E"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"445B200F-0B8C-43F5-B344-EBC0B47BBBEF","f3_bias":"8ED40C68-445D-4025-B222-E114D2E5ACD8","f3_scale":"816E458D-B720-4A0E-B225-E31A6AF972A1","f3_intensity":"956C8EF0-C364-4E30-AA12-D8D5756C01DF","f3_factor":"E28504FB-3857-4AB8-9B21-F3EDB8B85D09","f3_alpha":"F786749F-9833-435A-B766-FE9EA95D5C10","f3_mode":"893EA6CB-095A-45DE-BA1C-B568AAA2EEE3"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"66867F7A-4CEF-43DA-9AA6-E98DC20B0DB6","fragment":"66867F7A-4CEF-43DA-9AA6-E98DC20B0DB6"},{"uuid":"DEFAB71C-2BB7-4119-90EE-034DB126D40C","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"F9A7D9F6-8F76-479D-89D9-4CAF64B64200","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C8FCDDC4-20A1-4F59-B1A0-CA846E41F26A","f1_mode":"4695114D-676A-4314-A9F3-4BCC92588C91","f1_shininess":"8E71BDD9-A69A-4895-8B24-1329F1EA21C5","f1_specular":"00E286EC-3F96-4536-8D6F-135C159EB860"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B9CDF9E1-97D7-404A-B4D7-31517084C823","f2_ior":"DF97269D-3C95-4A20-AB63-2A2890CDEAC0","f2_roughness":"60F94C58-E616-47EB-8B51-CD165C07F353","f2_transmissionSamplerSize":"1AEA9D48-AE85-44CC-B3F6-B49ED10190BB","f2_transmissionSamplerMap":"09B36BA0-4D87-4FBD-A710-54497789FC4F","f2_transmissionDepthMap":"1ACABDC8-103F-4F83-81AB-7F8B03A0F109","f2_aspectRatio":"337BBF59-704E-418A-9C95-BE1DCA92EFF2","f2_alpha":"EEB96118-F67B-4E11-A366-943CF5ECFF59","f2_mode":"589625BD-A951-4BF7-A7F1-48FEE253ACF8"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"292840DF-A233-4149-B619-E42D6087AAD4","f4_far":"0905777C-3F48-4EB7-AA77-755E108D2B61","f4_isVector":"6E2E5808-18EE-4065-8EA1-468A6B1FFA5A","f4_isWorldSpace":"545E40FA-5562-468A-BC7D-6AAED8FBA7C8","f4_origin":"94490DAC-1BEF-48EA-B131-B8BF1F7926C5","f4_colorA":"FB683507-20B9-4952-BF9E-7C0AC74F18BB","f4_colorB":"A3D855E3-640A-486A-8AAE-ABACD0EA2AAE","f4_alpha":"65316EB0-29A5-418A-B4B8-FC4057156366","f4_mode":"803EA066-BDE9-43DF-BED6-AFC6C96B00FC"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6285A1C6-1FC4-4930-BC75-AF4828D944EC","f3_bias":"A3F8C5F6-7E7D-42A5-BBF2-D62D51E0DDA1","f3_scale":"2FBD921B-F302-42C0-8D39-631D59E069F0","f3_intensity":"F0D68495-960C-452E-A0E4-3FABAAA5D350","f3_factor":"DAFE5896-FE2E-44B9-BD25-9EB09CAD38C7","f3_alpha":"C036FF17-237C-4AC1-8848-5CB25A7FD2DE","f3_mode":"E3ADCE9E-8A1C-4105-813F-C51A387D8183"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"612514D1-AF34-43F7-B792-7F1D59E31546","fragment":"612514D1-AF34-43F7-B792-7F1D59E31546"},{"uuid":"01E9CFF8-2883-42AE-9C98-E258744C3DCC","type":"ShaderMaterial","reflectivity":{"uuid":"6C4DA0A4-37EF-4FC8-9B2A-3321EB2F9F1C","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"364C0B24-645B-4B0B-82BF-98EEFED1901A","f0_alpha":"1D69107B-3AB0-427C-8779-FB83CD25E519","f0_mode":"62D84545-8E98-4E4E-A01F-41FB6467B007"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"82896005-3159-49AB-AEEE-D2F91561CCD9","f1_mode":"62E55291-653E-467A-BFAF-D774CB39C3E8","f1_roughness":"EC5D0636-B233-46FF-8308-0888C4BF4395","f1_metalness":"8BC2425B-A0D1-471E-80C9-1EE5184A1AF7","f1_reflectivity":"6C4DA0A4-37EF-4FC8-9B2A-3321EB2F9F1C"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"15DA22C2-D90D-4683-B0BB-C8993F503705","fragment":"15DA22C2-D90D-4683-B0BB-C8993F503705"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"76F3D3D8-C0FE-43DB-97E3-24EF46F53E97","name":"Base State","position":[137.90758729968002,76.4702603787693,-6.5271211759586265],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"E8DE6176-7198-48F4-99E8-5CEFDD8160F4","f0_alpha":"E6268494-3054-4ED2-A2F2-0437CEBA3F82","f0_mode":"044C4BB7-9762-4C7E-A6CF-E51A042FE6E6"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7E0886C3-AB6C-4C73-99E6-771C951F2400","f1_mode":"43637ABE-6023-450E-9EEC-AE9FFF1F7E6E","f1_roughness":"2C3063E7-4437-4D2B-8C71-582AB68A205A","f1_metalness":"1A1AE27D-3B01-46B9-BFAC-53A4FBCE6960","f1_reflectivity":"5D0EC2EA-DAD5-4E67-BEC7-B37267D3B6A1"}}]}},{"uuid":"6434020B-1738-409D-940A-40BC5E7AFC0E","name":"State 1","position":[137.90758729968002,84.82107603357503,-9.56656950615214],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"5739FD78-4B8F-4F7F-8778-A563406E523C","f0_alpha":"297B8047-48E8-4A1A-9C4E-F17378E02D55","f0_mode":"B05737FE-4E4E-458C-A06E-EE22B62CD9F5"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2935C843-6CA2-4380-B2D6-479A30BD4682","f1_mode":"12BC7E11-C26E-44F2-914F-816B2744308A","f1_roughness":"0F855766-F610-4F97-B0CC-05C99F668811","f1_metalness":"1FD53457-087E-4442-94AA-AB5FD50359F6","f1_reflectivity":"F0AE25D1-9AEA-416A-89C5-693F3A2102C8"}}]}},{"uuid":"87316550-1E80-4D93-812A-E30C4F2C1BB8","name":"Base State","position":[2.954213988821323,78.13947375637262,-1.8278986208817116],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"67F4F780-4587-499B-9C8C-1855F5291534","name":"State 1","position":[2.954213988821323,78.13947375637262,-1.8278986208817116],"rotation":[-0.3490658503988661,-0.15099092713231432,-3.509374828248845e-18,"XYZ"],"scale":[0.9999999999999989,0.9999999999999999,0.9999999999999998],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"E884E1FB-F8AC-4609-88A1-2C3691B8B577","name":"Base State","position":[190.26681927331737,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"9ED6121A-D030-4326-B46A-9606F3A85A5A","f1_mode":"D135C7B5-4406-42CD-9181-A8F1F76EF840","f1_shininess":"1897C63D-78DE-4F41-BE66-5703660147F1","f1_specular":"F09C648A-4BE0-445D-9DCB-57388C75FBA3"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"0E863D9C-1F54-4630-A70F-B93F42B8F32E","f2_ior":"8F155AD9-71D6-48CE-8536-E7744942959E","f2_roughness":"BE0CF9B5-6E53-4C9C-9CDF-5A874270043A","f2_transmissionSamplerSize":"9DB59573-A820-471D-839F-B5CCBBDB700C","f2_aspectRatio":"FA69EE3D-1806-473D-820A-A4419E4EEA33","f2_alpha":"4920B756-47C2-4E46-987F-BAFC4D84729D","f2_mode":"DD7FEF8E-9952-465F-9938-9D9C7E417B7C"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4174BBC1-7049-4905-8F2B-A9237BE38C9B","f4_far":"C68E9BDB-9B94-4E0D-B9BB-F82A59000AA3","f4_isVector":"4F226DA3-1CFB-478E-8BAE-BA28AD7D6D70","f4_isWorldSpace":"22BE8949-7149-4880-95FD-B8437E453E7C","f4_origin":"9F3C8F6F-591B-49BE-960D-503A2B835011","f4_colorA":"30804933-6768-4111-A4F0-295058AD58ED","f4_colorB":"9F05786D-7487-473A-90AB-E7BF9DEABDCA","f4_alpha":"D5B4871F-D3FD-4A3F-9CD6-3E4EEAEB8884","f4_mode":"CAE1222F-86FD-4B68-BBB1-D3D9F14C2EC8"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4BAA6334-C18E-419C-B0BD-D230D19E64C5","f3_bias":"253EA2E6-6F21-4A94-90DD-11DAE74CC63D","f3_scale":"D7D3410C-FB27-41CF-AA92-F2964692987A","f3_intensity":"DA191B01-DC66-4C15-839E-5315F0174EF8","f3_factor":"2269617C-0C5E-4782-8DD4-4BF97E598EC4","f3_alpha":"D6C2BB56-E17C-49E3-B787-202E8C547F8B","f3_mode":"25CC7EB6-B95A-4A61-90B6-1BBF34AF8944"}}]}},{"uuid":"F6E92645-97C1-4C61-BDD0-6F1A023B0AFA","name":"State 1","position":[190.26681927331737,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"32B93D62-2E92-4A31-9B6A-657E46A8626C","f1_mode":"5700CD39-056C-4257-91F1-B9E731A8EEB9","f1_shininess":"9769A9A7-FB80-4763-B04D-0D3CD43136B5","f1_specular":"530EC8A0-2445-4587-B1C8-BC5F366D0E43"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"461968BF-246C-43EE-B045-C9894C826D41","f2_ior":"34FC42D2-2BD9-4506-8418-00D6B207D709","f2_roughness":"827E409E-5AAA-43BA-9B9A-A529FBE2D5ED","f2_transmissionSamplerSize":"059848C7-7E84-4315-AF62-5085E17094E1","f2_aspectRatio":"34E2897E-8E6C-4CD8-AB48-7EB02748967C","f2_alpha":"DD395322-2859-4BCA-9695-9343A85C77DD","f2_mode":"4DD616B8-F6F8-4D1E-9130-31EF3925676C"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"52AE96AA-971C-488A-BB9A-8D3D8065FC77","f4_far":"ACB1019C-6C79-425D-B4CF-FD5B64F127B4","f4_isVector":"91309FA6-77B3-4CAE-B8AD-A3B435B59D80","f4_isWorldSpace":"A2646765-CFD3-4C02-8D32-A601FB99B1FD","f4_origin":"4D2820DB-B5D0-457C-B249-E05E15138CA9","f4_colorA":"E1C4A787-21F6-413E-B018-E6C1DB0ACD92","f4_colorB":"1A119BDE-D359-4AA6-A090-4428A1BD27DD","f4_alpha":"1CE137C0-1CC5-4B93-A926-7607BD651A4A","f4_mode":"1922D841-B418-4B51-8332-38713CB04D3E"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"890B4A8A-91A1-4F7C-BCDE-57E8EE338E63","f3_bias":"F9AEF6F6-C927-4870-98A2-24EA5E05DC35","f3_scale":"E73001AC-F935-4064-9F88-0CA74D50E3E4","f3_intensity":"88E14C87-3004-457B-9A59-CF512AFDA6BF","f3_factor":"93A1A027-A32F-4D49-A356-B77FFF32BB49","f3_alpha":"E3142C44-7A69-40B0-879F-D65098095B2C","f3_mode":"DC79F992-87D2-47FA-AE9E-563FFFB2C945"}}]}},{"uuid":"F8DF091B-7F4E-4E22-AA76-164CA17904BF","name":"Base State","position":[-300.55442995952353,-46.750852213019925,76.91744823804856],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"EC4762BD-8E6A-4A3E-B4CF-1039A289F7D6","f1_mode":"0F48A9E7-8CAF-46F7-A510-A7023B2853EB","f1_shininess":"090D3B6D-EDED-4B71-A6AD-E6CF0F0D6D39","f1_specular":"C3533A17-3AA1-4DB3-AF99-3273ECA18736"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"A74B6D96-A67D-4773-BD4D-7C1B1CC171E6","f2_ior":"83D1A73C-BE1F-4B05-B892-7705243B1E92","f2_roughness":"A66017C4-F305-4CAC-B3FB-0492AC299DE8","f2_transmissionSamplerSize":"E623EC89-A08E-4131-BE33-AE07C3305457","f2_aspectRatio":"A7CCFA04-7512-4268-8170-A86C32AB989D","f2_alpha":"234623E3-CD08-4718-97A9-B7C83E444BAB","f2_mode":"BE38D03C-9A49-425A-8FDB-CCC122BF740A"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"96C3CD00-DA99-4BE7-AA11-F7524BF29C93","f4_far":"F5A88BBB-C517-44CB-98E8-977C36636A2C","f4_isVector":"DF5119BF-6EFB-4624-B419-B301FC53DADB","f4_isWorldSpace":"314264C3-273B-4F8B-98B3-48842F14DC18","f4_origin":"39E08681-4690-4DBA-A281-0E8AA8467B64","f4_colorA":"6801FB5A-4AA3-499B-ACDD-2417B624B3D7","f4_colorB":"CD672826-383A-4AED-B09B-151305E3B87C","f4_alpha":"5F127840-6547-438F-B45E-169550FCE932","f4_mode":"B98FCD7A-CF09-40A0-B283-FB0383FA92E1"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6F1065DA-0BE2-463D-AB3C-89F1E77DC53F","f3_bias":"A489161C-56F5-4288-86B1-A81789BA3BDA","f3_scale":"2C30E6DB-D27F-4BE8-801D-9AD3CE797FDC","f3_intensity":"86F321CC-4DBF-4EB7-9C1F-B3F5AA358297","f3_factor":"40A58CC2-9A73-4B98-A819-A8EEB08B8BAE","f3_alpha":"F5836BBB-DB3F-4AFB-B2B7-CAD45D373471","f3_mode":"124653AC-46A4-4AFE-B237-87ABD4D8BF3F"}}]}},{"uuid":"78BAA5F5-DCF6-4433-B914-069B752D2512","name":"State 1","position":[-300.55442995952353,-46.750852213019925,76.91744823804856],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0ECE4493-0E73-4F2B-B98E-3384CD676B49","f1_mode":"2F837E55-6983-4FA8-A805-D729A121C851","f1_shininess":"6744B04B-FD21-4DE5-BDB2-F4B1378C494F","f1_specular":"84546CBC-3AC8-4CEE-846D-3BF079F0A723"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"6376FCE1-E2B3-4933-A13C-B5A3BB75314D","f2_ior":"51F0B2C7-5944-43A7-BDE2-A05E2F467EE1","f2_roughness":"272F752C-0B44-4FCB-A784-6CF3F013CBC0","f2_transmissionSamplerSize":"B1B1B7EA-C0A0-4C4A-93B0-5F89CA656F26","f2_aspectRatio":"17099A24-EE98-4375-A828-7645C6649353","f2_alpha":"2E14F101-FB12-4D2C-81AF-BBACEED39977","f2_mode":"5622D2F0-2923-4813-A0E7-FC53A3235092"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C77D0022-2D87-4626-9410-506EBAF2B715","f4_far":"F2AE9402-1484-4E1D-B794-1804AC8E154F","f4_isVector":"532EE962-BF96-4F4D-ADEE-3978E21A6644","f4_isWorldSpace":"06CC043F-0E3A-4D7C-95DA-EA9AA2C3EF38","f4_origin":"FB7019DC-51C2-47CC-BD9D-78EF6DF38195","f4_colorA":"2F05BFE2-4D38-4850-A20E-13A3BB01A92E","f4_colorB":"AF1E85D5-E0F2-458B-AF20-2966ABA2B7BB","f4_alpha":"E532DDAE-B351-4ECC-B4DC-C378A804F1E0","f4_mode":"0D06219F-2E46-4968-B99B-874BA74E0970"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6E82AF0C-DB2C-4212-89DC-DA1A47B732AC","f3_bias":"629F9C07-E2BD-4E5A-857B-4CDE5D5892AB","f3_scale":"1E5EB17A-BA6D-4F0C-9A1B-14BB70DA488F","f3_intensity":"A99D47E1-AFCB-4FB6-9995-36DACD01798B","f3_factor":"EF096DA9-6A23-4997-9569-CB95B08A365A","f3_alpha":"F50B3D35-BE2A-4B30-A1EE-FE152B4E3730","f3_mode":"21363135-C821-45E1-9028-6C9C0292DD7C"}}]}},{"uuid":"BDB622D7-D927-47AC-9E80-49747997AA65","name":"Base State","position":[322.9830495527491,88.12453841135351,59.80926803392561],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"geometry":{"width":130,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"40E09983-B561-4F7E-81D1-BD7C289CCD16","f1_mode":"A0CDC8BA-126F-4E25-AAE1-326A0C444349","f1_shininess":"68AE3717-3451-43C4-9E13-5E7C1F470037","f1_specular":"489D87EF-A47B-480A-892C-26E0FDAE1F94"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F5CAD60E-D095-4472-96A1-08F7D209206C","f2_ior":"3CC91A05-0C62-476F-AC49-23FC9061575B","f2_roughness":"2A472632-5C66-4047-B626-994ECD505D6F","f2_transmissionSamplerSize":"23F583B3-EF18-45A4-8110-4176D53F7F38","f2_aspectRatio":"5F061E7E-27EC-4055-9F77-80FB9218D5E7","f2_alpha":"11968214-C2CD-4B12-BB0A-571B3CDC0917","f2_mode":"00ED0A8C-D0A4-47F3-9400-9E85821377D6"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"E34513A2-8644-4337-8C0A-6C939094DAEC","f4_far":"7625CCC4-0FDA-4D2F-B470-5A91759D5504","f4_isVector":"B3C7D04C-D80B-4AA4-9F39-D66759723CEE","f4_isWorldSpace":"4EC3C32E-D49C-40AA-9A2B-5B0926B01BB0","f4_origin":"4CBDC01F-E341-4C5D-91D8-B54A59E327BA","f4_colorA":"F5C0A88B-E2C3-42C0-A07F-F8BB951DE9B0","f4_colorB":"B4357DD1-6107-42D1-A4C4-2F32E288D092","f4_alpha":"1D36FEAF-69A6-4709-99CF-E42A8A5FF8E6","f4_mode":"35FF0157-6C7C-4787-861D-F253F8319828"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"FA0B0986-97F6-49E2-8CB6-F5620E38EF87","f3_bias":"D731A30E-F481-4873-9BA7-52B0758F7E78","f3_scale":"82855F09-B15A-4529-9912-0B6C8A02E100","f3_intensity":"11EA3B64-63F8-4C55-BF08-8A2ED8C5AA97","f3_factor":"C657785A-82C8-4D8C-8BF6-F490B2D3CEC5","f3_alpha":"17D0D65E-D4A7-4671-8C99-0B895DD8F9D7","f3_mode":"68A155EA-A230-416C-9AAF-A942D3BEF0A2"}}]}},{"uuid":"79524652-4473-4CEF-BF5C-86A2B405CE97","name":"State 1","position":[322.9830495527491,88.12453841135351,59.80926803392561],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"geometry":{"width":130,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"2DD83EF7-C185-4CB5-A96E-B2166D04A794","f1_mode":"E85D4476-2E51-4875-9747-ACCFF295BA43","f1_shininess":"188EA580-F89E-4ABF-976A-2D14FC8DC255","f1_specular":"694DC6F4-5BB5-400C-9F73-1428FDEC6B5A"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"178962FE-6506-4F97-BFBE-B936EDE846D7","f2_ior":"36D874FA-689C-4019-9D5A-6DECB4FC14AF","f2_roughness":"68783777-D2CC-45B1-B71E-699A97BF03E7","f2_transmissionSamplerSize":"3332D764-DDE9-416C-9E93-F0C75CA86585","f2_aspectRatio":"594E716E-364C-4BF0-BFA9-A09EBAF3CBB3","f2_alpha":"4CFC0D0B-7518-4883-8603-6E6BF63FAB13","f2_mode":"D0816B90-98A6-41CF-9F99-26EF784E151C"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C5D6FD91-2526-429F-AA5D-66BBE5A46F57","f4_far":"693BC758-1C55-4581-9C62-F8B760775086","f4_isVector":"10EAFD39-1B69-4F32-B956-8B56512FF1CD","f4_isWorldSpace":"F27AFAE2-4E26-4B08-AD92-81FDDD01751B","f4_origin":"F617981D-2879-4792-B09B-7B81CF924847","f4_colorA":"D76A2EAA-98BD-4321-88E5-8B0F26C6E13D","f4_colorB":"877958F6-E00C-4BBB-9744-4E268130B0DC","f4_alpha":"55691E50-A061-425C-8BB9-AAEA9743457A","f4_mode":"8AA252D5-DB19-4C42-B121-EC4EAAD06359"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4FCD80BF-64C7-4B54-84B0-BFE9D0491955","f3_bias":"CF85B954-654F-45B2-AB9C-5AB0C80928E6","f3_scale":"4858C772-60B7-4B24-B63D-C9ADACBF095F","f3_intensity":"918F313A-AEDD-4DB2-8F13-422F475D133E","f3_factor":"971E9C5A-6E17-42D3-A033-DC793A5254B7","f3_alpha":"427DC76F-3F7E-46F8-82A6-F4F68E79A1C9","f3_mode":"A312AE6E-81E2-46E6-9477-A52299673308"}}]}},{"uuid":"12BFC9EE-BBBE-4EC8-91CA-8A4E87E56B42","name":"Base State","position":[87.37781944740044,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E56022B5-6F7E-4F3B-A7C9-CA1D58E0A50A","f1_mode":"8CB81451-087A-495F-AB08-665B07C3FB80","f1_shininess":"DC73BC35-E6DC-49C6-ADFC-E3E466F5B291","f1_specular":"4FB2B352-CFFA-49A4-A772-27E21DF4C649"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"40A6718B-3FA4-40E2-A0BE-9B196B0B874E","f2_ior":"9A9E451A-1845-46D8-86BB-B6413E3D1606","f2_roughness":"69165B73-71B4-474D-A608-ED6DC36F16C2","f2_transmissionSamplerSize":"4760FD8B-6FC2-4A7E-B489-642F91538B99","f2_aspectRatio":"D597215C-A813-4211-88E3-1FE959EB7B54","f2_alpha":"10A0E5B5-6774-4BD5-99E7-C1CC6D4C1D2E","f2_mode":"B237F13B-F7A0-476E-9F1A-783A8BE55992"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"FD9CDED6-7CCB-46FA-8A0B-B7C910F50DBB","f4_far":"5EF531DD-B88A-443A-9E5C-1B885789A61E","f4_isVector":"C142DA10-A0D8-4FFA-B168-55B317A78AC5","f4_isWorldSpace":"142940FC-2FCC-442E-9454-D7F844929EF4","f4_origin":"706980B4-F7DB-47BC-8F59-9DA0E37FDAEE","f4_colorA":"EBB974B8-452D-4FF5-91B5-A4C4182D46BD","f4_colorB":"FE3EFD06-9710-4AF7-B764-74CD192E9F37","f4_alpha":"59210056-048C-4B63-A3D5-14C70FB18423","f4_mode":"86F207A7-5A19-4D29-AC91-3358FFED8B71"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"FF2E4A56-C38F-4FC5-B5B8-CEA868566159","f3_bias":"2CCC3FE7-8765-4C7D-BF69-0625FAED5BA5","f3_scale":"3F59FF1F-1E36-43B5-9958-16873A80A72F","f3_intensity":"AE65C37F-C151-4BB0-B573-CC350B32B180","f3_factor":"B3D7926C-B17B-4A34-9DAB-1BF7BD812A1D","f3_alpha":"142B6B60-77B1-44C1-A7BF-EB72C0B52B53","f3_mode":"029FAEA0-D9AD-4C1F-9C4A-78F1DC9AA080"}}]}},{"uuid":"23D17C53-8A88-4F03-9C13-60DE36EF8546","name":"State 1","position":[87.37781944740044,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"C875BE95-03D3-4994-AFE6-91567C7FD47C","f1_mode":"DA138DC7-6069-4E0B-A0A4-4B9CE94F9663","f1_shininess":"96209794-CC9E-4B1F-9301-1C22741B2E87","f1_specular":"BE8C97FA-A44C-482F-A62B-5866FDE04037"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"B01BB689-56B9-4115-B0C6-CEA4C2A4C3D0","f2_ior":"E725F187-3E17-43C8-9A2F-6082786E3A76","f2_roughness":"998BA438-54B8-4164-AE1F-80AB6D71BC79","f2_transmissionSamplerSize":"6C5A96E4-7C29-4323-975E-15CCD0534B07","f2_aspectRatio":"8305C10A-CAAB-4EE8-A007-4F32C6CD9839","f2_alpha":"C362076A-1B3F-4EDD-991C-BC9AB19CED1F","f2_mode":"DE66FCEA-F2C3-4F0C-BCD8-5DD888E76F10"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"2F45C95F-D5BD-40A4-ABEB-E12ED16B7063","f4_far":"C69732AE-7326-41F7-AA3B-298C1F4D28EB","f4_isVector":"774BF5DC-78B4-4A0B-9145-A65FB93DA688","f4_isWorldSpace":"6E615660-C11D-4808-B62C-74334A89049E","f4_origin":"263B0B3E-D7F1-444B-9030-961D18B1F9DA","f4_colorA":"A51D9C15-AD2E-4C98-BFDB-7612850237C9","f4_colorB":"7E02F5E4-65FA-491F-A11C-C1CADDAAD0BA","f4_alpha":"4EA2A9C7-44A0-4A87-AE7E-F6776796DFC3","f4_mode":"EAA7A141-3649-4219-AD41-AEEF24C86DE4"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B129C0D2-7F9C-4876-AAB3-F7311A88CE4A","f3_bias":"1428A571-F61B-4BC0-B381-43686F6C4790","f3_scale":"B04D4F20-0DDD-4736-B86F-7FEA018F535C","f3_intensity":"DB93F55B-3051-4F9F-8ADA-BB81F92131E3","f3_factor":"3A32E77F-BFCB-4B43-9D88-3712EABDB5A4","f3_alpha":"E1176246-086A-48E6-9A97-694DC18BE84B","f3_mode":"E5C5E2F5-54B7-4C14-B7F0-A1DDEAF23ABC"}}]}},{"uuid":"6D4BDFA3-7BB9-465C-835B-427EAA005D77","name":"Base State","position":[-132.08367510706478,76.4022285497829,-6.49995961386103],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"9ED138A0-918D-41C5-97EC-5C6E65D13919","f0_alpha":"09FFA581-0A97-4955-8E76-C4F3EE6EF4D1","f0_mode":"978F61EE-7CB4-4301-8239-286E06A4816C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DF91ABF2-1FA8-4591-BC3F-E0FDB346AD35","f1_mode":"E34C58BA-20D2-499F-91F8-600D695408A6","f1_roughness":"4A59110E-82EE-49E9-9B61-504A7449CD19","f1_metalness":"2C6352C5-09B4-41D9-8F29-9F94DFB85D3D","f1_reflectivity":"B046B8F1-8217-420D-BAA6-C281A077445C"}}]}},{"uuid":"F60C7DE0-999F-41F9-9E73-72961BBBE7E1","name":"State 1","position":[-132.08367510706478,85.42843404027218,-9.7852297407693],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"985BA411-7996-4471-8677-D0D51723E995","f0_alpha":"3CF03E16-27C3-416E-B1B0-A900141EA364","f0_mode":"1524FE6E-FA14-4C77-9EB5-55B631C692D8"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"EA1C9C1B-27B1-4950-8832-2A4FD58BA1F4","f1_mode":"9461E671-1AD9-4E08-89F9-B7FC2C79A762","f1_roughness":"AC739948-3C4D-4FB4-AAB0-98A977502B26","f1_metalness":"115D5F07-3DD8-4A3F-B565-70C2B5FD4627","f1_reflectivity":"CD83A903-1FC8-452B-814C-342899DCCC4F"}}]}}],"nodes":[{"uuid":"E8DE6176-7198-48F4-99E8-5CEFDD8160F4","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"F88E9367-7C50-43AD-A510-E6B993C0CE5E","nodeType":"Color"},{"uuid":"F88E9367-7C50-43AD-A510-E6B993C0CE5E","type":"f","value":1,"nodeType":"Float"},{"uuid":"E6268494-3054-4ED2-A2F2-0437CEBA3F82","type":"f","value":1,"nodeType":"Float"},{"uuid":"044C4BB7-9762-4C7E-A6CF-E51A042FE6E6","type":"i","value":0,"nodeType":"Int"},{"uuid":"7E0886C3-AB6C-4C73-99E6-771C951F2400","type":"f","value":1,"nodeType":"Float"},{"uuid":"43637ABE-6023-450E-9EEC-AE9FFF1F7E6E","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C3063E7-4437-4D2B-8C71-582AB68A205A","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"1A1AE27D-3B01-46B9-BFAC-53A4FBCE6960","type":"f","value":0,"nodeType":"Float"},{"uuid":"5D0EC2EA-DAD5-4E67-BEC7-B37267D3B6A1","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"5739FD78-4B8F-4F7F-8778-A563406E523C","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"7CF127E1-A0BF-460D-8C04-05AABC054B79","nodeType":"Color"},{"uuid":"7CF127E1-A0BF-460D-8C04-05AABC054B79","type":"f","value":1,"nodeType":"Float"},{"uuid":"297B8047-48E8-4A1A-9C4E-F17378E02D55","type":"f","value":1,"nodeType":"Float"},{"uuid":"B05737FE-4E4E-458C-A06E-EE22B62CD9F5","type":"i","value":0,"nodeType":"Int"},{"uuid":"2935C843-6CA2-4380-B2D6-479A30BD4682","type":"f","value":1,"nodeType":"Float"},{"uuid":"12BC7E11-C26E-44F2-914F-816B2744308A","type":"i","value":0,"nodeType":"Int"},{"uuid":"0F855766-F610-4F97-B0CC-05C99F668811","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"1FD53457-087E-4442-94AA-AB5FD50359F6","type":"f","value":0,"nodeType":"Float"},{"uuid":"F0AE25D1-9AEA-416A-89C5-693F3A2102C8","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"252B575B-A253-4AD1-8B9B-404F376CE582","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"B2E1D314-0D44-4D91-B362-98BF29FF66BA","nodeType":"Color"},{"uuid":"B2E1D314-0D44-4D91-B362-98BF29FF66BA","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D4590EB-AEA4-4B2F-8FE3-7C03DAD25541","type":"i","value":0,"nodeType":"Int"},{"uuid":"35C2306B-821E-47B5-AC1E-0EA893AF1BD7","type":"f","value":1,"nodeType":"Float"},{"uuid":"D946A313-FC4F-4B3A-98DB-1085FF0BCCBF","type":"i","value":0,"nodeType":"Int"},{"uuid":"153E0EC8-D73B-473E-B47E-F5F97AC93CA5","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"4C907E7A-3706-42C3-908D-FA71C68634D1","type":"f","value":0,"nodeType":"Float"},{"uuid":"C459FF42-A116-40C2-985D-6C2CA48CDEBC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"16205074-C623-4929-98F7-4F91947C80F2","type":"standard","color":"252B575B-A253-4AD1-8B9B-404F376CE582","roughness":"153E0EC8-D73B-473E-B47E-F5F97AC93CA5","metalness":"4C907E7A-3706-42C3-908D-FA71C68634D1","alpha":"E4B85523-AF1A-4B81-8CD6-308411B10E8D","reflectivity":"C459FF42-A116-40C2-985D-6C2CA48CDEBC","shadingAlpha":"35C2306B-821E-47B5-AC1E-0EA893AF1BD7","shadingBlend":"D946A313-FC4F-4B3A-98DB-1085FF0BCCBF","nodeType":"Standard"},{"uuid":"E4B85523-AF1A-4B81-8CD6-308411B10E8D","type":"f","value":1,"nodeType":"Float"},{"uuid":"5EA61CA9-B931-46A2-B0BF-FEB360344021","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"614AA6A3-631A-42B0-9557-32F849B3F9ED","nodeType":"Color"},{"uuid":"614AA6A3-631A-42B0-9557-32F849B3F9ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"F494F255-5898-4B4E-A056-432B7DDF2BDB","type":"i","value":0,"nodeType":"Int"},{"uuid":"70FB7CC4-7FF5-4103-9A82-8CEA2EFC41FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"E0D08964-14AC-4A90-920C-60DD3CA365D3","type":"i","value":0,"nodeType":"Int"},{"uuid":"F14893B0-DFA3-45DE-ACC3-BAB890B358AE","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"B34BB8CC-DB09-478C-BBE8-FF5D83A3DA10","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"6F92C17A-D3DC-4003-838B-AD983860B187","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4B5EC93A-8ABB-4E78-B1D9-F99BEE53E014","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD6F1C68-A53C-452E-B79A-F75D872D7BB0","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"E6EAE69E-3656-4F35-B0FE-969376A4C59D","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F236ADE-134E-4B4A-8F36-14DC83E8BDD7","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"7090E433-8E3C-4AA3-BF6E-49D0A5041821","type":"i","value":0,"nodeType":"Int"},{"uuid":"6A7AAE26-CD50-4D88-B01F-023629105180","type":"lambert","color":"5EA61CA9-B931-46A2-B0BF-FEB360344021","emissiveIntensity":"681485A2-659B-41BC-981C-E8327546AAB5","shadingAlpha":"70FB7CC4-7FF5-4103-9A82-8CEA2EFC41FE","shadingBlend":"E0D08964-14AC-4A90-920C-60DD3CA365D3","afterColor":"5F7CF036-AA85-4DB2-A2A5-E535F3CD0E7E","alpha":"C90432CA-92E1-42BF-AFEA-304D43C043D0","emissive":"F14893B0-DFA3-45DE-ACC3-BAB890B358AE","nodeType":"Lambert"},{"uuid":"681485A2-659B-41BC-981C-E8327546AAB5","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F7CF036-AA85-4DB2-A2A5-E535F3CD0E7E","type":"v3","a":"A7415380-2FFD-4B5C-A879-2F488A466751","b":"42968DD0-5FB5-4E5E-8AB3-5A6B8B4347F3","alpha":"4B81B63D-3C7B-4F50-B0BF-B2959F01FA0A","mode":"7090E433-8E3C-4AA3-BF6E-49D0A5041821","nodeType":"Blend"},{"uuid":"A7415380-2FFD-4B5C-A879-2F488A466751","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"42968DD0-5FB5-4E5E-8AB3-5A6B8B4347F3","type":"v3","color":"B34BB8CC-DB09-478C-BBE8-FF5D83A3DA10","bias":"6F92C17A-D3DC-4003-838B-AD983860B187","scale":"4B5EC93A-8ABB-4E78-B1D9-F99BEE53E014","intensity":"CD6F1C68-A53C-452E-B79A-F75D872D7BB0","factor":"E6EAE69E-3656-4F35-B0FE-969376A4C59D","alpha":"9F236ADE-134E-4B4A-8F36-14DC83E8BDD7","mode":"7090E433-8E3C-4AA3-BF6E-49D0A5041821","calpha":"g42968DD05FB54E5E8AB35A6B8B4347F3_calpha","nodeType":"Fresnel"},{"uuid":"4B81B63D-3C7B-4F50-B0BF-B2959F01FA0A","type":"f","src":"g42968DD05FB54E5E8AB35A6B8B4347F3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C90432CA-92E1-42BF-AFEA-304D43C043D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"E256C00C-D2F7-4DB8-8A55-B1117FD49BE9","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"EEF2648F-076A-4D65-8783-712EB8E1FF97","nodeType":"Color"},{"uuid":"EEF2648F-076A-4D65-8783-712EB8E1FF97","type":"f","value":1,"nodeType":"Float"},{"uuid":"64E8B203-F73A-4B93-B4C7-AC4A822BAA18","type":"i","value":0,"nodeType":"Int"},{"uuid":"B61FF07A-18CF-4BAC-B00F-1A4E59C3564E","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA85F5DD-7D45-452C-950A-1A9A2499D524","type":"i","value":0,"nodeType":"Int"},{"uuid":"3453E61A-9C53-48E1-98CF-1817644A5EC4","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"34717949-7F97-464D-8067-0B84D698A2A2","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"225A3837-3574-478F-B854-96E408D2496F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"D5C9CC60-92C9-47C6-BFF5-5D53C0DC48EC","type":"f","value":1,"nodeType":"Float"},{"uuid":"E9A804CA-0A41-44A3-88EF-65EDEB32E238","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"DAF20AB8-367B-421B-BFFE-82BCC9E10743","type":"f","value":1,"nodeType":"Float"},{"uuid":"7784C0C3-A5DE-40D3-B2E8-A44979EE02A7","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"B5AF7634-D9C8-45FE-8579-870870DF304E","type":"i","value":0,"nodeType":"Int"},{"uuid":"6D84001B-386E-4628-B3E7-4DA9432440A3","type":"lambert","color":"E256C00C-D2F7-4DB8-8A55-B1117FD49BE9","emissiveIntensity":"14C59321-AAAD-4EE8-8969-526CAEB8E4D3","shadingAlpha":"B61FF07A-18CF-4BAC-B00F-1A4E59C3564E","shadingBlend":"BA85F5DD-7D45-452C-950A-1A9A2499D524","afterColor":"CBF0392B-D31E-40C3-8DB5-796FA3750F7E","alpha":"6A94DB94-715D-40D1-8380-8C44F602ECEE","emissive":"3453E61A-9C53-48E1-98CF-1817644A5EC4","nodeType":"Lambert"},{"uuid":"14C59321-AAAD-4EE8-8969-526CAEB8E4D3","type":"f","value":1,"nodeType":"Float"},{"uuid":"CBF0392B-D31E-40C3-8DB5-796FA3750F7E","type":"v3","a":"5E80FF1C-7069-4A52-8485-B0CC3FDC8081","b":"E2DF76B7-D3AF-4D10-8C21-D8410A16BE54","alpha":"6255C0A4-D236-4599-9EFD-AE920A9DCD8E","mode":"B5AF7634-D9C8-45FE-8579-870870DF304E","nodeType":"Blend"},{"uuid":"5E80FF1C-7069-4A52-8485-B0CC3FDC8081","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E2DF76B7-D3AF-4D10-8C21-D8410A16BE54","type":"v3","color":"34717949-7F97-464D-8067-0B84D698A2A2","bias":"225A3837-3574-478F-B854-96E408D2496F","scale":"D5C9CC60-92C9-47C6-BFF5-5D53C0DC48EC","intensity":"E9A804CA-0A41-44A3-88EF-65EDEB32E238","factor":"DAF20AB8-367B-421B-BFFE-82BCC9E10743","alpha":"7784C0C3-A5DE-40D3-B2E8-A44979EE02A7","mode":"B5AF7634-D9C8-45FE-8579-870870DF304E","calpha":"gE2DF76B7D3AF4D108C21D8410A16BE54_calpha","nodeType":"Fresnel"},{"uuid":"6255C0A4-D236-4599-9EFD-AE920A9DCD8E","type":"f","src":"gE2DF76B7D3AF4D108C21D8410A16BE54_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6A94DB94-715D-40D1-8380-8C44F602ECEE","type":"f","value":1,"nodeType":"Float"},{"uuid":"D29BD60A-3D5E-4C2B-A893-38F5B1E5CB06","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"F50AF688-F4F5-4474-868E-DF9F17837767","nodeType":"Color"},{"uuid":"F50AF688-F4F5-4474-868E-DF9F17837767","type":"f","value":1,"nodeType":"Float"},{"uuid":"1DCF4878-9885-4DD7-BBAB-445251932B2D","type":"i","value":0,"nodeType":"Int"},{"uuid":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","type":"f","value":1,"nodeType":"Float"},{"uuid":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","type":"i","value":0,"nodeType":"Int"},{"uuid":"3D917379-0998-4D51-9EA3-D5C7365F4D0D","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"E64AE1B9-68F0-4A80-8FC6-3D1E92947BD7","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"989B6805-81B5-4712-9E1F-14D82B75265F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3069171F-7C6A-437E-8FB2-C326653F5BEA","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7A1732F-F106-47BD-886E-26F61F0710C4","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"4105C692-8752-4315-BBB4-8C997417D136","type":"f","value":1,"nodeType":"Float"},{"uuid":"6DFB5718-E8EB-42DA-9C55-604C857E95D4","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"57D20FB3-4F57-48C0-9C98-086D43B5AC33","type":"i","value":0,"nodeType":"Int"},{"uuid":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA","type":"lambert","color":"D29BD60A-3D5E-4C2B-A893-38F5B1E5CB06","emissiveIntensity":"60C85E54-3B36-4050-91EE-CE4C17903E17","shadingAlpha":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","shadingBlend":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","afterColor":"5350B2A3-BB8C-4BCF-BD30-681205BDEE5F","alpha":"39EFACFE-0BBB-4A4F-AA96-0EA4CDAE378C","emissive":"3D917379-0998-4D51-9EA3-D5C7365F4D0D","nodeType":"Lambert"},{"uuid":"60C85E54-3B36-4050-91EE-CE4C17903E17","type":"f","value":1,"nodeType":"Float"},{"uuid":"5350B2A3-BB8C-4BCF-BD30-681205BDEE5F","type":"v3","a":"F884E632-3A35-47F8-A486-95B8E4D6C832","b":"CBBD88B8-859C-44C9-8ED1-D096209A4E4F","alpha":"728822E0-2F34-4AB8-A601-C08BF60F20C8","mode":"57D20FB3-4F57-48C0-9C98-086D43B5AC33","nodeType":"Blend"},{"uuid":"F884E632-3A35-47F8-A486-95B8E4D6C832","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"CBBD88B8-859C-44C9-8ED1-D096209A4E4F","type":"v3","color":"E64AE1B9-68F0-4A80-8FC6-3D1E92947BD7","bias":"989B6805-81B5-4712-9E1F-14D82B75265F","scale":"3069171F-7C6A-437E-8FB2-C326653F5BEA","intensity":"C7A1732F-F106-47BD-886E-26F61F0710C4","factor":"4105C692-8752-4315-BBB4-8C997417D136","alpha":"6DFB5718-E8EB-42DA-9C55-604C857E95D4","mode":"57D20FB3-4F57-48C0-9C98-086D43B5AC33","calpha":"gCBBD88B8859C44C98ED1D096209A4E4F_calpha","nodeType":"Fresnel"},{"uuid":"728822E0-2F34-4AB8-A601-C08BF60F20C8","type":"f","src":"gCBBD88B8859C44C98ED1D096209A4E4F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"39EFACFE-0BBB-4A4F-AA96-0EA4CDAE378C","type":"f","value":1,"nodeType":"Float"},{"uuid":"EE0EA418-AC33-4B49-BA1F-C2ACC85E7381","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"E9445059-1DE4-45D7-9C26-18A0A851E1A3","nodeType":"Color"},{"uuid":"E9445059-1DE4-45D7-9C26-18A0A851E1A3","type":"f","value":1,"nodeType":"Float"},{"uuid":"8428A4AF-B9AF-48CC-94C2-AF69FF811DA5","type":"i","value":0,"nodeType":"Int"},{"uuid":"C45FC0DF-8D80-494E-A3BA-17E02DC52439","type":"f","value":1,"nodeType":"Float"},{"uuid":"5658B1F2-37D3-4A50-8AE2-65E7C2017256","type":"i","value":0,"nodeType":"Int"},{"uuid":"2F21822C-B057-4958-BE46-8C4B765C8828","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"DCCE7E0D-00EC-4F25-9761-9E8403DE1FA3","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"406EE507-E5C0-41D7-B8F4-C1ACAF00EC2C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C1DDC860-59D9-4AE1-9FC4-90B12999D1C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"D06E011C-6216-44E8-90A4-91DCB466056E","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"3132D6AB-4C06-4AE3-9309-93C2F274A458","type":"f","value":1,"nodeType":"Float"},{"uuid":"C9F654FF-901D-486F-B1E7-71081BECFB69","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"A2DB18B0-A65D-420A-A5EA-D7C9DDE4CFAD","type":"i","value":0,"nodeType":"Int"},{"uuid":"69FECCEB-56C4-4E11-AC0E-B48CEFBD5E6A","type":"lambert","color":"EE0EA418-AC33-4B49-BA1F-C2ACC85E7381","emissiveIntensity":"8B20C529-AA62-469F-BB75-DB0B8A0450D1","shadingAlpha":"C45FC0DF-8D80-494E-A3BA-17E02DC52439","shadingBlend":"5658B1F2-37D3-4A50-8AE2-65E7C2017256","afterColor":"B6D065BF-C4F4-471E-867C-8DE20C3A7EFA","alpha":"BFB985AB-2DD9-4AB5-8704-815A5076ECC7","emissive":"2F21822C-B057-4958-BE46-8C4B765C8828","nodeType":"Lambert"},{"uuid":"8B20C529-AA62-469F-BB75-DB0B8A0450D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"B6D065BF-C4F4-471E-867C-8DE20C3A7EFA","type":"v3","a":"8DF1C253-76F5-49FB-9EFF-B8273E3E16C3","b":"1D84056B-0B16-4EC3-B367-9D116C8BCE64","alpha":"1ADEF878-E287-4DED-9723-E37EFB8868ED","mode":"A2DB18B0-A65D-420A-A5EA-D7C9DDE4CFAD","nodeType":"Blend"},{"uuid":"8DF1C253-76F5-49FB-9EFF-B8273E3E16C3","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1D84056B-0B16-4EC3-B367-9D116C8BCE64","type":"v3","color":"DCCE7E0D-00EC-4F25-9761-9E8403DE1FA3","bias":"406EE507-E5C0-41D7-B8F4-C1ACAF00EC2C","scale":"C1DDC860-59D9-4AE1-9FC4-90B12999D1C5","intensity":"D06E011C-6216-44E8-90A4-91DCB466056E","factor":"3132D6AB-4C06-4AE3-9309-93C2F274A458","alpha":"C9F654FF-901D-486F-B1E7-71081BECFB69","mode":"A2DB18B0-A65D-420A-A5EA-D7C9DDE4CFAD","calpha":"g1D84056B0B164EC3B3679D116C8BCE64_calpha","nodeType":"Fresnel"},{"uuid":"1ADEF878-E287-4DED-9723-E37EFB8868ED","type":"f","src":"g1D84056B0B164EC3B3679D116C8BCE64_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BFB985AB-2DD9-4AB5-8704-815A5076ECC7","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB08A76E-9E27-4C9C-AAF8-5FC7079963DF","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"CA89ECFD-A871-47F6-B967-ADD64B964805","nodeType":"Color"},{"uuid":"CA89ECFD-A871-47F6-B967-ADD64B964805","type":"f","value":1,"nodeType":"Float"},{"uuid":"2EF5ADA6-A8E9-4335-8C00-CDD56F52C3D7","type":"i","value":0,"nodeType":"Int"},{"uuid":"76CD261D-D0C4-410E-8C8A-1B35E060F74B","type":"f","value":1,"nodeType":"Float"},{"uuid":"1FB23671-5A6D-4F97-9017-7C2EF9AFA345","type":"i","value":0,"nodeType":"Int"},{"uuid":"249F43D3-5E05-4803-9E31-7E7FE0D7708C","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"AF9D9524-D4FF-4142-979D-8DADEEF82398","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"74430D8F-5C82-4F39-A1ED-B006B7107F64","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"A9D3E0B7-1FF0-4DC3-9389-4BDEBDAC3343","type":"f","value":1,"nodeType":"Float"},{"uuid":"40440BBD-DF38-4691-A65E-607F9608E0A5","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"BE81D005-0E66-4BA7-9732-A2C96F61D7D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F1CDE3F-3B06-43F8-A272-56F6D7A42562","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"ECD2E5E2-8B8E-42C6-88FD-AFC07010253E","type":"i","value":0,"nodeType":"Int"},{"uuid":"134637A2-CF8A-4844-9F32-67B6E363B903","type":"lambert","color":"DB08A76E-9E27-4C9C-AAF8-5FC7079963DF","emissiveIntensity":"CFA0A4D4-57A5-4E03-8925-E3528B642114","shadingAlpha":"76CD261D-D0C4-410E-8C8A-1B35E060F74B","shadingBlend":"1FB23671-5A6D-4F97-9017-7C2EF9AFA345","afterColor":"60A2127D-4469-4D74-8FB9-BCC1A5965DE6","alpha":"C1E43403-3B06-4175-9228-787F9EFFA6C5","emissive":"249F43D3-5E05-4803-9E31-7E7FE0D7708C","nodeType":"Lambert"},{"uuid":"CFA0A4D4-57A5-4E03-8925-E3528B642114","type":"f","value":1,"nodeType":"Float"},{"uuid":"60A2127D-4469-4D74-8FB9-BCC1A5965DE6","type":"v3","a":"8C062DEC-0DFB-4029-868E-24E6C84E6AAB","b":"941FAC34-568F-48A1-968D-DF1EA1D50F6F","alpha":"FE54F90E-4E4E-4346-8765-A5CC68A1503E","mode":"ECD2E5E2-8B8E-42C6-88FD-AFC07010253E","nodeType":"Blend"},{"uuid":"8C062DEC-0DFB-4029-868E-24E6C84E6AAB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"941FAC34-568F-48A1-968D-DF1EA1D50F6F","type":"v3","color":"AF9D9524-D4FF-4142-979D-8DADEEF82398","bias":"74430D8F-5C82-4F39-A1ED-B006B7107F64","scale":"A9D3E0B7-1FF0-4DC3-9389-4BDEBDAC3343","intensity":"40440BBD-DF38-4691-A65E-607F9608E0A5","factor":"BE81D005-0E66-4BA7-9732-A2C96F61D7D9","alpha":"5F1CDE3F-3B06-43F8-A272-56F6D7A42562","mode":"ECD2E5E2-8B8E-42C6-88FD-AFC07010253E","calpha":"g941FAC34568F48A1968DDF1EA1D50F6F_calpha","nodeType":"Fresnel"},{"uuid":"FE54F90E-4E4E-4346-8765-A5CC68A1503E","type":"f","src":"g941FAC34568F48A1968DDF1EA1D50F6F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C1E43403-3B06-4175-9228-787F9EFFA6C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"0D1A69CD-51FE-46AF-9CC6-262CC5AF8961","type":"c","r":0.2,"g":0.20784313725490197,"b":0.21568627450980393,"value":3355959,"alpha":"A3DA701C-3934-4E61-B6B7-D4C60A3E5DA2","nodeType":"Color"},{"uuid":"A3DA701C-3934-4E61-B6B7-D4C60A3E5DA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"7794005B-AD35-4EC2-BAA4-A5E4B5A0577C","type":"i","value":0,"nodeType":"Int"},{"uuid":"EC56F17F-307F-4FA7-A411-604A93E483A4","type":"f","value":1,"nodeType":"Float"},{"uuid":"70ADDE56-E880-4586-9343-E479934BBA36","type":"i","value":0,"nodeType":"Int"},{"uuid":"0D9B1AE4-B313-40E2-AA3B-12F337A9558A","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"B53599A3-AA2F-4EFC-BC3E-8701681875C9","type":"c","r":0.2980392156862745,"g":0.2980392156862745,"b":0.2980392156862745,"value":5000268,"nodeType":"Color"},{"uuid":"D5FAE4A3-8670-4829-ACCB-7D3CDDE2AE7A","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3030775E-876A-4F67-A782-BA330F51CD50","type":"f","value":1,"nodeType":"Float"},{"uuid":"E9E2AB17-47A1-4AE3-9A6A-24D94FB10792","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"EC9385BD-C519-4BCC-AB31-C3A4D94B9B84","type":"f","value":1,"nodeType":"Float"},{"uuid":"42087A01-282F-4D11-91CF-D1F93D150D77","type":"f","value":0.52,"nodeType":"Float"},{"uuid":"F3B91877-D268-4069-A8FA-584A190982AF","type":"i","value":0,"nodeType":"Int"},{"uuid":"FDCDE597-F1F0-4FCD-ACC9-AAEC20BC3831","type":"lambert","color":"0D1A69CD-51FE-46AF-9CC6-262CC5AF8961","emissiveIntensity":"2207B41C-8D1D-49C0-8BC3-845A0B23381F","shadingAlpha":"EC56F17F-307F-4FA7-A411-604A93E483A4","shadingBlend":"70ADDE56-E880-4586-9343-E479934BBA36","afterColor":"2F858C99-2646-42F7-ADC2-77794F248BA6","alpha":"C8080906-491D-45D4-B200-D4ABB6A4B524","emissive":"0D9B1AE4-B313-40E2-AA3B-12F337A9558A","nodeType":"Lambert"},{"uuid":"2207B41C-8D1D-49C0-8BC3-845A0B23381F","type":"f","value":1,"nodeType":"Float"},{"uuid":"2F858C99-2646-42F7-ADC2-77794F248BA6","type":"v3","a":"E9C85541-309E-4382-A18D-8973174FFC7D","b":"F333651C-A03A-46E3-8668-DEDC7CCCE501","alpha":"53C58674-7245-4FCC-A30E-348A011165C6","mode":"F3B91877-D268-4069-A8FA-584A190982AF","nodeType":"Blend"},{"uuid":"E9C85541-309E-4382-A18D-8973174FFC7D","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F333651C-A03A-46E3-8668-DEDC7CCCE501","type":"v3","color":"B53599A3-AA2F-4EFC-BC3E-8701681875C9","bias":"D5FAE4A3-8670-4829-ACCB-7D3CDDE2AE7A","scale":"3030775E-876A-4F67-A782-BA330F51CD50","intensity":"E9E2AB17-47A1-4AE3-9A6A-24D94FB10792","factor":"EC9385BD-C519-4BCC-AB31-C3A4D94B9B84","alpha":"42087A01-282F-4D11-91CF-D1F93D150D77","mode":"F3B91877-D268-4069-A8FA-584A190982AF","calpha":"gF333651CA03A46E38668DEDC7CCCE501_calpha","nodeType":"Fresnel"},{"uuid":"53C58674-7245-4FCC-A30E-348A011165C6","type":"f","src":"gF333651CA03A46E38668DEDC7CCCE501_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C8080906-491D-45D4-B200-D4ABB6A4B524","type":"f","value":1,"nodeType":"Float"},{"uuid":"87E13DA1-42C8-4C17-80B3-F47620FAF571","type":"f","value":1,"nodeType":"Float"},{"uuid":"7E8A7538-AE30-4E1E-A4EF-D69411DBD202","type":"i","value":0,"nodeType":"Int"},{"uuid":"0638749A-8536-4333-B75E-B3F5ED68C3B0","type":"f","value":30,"nodeType":"Float"},{"uuid":"B16EDF1D-FF51-4252-8050-030FC6A707BE","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"83210073-F315-4A37-B571-4F9F619D8418","type":"f","value":10,"nodeType":"Float"},{"uuid":"4E3B4D20-E534-4F4B-8198-922A9C53CEAF","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"DF0831F5-C6D6-4A39-8CDE-0EEAB6A01988","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C5E8F300-3E56-4C97-8142-CEF6DF818791","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"203AE677-D7DB-410A-BD73-AB820FE5430F","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"B04865D5-585E-47F6-A561-9FF0571907AA","project":false,"nodeType":"Texture"},{"uuid":"B04865D5-585E-47F6-A561-9FF0571907AA","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BC931284-B29F-46F7-A290-7562A34085C7","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"F599E15E-6B05-412C-9EE7-C50871A33B05","project":false,"nodeType":"Texture"},{"uuid":"F599E15E-6B05-412C-9EE7-C50871A33B05","type":"v2","index":0,"nodeType":"UV"},{"uuid":"76D375B6-A285-4C62-A0F1-D644D2BBB2CF","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"6DD5D33D-0F8B-4375-99DE-A9641DEED01F","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F1AA961-8D51-4726-A979-99B2CEA050F3","type":"i","value":0,"nodeType":"Int"},{"uuid":"DA108BEF-32C2-44E8-98F8-216BFCBC1CFD","type":"f","value":50,"nodeType":"Float"},{"uuid":"F3B7F36F-19D3-4B1E-82CD-68B00B77A42B","type":"f","value":168,"nodeType":"Float"},{"uuid":"934FE451-CC20-441C-9EB9-4AA23A81DE23","type":"f","value":1,"nodeType":"Float"},{"uuid":"F85660FD-36B3-4945-8DCE-94BF946D1130","type":"f","value":0,"nodeType":"Float"},{"uuid":"C946A3EA-80AE-4B9A-B0FD-34A8FD0DFCCD","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3C0F57FB-6898-4502-BFB5-4A0697546B4F","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"8C705B0F-0964-4945-A663-B8B968651848","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"646F2943-AF0E-4353-814E-A292B0335D10","type":"f","value":1,"nodeType":"Float"},{"uuid":"90DA77CA-D899-4836-9F9D-5133FB678BFB","type":"i","value":2,"nodeType":"Int"},{"uuid":"96DAE8F4-210D-40C5-B850-CC6D742D8912","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"2F06FE68-FB68-4707-8516-B60DBA03E7D7","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FB379027-10E1-4978-80A9-509F78D5C95B","type":"f","value":1,"nodeType":"Float"},{"uuid":"64322DF6-DCE1-4B43-83CB-E234875F9FB3","type":"f","value":2,"nodeType":"Float"},{"uuid":"2436F695-E4FC-4E54-BD44-FDBF6AA2AEDE","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"084124E5-82A9-4CFA-8DB4-5D38C2BA52A3","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB09C976-5506-40FE-91B1-F04085EA06FD","type":"i","value":2,"nodeType":"Int"},{"uuid":"A0548EAF-25E9-4709-8C52-91E08FB1BF2E","type":"phong","color":"09E4C5B1-1BC6-424A-9AED-3D160254495D","specular":"B16EDF1D-FF51-4252-8050-030FC6A707BE","shininess":"0638749A-8536-4333-B75E-B3F5ED68C3B0","shadingAlpha":"87E13DA1-42C8-4C17-80B3-F47620FAF571","shadingBlend":"7E8A7538-AE30-4E1E-A4EF-D69411DBD202","afterColor":"E6905BD0-58DE-482E-BB0D-70031BC47420","alpha":"030D7A9A-C07C-4F50-9BC6-DDA4BDA9C12A","nodeType":"Phong"},{"uuid":"09E4C5B1-1BC6-424A-9AED-3D160254495D","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"E6905BD0-58DE-482E-BB0D-70031BC47420","type":"v3","a":"9D56738E-FE92-4DD5-9592-A171EBE881D2","b":"1954A4B0-0859-42C9-9B5A-7C14445AD4FF","alpha":"71BFA852-30FE-4FB5-A5DF-1E9D132532C8","mode":"DB09C976-5506-40FE-91B1-F04085EA06FD","nodeType":"Blend"},{"uuid":"9D56738E-FE92-4DD5-9592-A171EBE881D2","type":"v3","a":"B5644D47-7065-41A0-8350-75E5C25E2824","b":"F777D15B-765D-407D-9D1E-BE686DEFE1A3","alpha":"25FF6D5A-99B8-4EEC-96AB-053D9954019D","mode":"90DA77CA-D899-4836-9F9D-5133FB678BFB","nodeType":"Blend"},{"uuid":"B5644D47-7065-41A0-8350-75E5C25E2824","type":"v3","a":"68A8EC33-BF30-47AE-BDF9-CA4267733C5F","b":"27B8506F-EA64-4505-939E-7A63F90E721A","alpha":"4887A7DD-B32D-4F1D-9DB2-45CFA64A3781","mode":"5F1AA961-8D51-4726-A979-99B2CEA050F3","nodeType":"Blend"},{"uuid":"68A8EC33-BF30-47AE-BDF9-CA4267733C5F","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"27B8506F-EA64-4505-939E-7A63F90E721A","type":"v3","thickness":"83210073-F315-4A37-B571-4F9F619D8418","ior":"4E3B4D20-E534-4F4B-8198-922A9C53CEAF","roughness":"DF0831F5-C6D6-4A39-8CDE-0EEAB6A01988","alpha":"6DD5D33D-0F8B-4375-99DE-A9641DEED01F","calpha":"g27B8506FEA644505939E7A63F90E721A_calpha","nodeType":"Transmission"},{"uuid":"4887A7DD-B32D-4F1D-9DB2-45CFA64A3781","type":"f","src":"g27B8506FEA644505939E7A63F90E721A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F777D15B-765D-407D-9D1E-BE686DEFE1A3","type":"v3","near":"DA108BEF-32C2-44E8-98F8-216BFCBC1CFD","far":"F3B7F36F-19D3-4B1E-82CD-68B00B77A42B","isVector":"934FE451-CC20-441C-9EB9-4AA23A81DE23","isWorldSpace":"F85660FD-36B3-4945-8DCE-94BF946D1130","origin":"C946A3EA-80AE-4B9A-B0FD-34A8FD0DFCCD","colorA":"3C0F57FB-6898-4502-BFB5-4A0697546B4F","colorB":"8C705B0F-0964-4945-A663-B8B968651848","alpha":"646F2943-AF0E-4353-814E-A292B0335D10","nodeType":"Depth"},{"uuid":"25FF6D5A-99B8-4EEC-96AB-053D9954019D","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"646F2943-AF0E-4353-814E-A292B0335D10"},"nodeType":"Expression"},{"uuid":"1954A4B0-0859-42C9-9B5A-7C14445AD4FF","type":"v3","color":"96DAE8F4-210D-40C5-B850-CC6D742D8912","bias":"2F06FE68-FB68-4707-8516-B60DBA03E7D7","scale":"FB379027-10E1-4978-80A9-509F78D5C95B","intensity":"64322DF6-DCE1-4B43-83CB-E234875F9FB3","factor":"2436F695-E4FC-4E54-BD44-FDBF6AA2AEDE","alpha":"084124E5-82A9-4CFA-8DB4-5D38C2BA52A3","mode":"DB09C976-5506-40FE-91B1-F04085EA06FD","calpha":"g1954A4B0085942C99B5A7C14445AD4FF_calpha","nodeType":"Fresnel"},{"uuid":"71BFA852-30FE-4FB5-A5DF-1E9D132532C8","type":"f","src":"g1954A4B0085942C99B5A7C14445AD4FF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"030D7A9A-C07C-4F50-9BC6-DDA4BDA9C12A","type":"f","value":1,"nodeType":"Float"},{"uuid":"95F26D7D-BA27-424E-A4BE-4A01E6A300BC","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"39BA69A0-3834-4F00-84EE-DEA2015A9BA3","nodeType":"Color"},{"uuid":"39BA69A0-3834-4F00-84EE-DEA2015A9BA3","type":"f","value":1,"nodeType":"Float"},{"uuid":"C937F351-D680-480A-9B2C-3B1654DBF0B6","type":"i","value":0,"nodeType":"Int"},{"uuid":"9EA8F58E-A1DF-4E86-AA79-D19D2069078B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C6EE4475-6964-47CA-BD89-01618D8CB2EC","type":"i","value":0,"nodeType":"Int"},{"uuid":"18553466-292A-483D-BE43-EE84F40039C3","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"79C0247B-DB76-43D6-9840-89E175A57D8D","type":"f","value":0,"nodeType":"Float"},{"uuid":"2C22527A-B375-442E-93F4-085D007A3E73","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F4E56EA1-3060-4144-B249-3E5C50E85030","type":"standard","color":"95F26D7D-BA27-424E-A4BE-4A01E6A300BC","roughness":"18553466-292A-483D-BE43-EE84F40039C3","metalness":"79C0247B-DB76-43D6-9840-89E175A57D8D","alpha":"D1580F08-C3F4-4888-A510-04B3D4C41451","reflectivity":"2C22527A-B375-442E-93F4-085D007A3E73","shadingAlpha":"9EA8F58E-A1DF-4E86-AA79-D19D2069078B","shadingBlend":"C6EE4475-6964-47CA-BD89-01618D8CB2EC","nodeType":"Standard"},{"uuid":"D1580F08-C3F4-4888-A510-04B3D4C41451","type":"f","value":1,"nodeType":"Float"},{"uuid":"9ED6121A-D030-4326-B46A-9606F3A85A5A","type":"f","value":1,"nodeType":"Float"},{"uuid":"D135C7B5-4406-42CD-9181-A8F1F76EF840","type":"i","value":0,"nodeType":"Int"},{"uuid":"1897C63D-78DE-4F41-BE66-5703660147F1","type":"f","value":30,"nodeType":"Float"},{"uuid":"F09C648A-4BE0-445D-9DCB-57388C75FBA3","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"0E863D9C-1F54-4630-A70F-B93F42B8F32E","type":"f","value":10,"nodeType":"Float"},{"uuid":"8F155AD9-71D6-48CE-8536-E7744942959E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"BE0CF9B5-6E53-4C9C-9CDF-5A874270043A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9DB59573-A820-471D-839F-B5CCBBDB700C","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"FA69EE3D-1806-473D-820A-A4419E4EEA33","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4920B756-47C2-4E46-987F-BAFC4D84729D","type":"f","value":1,"nodeType":"Float"},{"uuid":"DD7FEF8E-9952-465F-9938-9D9C7E417B7C","type":"i","value":0,"nodeType":"Int"},{"uuid":"4174BBC1-7049-4905-8F2B-A9237BE38C9B","type":"f","value":50,"nodeType":"Float"},{"uuid":"C68E9BDB-9B94-4E0D-B9BB-F82A59000AA3","type":"f","value":118,"nodeType":"Float"},{"uuid":"4F226DA3-1CFB-478E-8BAE-BA28AD7D6D70","type":"f","value":1,"nodeType":"Float"},{"uuid":"22BE8949-7149-4880-95FD-B8437E453E7C","type":"f","value":0,"nodeType":"Float"},{"uuid":"9F3C8F6F-591B-49BE-960D-503A2B835011","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"30804933-6768-4111-A4F0-295058AD58ED","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"9F05786D-7487-473A-90AB-E7BF9DEABDCA","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"D5B4871F-D3FD-4A3F-9CD6-3E4EEAEB8884","type":"f","value":1,"nodeType":"Float"},{"uuid":"CAE1222F-86FD-4B68-BBB1-D3D9F14C2EC8","type":"i","value":2,"nodeType":"Int"},{"uuid":"4BAA6334-C18E-419C-B0BD-D230D19E64C5","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"253EA2E6-6F21-4A94-90DD-11DAE74CC63D","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"D7D3410C-FB27-41CF-AA92-F2964692987A","type":"f","value":1,"nodeType":"Float"},{"uuid":"DA191B01-DC66-4C15-839E-5315F0174EF8","type":"f","value":2,"nodeType":"Float"},{"uuid":"2269617C-0C5E-4782-8DD4-4BF97E598EC4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"D6C2BB56-E17C-49E3-B787-202E8C547F8B","type":"f","value":1,"nodeType":"Float"},{"uuid":"25CC7EB6-B95A-4A61-90B6-1BBF34AF8944","type":"i","value":2,"nodeType":"Int"},{"uuid":"32B93D62-2E92-4A31-9B6A-657E46A8626C","type":"f","value":1,"nodeType":"Float"},{"uuid":"5700CD39-056C-4257-91F1-B9E731A8EEB9","type":"i","value":0,"nodeType":"Int"},{"uuid":"9769A9A7-FB80-4763-B04D-0D3CD43136B5","type":"f","value":30,"nodeType":"Float"},{"uuid":"530EC8A0-2445-4587-B1C8-BC5F366D0E43","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"461968BF-246C-43EE-B045-C9894C826D41","type":"f","value":10,"nodeType":"Float"},{"uuid":"34FC42D2-2BD9-4506-8418-00D6B207D709","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"827E409E-5AAA-43BA-9B9A-A529FBE2D5ED","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"059848C7-7E84-4315-AF62-5085E17094E1","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"34E2897E-8E6C-4CD8-AB48-7EB02748967C","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"DD395322-2859-4BCA-9695-9343A85C77DD","type":"f","value":1,"nodeType":"Float"},{"uuid":"4DD616B8-F6F8-4D1E-9130-31EF3925676C","type":"i","value":0,"nodeType":"Int"},{"uuid":"52AE96AA-971C-488A-BB9A-8D3D8065FC77","type":"f","value":50,"nodeType":"Float"},{"uuid":"ACB1019C-6C79-425D-B4CF-FD5B64F127B4","type":"f","value":118,"nodeType":"Float"},{"uuid":"91309FA6-77B3-4CAE-B8AD-A3B435B59D80","type":"f","value":1,"nodeType":"Float"},{"uuid":"A2646765-CFD3-4C02-8D32-A601FB99B1FD","type":"f","value":0,"nodeType":"Float"},{"uuid":"4D2820DB-B5D0-457C-B249-E05E15138CA9","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"E1C4A787-21F6-413E-B018-E6C1DB0ACD92","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"1A119BDE-D359-4AA6-A090-4428A1BD27DD","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"1CE137C0-1CC5-4B93-A926-7607BD651A4A","type":"f","value":1,"nodeType":"Float"},{"uuid":"1922D841-B418-4B51-8332-38713CB04D3E","type":"i","value":2,"nodeType":"Int"},{"uuid":"890B4A8A-91A1-4F7C-BCDE-57E8EE338E63","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"F9AEF6F6-C927-4870-98A2-24EA5E05DC35","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E73001AC-F935-4064-9F88-0CA74D50E3E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"88E14C87-3004-457B-9A59-CF512AFDA6BF","type":"f","value":2,"nodeType":"Float"},{"uuid":"93A1A027-A32F-4D49-A356-B77FFF32BB49","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"E3142C44-7A69-40B0-879F-D65098095B2C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DC79F992-87D2-47FA-AE9E-563FFFB2C945","type":"i","value":2,"nodeType":"Int"},{"uuid":"318F0D77-D7EC-4B82-A7C3-A24697A8048F","type":"f","value":1,"nodeType":"Float"},{"uuid":"63A5B57B-5561-455E-BEF5-64DA3101DBB7","type":"i","value":0,"nodeType":"Int"},{"uuid":"AFAF1D36-4764-4CD9-8219-D16E486CFD93","type":"f","value":30,"nodeType":"Float"},{"uuid":"91772534-8A5E-4FE2-BCC6-A2C837BBD6B6","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"09A32EFB-4581-47EE-BDE6-CD6A56412B2F","type":"f","value":10,"nodeType":"Float"},{"uuid":"D6139FAE-3B5E-459C-A4C8-C000D9D2C0F1","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"E2EE7B80-464E-4252-96B7-BC791AE84B26","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"3ED88640-F460-4E1C-99E1-CA11D991D5F7","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2202EAF7-7D14-413E-BAA3-3474168CF641","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"7FCCE375-1E24-483B-B5FF-91959F47F37E","project":false,"nodeType":"Texture"},{"uuid":"7FCCE375-1E24-483B-B5FF-91959F47F37E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"3FF035CB-CF69-4B5D-B07A-75EE1D7A98BC","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"9C53739C-2D2D-43B7-9CF1-1DE5BF7C7B0D","project":false,"nodeType":"Texture"},{"uuid":"9C53739C-2D2D-43B7-9CF1-1DE5BF7C7B0D","type":"v2","index":0,"nodeType":"UV"},{"uuid":"88C1022C-6424-4E13-B9D2-A423FBD3B9CE","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"B3C645B7-A93B-40AD-A095-A7CA8C669721","type":"f","value":1,"nodeType":"Float"},{"uuid":"8028CD80-BD53-4270-B26A-6BE90B39B51C","type":"i","value":0,"nodeType":"Int"},{"uuid":"D57B4DCC-61FB-4E80-A64F-899F62D4C92E","type":"f","value":50,"nodeType":"Float"},{"uuid":"05E4A5B3-35F5-4607-B3B1-EF2DA3D8D67B","type":"f","value":118,"nodeType":"Float"},{"uuid":"A38E8507-4316-475D-9C1C-3F3423DDC3FB","type":"f","value":1,"nodeType":"Float"},{"uuid":"D7593924-791D-4463-9FBC-0ADD2BDC0696","type":"f","value":0,"nodeType":"Float"},{"uuid":"B93CD317-8AA9-4C44-AAE2-F846053BA781","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"3D9A6CD8-39B5-40C4-9EF1-59B3258EB964","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"E86089A3-357B-4F5D-A1F9-120F563B16F9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"4CD15E50-6FF6-4591-90FA-BAC91847B6D4","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F4F4DBD-1BEC-4064-A905-EF4DA1B0CD78","type":"i","value":2,"nodeType":"Int"},{"uuid":"48EA2A22-6B48-4BC6-87AA-0C80C483CBA4","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"6BE25311-FB05-4348-BCCA-2B071116A647","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"D23FF5A9-DEB4-4E81-8C76-8D6E90F81EA7","type":"f","value":1,"nodeType":"Float"},{"uuid":"51EECCE0-C525-4CA5-916A-244DC115F908","type":"f","value":2,"nodeType":"Float"},{"uuid":"E61D55B6-6B8D-490B-9CA7-0FA1FA2576AB","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"0201118B-7E1F-4D9F-AB4F-02A28DD8FD7B","type":"f","value":1,"nodeType":"Float"},{"uuid":"2ECDCC4E-BDFC-4B6A-8425-3EE6636EEDBD","type":"i","value":2,"nodeType":"Int"},{"uuid":"12461F29-50EA-440F-BBAA-FA3BD60164DF","type":"phong","color":"9544C5B4-7C47-4BFA-AA51-309BAC581937","specular":"91772534-8A5E-4FE2-BCC6-A2C837BBD6B6","shininess":"AFAF1D36-4764-4CD9-8219-D16E486CFD93","shadingAlpha":"318F0D77-D7EC-4B82-A7C3-A24697A8048F","shadingBlend":"63A5B57B-5561-455E-BEF5-64DA3101DBB7","afterColor":"0F0BFF05-1BDF-4111-BAA2-15692BB0476D","alpha":"C473E4A3-AFFC-479C-901D-49F78D3CA32D","nodeType":"Phong"},{"uuid":"9544C5B4-7C47-4BFA-AA51-309BAC581937","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"0F0BFF05-1BDF-4111-BAA2-15692BB0476D","type":"v3","a":"42ABCB56-733E-4636-B7DE-A21B688D9799","b":"D9742B37-E4E7-4378-839D-50CE850EF7F5","alpha":"B333EEE1-1AE2-4B19-9501-2A12814730CA","mode":"2ECDCC4E-BDFC-4B6A-8425-3EE6636EEDBD","nodeType":"Blend"},{"uuid":"42ABCB56-733E-4636-B7DE-A21B688D9799","type":"v3","a":"16DA2CF3-F591-4C0B-AABE-31ADF90B695A","b":"2F0769FB-5390-41C4-B089-47A740C1B5C3","alpha":"AFDF4AED-4979-4431-9417-6376A4081F15","mode":"3F4F4DBD-1BEC-4064-A905-EF4DA1B0CD78","nodeType":"Blend"},{"uuid":"16DA2CF3-F591-4C0B-AABE-31ADF90B695A","type":"v3","a":"3654845A-DCDC-4BA0-80A4-F5FAB0F65302","b":"DCDB6705-25B8-4437-AD08-0E04BF20036C","alpha":"D2F01F01-1345-4DE7-8F52-77EE4E20122E","mode":"8028CD80-BD53-4270-B26A-6BE90B39B51C","nodeType":"Blend"},{"uuid":"3654845A-DCDC-4BA0-80A4-F5FAB0F65302","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DCDB6705-25B8-4437-AD08-0E04BF20036C","type":"v3","thickness":"09A32EFB-4581-47EE-BDE6-CD6A56412B2F","ior":"D6139FAE-3B5E-459C-A4C8-C000D9D2C0F1","roughness":"E2EE7B80-464E-4252-96B7-BC791AE84B26","alpha":"B3C645B7-A93B-40AD-A095-A7CA8C669721","calpha":"gDCDB670525B84437AD080E04BF20036C_calpha","nodeType":"Transmission"},{"uuid":"D2F01F01-1345-4DE7-8F52-77EE4E20122E","type":"f","src":"gDCDB670525B84437AD080E04BF20036C_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2F0769FB-5390-41C4-B089-47A740C1B5C3","type":"v3","near":"D57B4DCC-61FB-4E80-A64F-899F62D4C92E","far":"05E4A5B3-35F5-4607-B3B1-EF2DA3D8D67B","isVector":"A38E8507-4316-475D-9C1C-3F3423DDC3FB","isWorldSpace":"D7593924-791D-4463-9FBC-0ADD2BDC0696","origin":"B93CD317-8AA9-4C44-AAE2-F846053BA781","colorA":"3D9A6CD8-39B5-40C4-9EF1-59B3258EB964","colorB":"E86089A3-357B-4F5D-A1F9-120F563B16F9","alpha":"4CD15E50-6FF6-4591-90FA-BAC91847B6D4","nodeType":"Depth"},{"uuid":"AFDF4AED-4979-4431-9417-6376A4081F15","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"4CD15E50-6FF6-4591-90FA-BAC91847B6D4"},"nodeType":"Expression"},{"uuid":"D9742B37-E4E7-4378-839D-50CE850EF7F5","type":"v3","color":"48EA2A22-6B48-4BC6-87AA-0C80C483CBA4","bias":"6BE25311-FB05-4348-BCCA-2B071116A647","scale":"D23FF5A9-DEB4-4E81-8C76-8D6E90F81EA7","intensity":"51EECCE0-C525-4CA5-916A-244DC115F908","factor":"E61D55B6-6B8D-490B-9CA7-0FA1FA2576AB","alpha":"0201118B-7E1F-4D9F-AB4F-02A28DD8FD7B","mode":"2ECDCC4E-BDFC-4B6A-8425-3EE6636EEDBD","calpha":"gD9742B37E4E74378839D50CE850EF7F5_calpha","nodeType":"Fresnel"},{"uuid":"B333EEE1-1AE2-4B19-9501-2A12814730CA","type":"f","src":"gD9742B37E4E74378839D50CE850EF7F5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C473E4A3-AFFC-479C-901D-49F78D3CA32D","type":"f","value":1,"nodeType":"Float"},{"uuid":"EC4762BD-8E6A-4A3E-B4CF-1039A289F7D6","type":"f","value":1,"nodeType":"Float"},{"uuid":"0F48A9E7-8CAF-46F7-A510-A7023B2853EB","type":"i","value":0,"nodeType":"Int"},{"uuid":"090D3B6D-EDED-4B71-A6AD-E6CF0F0D6D39","type":"f","value":30,"nodeType":"Float"},{"uuid":"C3533A17-3AA1-4DB3-AF99-3273ECA18736","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"A74B6D96-A67D-4773-BD4D-7C1B1CC171E6","type":"f","value":10,"nodeType":"Float"},{"uuid":"83D1A73C-BE1F-4B05-B892-7705243B1E92","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A66017C4-F305-4CAC-B3FB-0492AC299DE8","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"E623EC89-A08E-4131-BE33-AE07C3305457","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A7CCFA04-7512-4268-8170-A86C32AB989D","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"234623E3-CD08-4718-97A9-B7C83E444BAB","type":"f","value":1,"nodeType":"Float"},{"uuid":"BE38D03C-9A49-425A-8FDB-CCC122BF740A","type":"i","value":0,"nodeType":"Int"},{"uuid":"96C3CD00-DA99-4BE7-AA11-F7524BF29C93","type":"f","value":50,"nodeType":"Float"},{"uuid":"F5A88BBB-C517-44CB-98E8-977C36636A2C","type":"f","value":118,"nodeType":"Float"},{"uuid":"DF5119BF-6EFB-4624-B419-B301FC53DADB","type":"f","value":1,"nodeType":"Float"},{"uuid":"314264C3-273B-4F8B-98B3-48842F14DC18","type":"f","value":0,"nodeType":"Float"},{"uuid":"39E08681-4690-4DBA-A281-0E8AA8467B64","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"6801FB5A-4AA3-499B-ACDD-2417B624B3D7","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"CD672826-383A-4AED-B09B-151305E3B87C","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"5F127840-6547-438F-B45E-169550FCE932","type":"f","value":1,"nodeType":"Float"},{"uuid":"B98FCD7A-CF09-40A0-B283-FB0383FA92E1","type":"i","value":2,"nodeType":"Int"},{"uuid":"6F1065DA-0BE2-463D-AB3C-89F1E77DC53F","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"A489161C-56F5-4288-86B1-A81789BA3BDA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2C30E6DB-D27F-4BE8-801D-9AD3CE797FDC","type":"f","value":1,"nodeType":"Float"},{"uuid":"86F321CC-4DBF-4EB7-9C1F-B3F5AA358297","type":"f","value":2,"nodeType":"Float"},{"uuid":"40A58CC2-9A73-4B98-A819-A8EEB08B8BAE","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"F5836BBB-DB3F-4AFB-B2B7-CAD45D373471","type":"f","value":1,"nodeType":"Float"},{"uuid":"124653AC-46A4-4AFE-B237-87ABD4D8BF3F","type":"i","value":2,"nodeType":"Int"},{"uuid":"0ECE4493-0E73-4F2B-B98E-3384CD676B49","type":"f","value":1,"nodeType":"Float"},{"uuid":"2F837E55-6983-4FA8-A805-D729A121C851","type":"i","value":0,"nodeType":"Int"},{"uuid":"6744B04B-FD21-4DE5-BDB2-F4B1378C494F","type":"f","value":30,"nodeType":"Float"},{"uuid":"84546CBC-3AC8-4CEE-846D-3BF079F0A723","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"6376FCE1-E2B3-4933-A13C-B5A3BB75314D","type":"f","value":10,"nodeType":"Float"},{"uuid":"51F0B2C7-5944-43A7-BDE2-A05E2F467EE1","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"272F752C-0B44-4FCB-A784-6CF3F013CBC0","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B1B1B7EA-C0A0-4C4A-93B0-5F89CA656F26","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"17099A24-EE98-4375-A828-7645C6649353","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"2E14F101-FB12-4D2C-81AF-BBACEED39977","type":"f","value":1,"nodeType":"Float"},{"uuid":"5622D2F0-2923-4813-A0E7-FC53A3235092","type":"i","value":0,"nodeType":"Int"},{"uuid":"C77D0022-2D87-4626-9410-506EBAF2B715","type":"f","value":50,"nodeType":"Float"},{"uuid":"F2AE9402-1484-4E1D-B794-1804AC8E154F","type":"f","value":118,"nodeType":"Float"},{"uuid":"532EE962-BF96-4F4D-ADEE-3978E21A6644","type":"f","value":1,"nodeType":"Float"},{"uuid":"06CC043F-0E3A-4D7C-95DA-EA9AA2C3EF38","type":"f","value":0,"nodeType":"Float"},{"uuid":"FB7019DC-51C2-47CC-BD9D-78EF6DF38195","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"2F05BFE2-4D38-4850-A20E-13A3BB01A92E","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"AF1E85D5-E0F2-458B-AF20-2966ABA2B7BB","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"E532DDAE-B351-4ECC-B4DC-C378A804F1E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"0D06219F-2E46-4968-B99B-874BA74E0970","type":"i","value":2,"nodeType":"Int"},{"uuid":"6E82AF0C-DB2C-4212-89DC-DA1A47B732AC","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"629F9C07-E2BD-4E5A-857B-4CDE5D5892AB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"1E5EB17A-BA6D-4F0C-9A1B-14BB70DA488F","type":"f","value":1,"nodeType":"Float"},{"uuid":"A99D47E1-AFCB-4FB6-9995-36DACD01798B","type":"f","value":2,"nodeType":"Float"},{"uuid":"EF096DA9-6A23-4997-9569-CB95B08A365A","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"F50B3D35-BE2A-4B30-A1EE-FE152B4E3730","type":"f","value":1,"nodeType":"Float"},{"uuid":"21363135-C821-45E1-9028-6C9C0292DD7C","type":"i","value":2,"nodeType":"Int"},{"uuid":"0DD29953-061E-47B7-AFB2-7D9C1515BBA0","type":"f","value":1,"nodeType":"Float"},{"uuid":"A1D0056C-0460-46CE-8CA2-CDC467147739","type":"i","value":0,"nodeType":"Int"},{"uuid":"7EA172C3-FFBD-463C-8855-CB5BD609948C","type":"f","value":30,"nodeType":"Float"},{"uuid":"17165DDB-7B22-416A-BB88-53AF00383BC5","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"6678F259-C5C9-497E-8F31-10C0EFB845C6","type":"f","value":10,"nodeType":"Float"},{"uuid":"7DB8AB38-6FD8-4FC6-9C72-E0D03AA6430B","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"23CA44CA-4F4B-4E66-8FA8-0EABD50452A7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4BE373AA-419D-46AD-B322-345E6F2028C4","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"330A2E80-ADF4-4412-BCEA-22AC875FD67A","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"BEF24F89-CB6E-4796-A1C2-EC9D59D534EE","project":false,"nodeType":"Texture"},{"uuid":"BEF24F89-CB6E-4796-A1C2-EC9D59D534EE","type":"v2","index":0,"nodeType":"UV"},{"uuid":"24905E61-6034-4CBF-A6C1-6C6DFEA7982D","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"D2594FA9-FB28-45FA-9007-20FBD4B8586B","project":false,"nodeType":"Texture"},{"uuid":"D2594FA9-FB28-45FA-9007-20FBD4B8586B","type":"v2","index":0,"nodeType":"UV"},{"uuid":"2840E484-F667-4C14-B7CD-236C923F75B1","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"D50BAD37-51E1-482E-B2AA-D5202534EE1D","type":"f","value":1,"nodeType":"Float"},{"uuid":"C3B2B868-48C7-45FF-8FED-6B50BB8A6BF1","type":"i","value":0,"nodeType":"Int"},{"uuid":"BF857070-8FD6-4726-B639-C6ADACC456DD","type":"f","value":50,"nodeType":"Float"},{"uuid":"043B10F2-9D72-4A60-B681-2069FE4D88F6","type":"f","value":118,"nodeType":"Float"},{"uuid":"0B493D1A-6C01-465A-B8DA-EE5C055F4885","type":"f","value":1,"nodeType":"Float"},{"uuid":"79A4A3E4-D819-428D-A50B-ABBA1313A4BD","type":"f","value":0,"nodeType":"Float"},{"uuid":"A407C1D5-F5AB-4F92-B999-529AE1399FF9","type":"v3","x":-50,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"330FF2F9-ED11-48F7-AE58-6E2C053E6626","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"0BCA820F-5DEB-4A86-84AE-FDCBC88A7D29","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"52471F4B-B7C1-4BBE-A9FE-0BA0B6F87D45","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F6C7ED5-A279-4841-9111-4F1D28EC1A48","type":"i","value":2,"nodeType":"Int"},{"uuid":"0BAD0460-3098-4692-8E1E-B095A72A7153","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"980BBE0A-928A-4A10-82DB-79DBA9703D9E","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"685FCFF1-A6A0-4E3C-91BB-BD4573C5D0C0","type":"f","value":1,"nodeType":"Float"},{"uuid":"521D422C-C4B6-468E-B16C-F8DB5610487E","type":"f","value":2,"nodeType":"Float"},{"uuid":"40827185-B8F9-4227-A0B3-B27289C04C11","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"3B17C9FD-9884-4BA0-8926-C57885FE149A","type":"f","value":1,"nodeType":"Float"},{"uuid":"21FDC273-6D98-4DDE-823F-708D6029BF10","type":"i","value":2,"nodeType":"Int"},{"uuid":"0B4E2BDC-7596-43EA-855D-ECD5A9BEC36B","type":"phong","color":"55401892-00C9-4314-ABFB-59135F701E28","specular":"17165DDB-7B22-416A-BB88-53AF00383BC5","shininess":"7EA172C3-FFBD-463C-8855-CB5BD609948C","shadingAlpha":"0DD29953-061E-47B7-AFB2-7D9C1515BBA0","shadingBlend":"A1D0056C-0460-46CE-8CA2-CDC467147739","afterColor":"2B4DEC8B-6790-4097-9928-5350038423C5","alpha":"173AC30A-F711-44E1-8814-E6CFDB165A40","nodeType":"Phong"},{"uuid":"55401892-00C9-4314-ABFB-59135F701E28","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"2B4DEC8B-6790-4097-9928-5350038423C5","type":"v3","a":"EB50B38E-8490-4413-9E61-ED321D1C022F","b":"1BE2C593-4B83-4425-AE99-D001AF6DBBFC","alpha":"473461D9-A23E-4474-8ACF-0D2867E754E8","mode":"21FDC273-6D98-4DDE-823F-708D6029BF10","nodeType":"Blend"},{"uuid":"EB50B38E-8490-4413-9E61-ED321D1C022F","type":"v3","a":"E293D6A1-C80E-43BD-B75C-60278A16E2DF","b":"9155304A-F14F-4573-B719-8BC5BA48ADEB","alpha":"C94EF131-2542-496A-B294-5242D32961C1","mode":"5F6C7ED5-A279-4841-9111-4F1D28EC1A48","nodeType":"Blend"},{"uuid":"E293D6A1-C80E-43BD-B75C-60278A16E2DF","type":"v3","a":"7347C60A-753E-45BB-B277-4A28D6553F78","b":"8881FAF9-6F08-46DC-AB10-B873A34689FD","alpha":"1EB0BD81-5636-4B57-985B-5E3ABCDC5333","mode":"C3B2B868-48C7-45FF-8FED-6B50BB8A6BF1","nodeType":"Blend"},{"uuid":"7347C60A-753E-45BB-B277-4A28D6553F78","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8881FAF9-6F08-46DC-AB10-B873A34689FD","type":"v3","thickness":"6678F259-C5C9-497E-8F31-10C0EFB845C6","ior":"7DB8AB38-6FD8-4FC6-9C72-E0D03AA6430B","roughness":"23CA44CA-4F4B-4E66-8FA8-0EABD50452A7","alpha":"D50BAD37-51E1-482E-B2AA-D5202534EE1D","calpha":"g8881FAF96F0846DCAB10B873A34689FD_calpha","nodeType":"Transmission"},{"uuid":"1EB0BD81-5636-4B57-985B-5E3ABCDC5333","type":"f","src":"g8881FAF96F0846DCAB10B873A34689FD_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9155304A-F14F-4573-B719-8BC5BA48ADEB","type":"v3","near":"BF857070-8FD6-4726-B639-C6ADACC456DD","far":"043B10F2-9D72-4A60-B681-2069FE4D88F6","isVector":"0B493D1A-6C01-465A-B8DA-EE5C055F4885","isWorldSpace":"79A4A3E4-D819-428D-A50B-ABBA1313A4BD","origin":"A407C1D5-F5AB-4F92-B999-529AE1399FF9","colorA":"330FF2F9-ED11-48F7-AE58-6E2C053E6626","colorB":"0BCA820F-5DEB-4A86-84AE-FDCBC88A7D29","alpha":"52471F4B-B7C1-4BBE-A9FE-0BA0B6F87D45","nodeType":"Depth"},{"uuid":"C94EF131-2542-496A-B294-5242D32961C1","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"52471F4B-B7C1-4BBE-A9FE-0BA0B6F87D45"},"nodeType":"Expression"},{"uuid":"1BE2C593-4B83-4425-AE99-D001AF6DBBFC","type":"v3","color":"0BAD0460-3098-4692-8E1E-B095A72A7153","bias":"980BBE0A-928A-4A10-82DB-79DBA9703D9E","scale":"685FCFF1-A6A0-4E3C-91BB-BD4573C5D0C0","intensity":"521D422C-C4B6-468E-B16C-F8DB5610487E","factor":"40827185-B8F9-4227-A0B3-B27289C04C11","alpha":"3B17C9FD-9884-4BA0-8926-C57885FE149A","mode":"21FDC273-6D98-4DDE-823F-708D6029BF10","calpha":"g1BE2C5934B834425AE99D001AF6DBBFC_calpha","nodeType":"Fresnel"},{"uuid":"473461D9-A23E-4474-8ACF-0D2867E754E8","type":"f","src":"g1BE2C5934B834425AE99D001AF6DBBFC_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"173AC30A-F711-44E1-8814-E6CFDB165A40","type":"f","value":1,"nodeType":"Float"},{"uuid":"40E09983-B561-4F7E-81D1-BD7C289CCD16","type":"f","value":1,"nodeType":"Float"},{"uuid":"A0CDC8BA-126F-4E25-AAE1-326A0C444349","type":"i","value":0,"nodeType":"Int"},{"uuid":"68AE3717-3451-43C4-9E13-5E7C1F470037","type":"f","value":30,"nodeType":"Float"},{"uuid":"489D87EF-A47B-480A-892C-26E0FDAE1F94","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"F5CAD60E-D095-4472-96A1-08F7D209206C","type":"f","value":10,"nodeType":"Float"},{"uuid":"3CC91A05-0C62-476F-AC49-23FC9061575B","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2A472632-5C66-4047-B626-994ECD505D6F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"23F583B3-EF18-45A4-8110-4176D53F7F38","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"5F061E7E-27EC-4055-9F77-80FB9218D5E7","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"11968214-C2CD-4B12-BB0A-571B3CDC0917","type":"f","value":1,"nodeType":"Float"},{"uuid":"00ED0A8C-D0A4-47F3-9400-9E85821377D6","type":"i","value":0,"nodeType":"Int"},{"uuid":"E34513A2-8644-4337-8C0A-6C939094DAEC","type":"f","value":50,"nodeType":"Float"},{"uuid":"7625CCC4-0FDA-4D2F-B470-5A91759D5504","type":"f","value":168,"nodeType":"Float"},{"uuid":"B3C7D04C-D80B-4AA4-9F39-D66759723CEE","type":"f","value":1,"nodeType":"Float"},{"uuid":"4EC3C32E-D49C-40AA-9A2B-5B0926B01BB0","type":"f","value":0,"nodeType":"Float"},{"uuid":"4CBDC01F-E341-4C5D-91D8-B54A59E327BA","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F5C0A88B-E2C3-42C0-A07F-F8BB951DE9B0","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"B4357DD1-6107-42D1-A4C4-2F32E288D092","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"1D36FEAF-69A6-4709-99CF-E42A8A5FF8E6","type":"f","value":1,"nodeType":"Float"},{"uuid":"35FF0157-6C7C-4787-861D-F253F8319828","type":"i","value":2,"nodeType":"Int"},{"uuid":"FA0B0986-97F6-49E2-8CB6-F5620E38EF87","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"D731A30E-F481-4873-9BA7-52B0758F7E78","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"82855F09-B15A-4529-9912-0B6C8A02E100","type":"f","value":1,"nodeType":"Float"},{"uuid":"11EA3B64-63F8-4C55-BF08-8A2ED8C5AA97","type":"f","value":2,"nodeType":"Float"},{"uuid":"C657785A-82C8-4D8C-8BF6-F490B2D3CEC5","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"17D0D65E-D4A7-4671-8C99-0B895DD8F9D7","type":"f","value":1,"nodeType":"Float"},{"uuid":"68A155EA-A230-416C-9AAF-A942D3BEF0A2","type":"i","value":2,"nodeType":"Int"},{"uuid":"2DD83EF7-C185-4CB5-A96E-B2166D04A794","type":"f","value":1,"nodeType":"Float"},{"uuid":"E85D4476-2E51-4875-9747-ACCFF295BA43","type":"i","value":0,"nodeType":"Int"},{"uuid":"188EA580-F89E-4ABF-976A-2D14FC8DC255","type":"f","value":30,"nodeType":"Float"},{"uuid":"694DC6F4-5BB5-400C-9F73-1428FDEC6B5A","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"178962FE-6506-4F97-BFBE-B936EDE846D7","type":"f","value":10,"nodeType":"Float"},{"uuid":"36D874FA-689C-4019-9D5A-6DECB4FC14AF","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"68783777-D2CC-45B1-B71E-699A97BF03E7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"3332D764-DDE9-416C-9E93-F0C75CA86585","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"594E716E-364C-4BF0-BFA9-A09EBAF3CBB3","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"4CFC0D0B-7518-4883-8603-6E6BF63FAB13","type":"f","value":1,"nodeType":"Float"},{"uuid":"D0816B90-98A6-41CF-9F99-26EF784E151C","type":"i","value":0,"nodeType":"Int"},{"uuid":"C5D6FD91-2526-429F-AA5D-66BBE5A46F57","type":"f","value":50,"nodeType":"Float"},{"uuid":"693BC758-1C55-4581-9C62-F8B760775086","type":"f","value":168,"nodeType":"Float"},{"uuid":"10EAFD39-1B69-4F32-B956-8B56512FF1CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"F27AFAE2-4E26-4B08-AD92-81FDDD01751B","type":"f","value":0,"nodeType":"Float"},{"uuid":"F617981D-2879-4792-B09B-7B81CF924847","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D76A2EAA-98BD-4321-88E5-8B0F26C6E13D","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"877958F6-E00C-4BBB-9744-4E268130B0DC","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"55691E50-A061-425C-8BB9-AAEA9743457A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8AA252D5-DB19-4C42-B121-EC4EAAD06359","type":"i","value":2,"nodeType":"Int"},{"uuid":"4FCD80BF-64C7-4B54-84B0-BFE9D0491955","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"CF85B954-654F-45B2-AB9C-5AB0C80928E6","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4858C772-60B7-4B24-B63D-C9ADACBF095F","type":"f","value":1,"nodeType":"Float"},{"uuid":"918F313A-AEDD-4DB2-8F13-422F475D133E","type":"f","value":2,"nodeType":"Float"},{"uuid":"971E9C5A-6E17-42D3-A033-DC793A5254B7","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"427DC76F-3F7E-46F8-82A6-F4F68E79A1C9","type":"f","value":1,"nodeType":"Float"},{"uuid":"A312AE6E-81E2-46E6-9477-A52299673308","type":"i","value":2,"nodeType":"Int"},{"uuid":"E4AE45E5-71DC-4B86-84A0-0D41D5C42CAC","type":"f","value":1,"nodeType":"Float"},{"uuid":"C0F8BB8D-989D-43ED-9D76-630E7A5F175E","type":"i","value":0,"nodeType":"Int"},{"uuid":"12663258-A5F9-4BE1-B5B9-0803D809B00E","type":"f","value":30,"nodeType":"Float"},{"uuid":"9A2933C0-14C9-4844-998A-3FE9FC997053","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"9F3CB2F5-6B00-4890-8A54-08601509117A","type":"f","value":10,"nodeType":"Float"},{"uuid":"1D8D3D95-3314-4DF5-91F4-0309E1E4318D","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"D4CBAA6E-16DC-41E8-AF5B-45313BBC5CC7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"7CC872C8-6250-453E-8E74-D4F1EAD7433A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"EFF73A3C-AD95-44D1-B03F-6635888E23A0","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"221B2504-FCF8-4CDA-833D-715C8355E147","project":false,"nodeType":"Texture"},{"uuid":"221B2504-FCF8-4CDA-833D-715C8355E147","type":"v2","index":0,"nodeType":"UV"},{"uuid":"D33A8471-8821-43F2-914E-0C8A80E6D738","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"F4D062C8-26C7-4263-8066-DA4354558CEF","project":false,"nodeType":"Texture"},{"uuid":"F4D062C8-26C7-4263-8066-DA4354558CEF","type":"v2","index":0,"nodeType":"UV"},{"uuid":"77386A90-F434-4705-8805-A031DD263E5B","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"81AF7FAA-7285-4748-8E09-8F05DFAB07BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"750F1D4B-912A-46A7-9084-7AC44EC573C4","type":"i","value":0,"nodeType":"Int"},{"uuid":"7A01D04D-58EA-4FA3-A77A-0B9AC6FAAE5A","type":"f","value":50,"nodeType":"Float"},{"uuid":"C5B56D22-56FC-4E53-B7EF-F08D3F9A1FFE","type":"f","value":168,"nodeType":"Float"},{"uuid":"741B31C9-15EC-453C-9DE8-06DA97A224AA","type":"f","value":1,"nodeType":"Float"},{"uuid":"86A9EAB3-6FA9-49A1-A57E-0B416B7CFED6","type":"f","value":0,"nodeType":"Float"},{"uuid":"67AB4424-4D15-4F54-B3B1-37CA9E1E8CD1","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"BEE365C4-EA46-4B60-9E27-904B627D529A","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"01FAFCD0-13BC-4B43-8818-75D7DAA8F3F9","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"BF08904E-5DBD-4618-8C58-F4F1693C9AA7","type":"f","value":1,"nodeType":"Float"},{"uuid":"7F214A96-8F56-4976-8D9C-BAE67DA1712E","type":"i","value":2,"nodeType":"Int"},{"uuid":"445B200F-0B8C-43F5-B344-EBC0B47BBBEF","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"8ED40C68-445D-4025-B222-E114D2E5ACD8","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"816E458D-B720-4A0E-B225-E31A6AF972A1","type":"f","value":1,"nodeType":"Float"},{"uuid":"956C8EF0-C364-4E30-AA12-D8D5756C01DF","type":"f","value":2,"nodeType":"Float"},{"uuid":"E28504FB-3857-4AB8-9B21-F3EDB8B85D09","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"F786749F-9833-435A-B766-FE9EA95D5C10","type":"f","value":1,"nodeType":"Float"},{"uuid":"893EA6CB-095A-45DE-BA1C-B568AAA2EEE3","type":"i","value":2,"nodeType":"Int"},{"uuid":"66867F7A-4CEF-43DA-9AA6-E98DC20B0DB6","type":"phong","color":"4EEFCC8B-1CB1-4DD2-B5F7-3A9F39C2BFD4","specular":"9A2933C0-14C9-4844-998A-3FE9FC997053","shininess":"12663258-A5F9-4BE1-B5B9-0803D809B00E","shadingAlpha":"E4AE45E5-71DC-4B86-84A0-0D41D5C42CAC","shadingBlend":"C0F8BB8D-989D-43ED-9D76-630E7A5F175E","afterColor":"6502912A-866C-4BC2-A642-3ABB00E999F9","alpha":"D98BB7F0-02C0-49B1-BA01-C2BC96BDA1C6","nodeType":"Phong"},{"uuid":"4EEFCC8B-1CB1-4DD2-B5F7-3A9F39C2BFD4","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"6502912A-866C-4BC2-A642-3ABB00E999F9","type":"v3","a":"2FB16291-141D-4533-A2F6-72B3572428AB","b":"70D32133-2F58-41C8-9A10-60F6D6A733D5","alpha":"8B107565-6DD3-4206-9831-9001CF91DCF4","mode":"893EA6CB-095A-45DE-BA1C-B568AAA2EEE3","nodeType":"Blend"},{"uuid":"2FB16291-141D-4533-A2F6-72B3572428AB","type":"v3","a":"4A9D0FAC-9811-4D26-877D-F52E40345C28","b":"1955B33E-1218-4BD7-B0BB-E4117DE28AF9","alpha":"005213C8-625D-4857-9BFD-1352CABB0DE0","mode":"7F214A96-8F56-4976-8D9C-BAE67DA1712E","nodeType":"Blend"},{"uuid":"4A9D0FAC-9811-4D26-877D-F52E40345C28","type":"v3","a":"EFE66D81-CDB6-44D4-B55E-354FBA89B246","b":"BF099058-E098-4D95-AC91-7D3BBBD4B9F0","alpha":"2395235A-3B68-4CB4-B597-B0558ACC47A4","mode":"750F1D4B-912A-46A7-9084-7AC44EC573C4","nodeType":"Blend"},{"uuid":"EFE66D81-CDB6-44D4-B55E-354FBA89B246","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BF099058-E098-4D95-AC91-7D3BBBD4B9F0","type":"v3","thickness":"9F3CB2F5-6B00-4890-8A54-08601509117A","ior":"1D8D3D95-3314-4DF5-91F4-0309E1E4318D","roughness":"D4CBAA6E-16DC-41E8-AF5B-45313BBC5CC7","alpha":"81AF7FAA-7285-4748-8E09-8F05DFAB07BD","calpha":"gBF099058E0984D95AC917D3BBBD4B9F0_calpha","nodeType":"Transmission"},{"uuid":"2395235A-3B68-4CB4-B597-B0558ACC47A4","type":"f","src":"gBF099058E0984D95AC917D3BBBD4B9F0_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1955B33E-1218-4BD7-B0BB-E4117DE28AF9","type":"v3","near":"7A01D04D-58EA-4FA3-A77A-0B9AC6FAAE5A","far":"C5B56D22-56FC-4E53-B7EF-F08D3F9A1FFE","isVector":"741B31C9-15EC-453C-9DE8-06DA97A224AA","isWorldSpace":"86A9EAB3-6FA9-49A1-A57E-0B416B7CFED6","origin":"67AB4424-4D15-4F54-B3B1-37CA9E1E8CD1","colorA":"BEE365C4-EA46-4B60-9E27-904B627D529A","colorB":"01FAFCD0-13BC-4B43-8818-75D7DAA8F3F9","alpha":"BF08904E-5DBD-4618-8C58-F4F1693C9AA7","nodeType":"Depth"},{"uuid":"005213C8-625D-4857-9BFD-1352CABB0DE0","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"BF08904E-5DBD-4618-8C58-F4F1693C9AA7"},"nodeType":"Expression"},{"uuid":"70D32133-2F58-41C8-9A10-60F6D6A733D5","type":"v3","color":"445B200F-0B8C-43F5-B344-EBC0B47BBBEF","bias":"8ED40C68-445D-4025-B222-E114D2E5ACD8","scale":"816E458D-B720-4A0E-B225-E31A6AF972A1","intensity":"956C8EF0-C364-4E30-AA12-D8D5756C01DF","factor":"E28504FB-3857-4AB8-9B21-F3EDB8B85D09","alpha":"F786749F-9833-435A-B766-FE9EA95D5C10","mode":"893EA6CB-095A-45DE-BA1C-B568AAA2EEE3","calpha":"g70D321332F5841C89A1060F6D6A733D5_calpha","nodeType":"Fresnel"},{"uuid":"8B107565-6DD3-4206-9831-9001CF91DCF4","type":"f","src":"g70D321332F5841C89A1060F6D6A733D5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D98BB7F0-02C0-49B1-BA01-C2BC96BDA1C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"E56022B5-6F7E-4F3B-A7C9-CA1D58E0A50A","type":"f","value":1,"nodeType":"Float"},{"uuid":"8CB81451-087A-495F-AB08-665B07C3FB80","type":"i","value":0,"nodeType":"Int"},{"uuid":"DC73BC35-E6DC-49C6-ADFC-E3E466F5B291","type":"f","value":30,"nodeType":"Float"},{"uuid":"4FB2B352-CFFA-49A4-A772-27E21DF4C649","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"40A6718B-3FA4-40E2-A0BE-9B196B0B874E","type":"f","value":10,"nodeType":"Float"},{"uuid":"9A9E451A-1845-46D8-86BB-B6413E3D1606","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"69165B73-71B4-474D-A608-ED6DC36F16C2","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"4760FD8B-6FC2-4A7E-B489-642F91538B99","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"D597215C-A813-4211-88E3-1FE959EB7B54","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"10A0E5B5-6774-4BD5-99E7-C1CC6D4C1D2E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B237F13B-F7A0-476E-9F1A-783A8BE55992","type":"i","value":0,"nodeType":"Int"},{"uuid":"FD9CDED6-7CCB-46FA-8A0B-B7C910F50DBB","type":"f","value":50,"nodeType":"Float"},{"uuid":"5EF531DD-B88A-443A-9E5C-1B885789A61E","type":"f","value":168,"nodeType":"Float"},{"uuid":"C142DA10-A0D8-4FFA-B168-55B317A78AC5","type":"f","value":1,"nodeType":"Float"},{"uuid":"142940FC-2FCC-442E-9454-D7F844929EF4","type":"f","value":0,"nodeType":"Float"},{"uuid":"706980B4-F7DB-47BC-8F59-9DA0E37FDAEE","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"EBB974B8-452D-4FF5-91B5-A4C4182D46BD","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"FE3EFD06-9710-4AF7-B764-74CD192E9F37","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"59210056-048C-4B63-A3D5-14C70FB18423","type":"f","value":1,"nodeType":"Float"},{"uuid":"86F207A7-5A19-4D29-AC91-3358FFED8B71","type":"i","value":2,"nodeType":"Int"},{"uuid":"FF2E4A56-C38F-4FC5-B5B8-CEA868566159","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"2CCC3FE7-8765-4C7D-BF69-0625FAED5BA5","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3F59FF1F-1E36-43B5-9958-16873A80A72F","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE65C37F-C151-4BB0-B573-CC350B32B180","type":"f","value":2,"nodeType":"Float"},{"uuid":"B3D7926C-B17B-4A34-9DAB-1BF7BD812A1D","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"142B6B60-77B1-44C1-A7BF-EB72C0B52B53","type":"f","value":1,"nodeType":"Float"},{"uuid":"029FAEA0-D9AD-4C1F-9C4A-78F1DC9AA080","type":"i","value":2,"nodeType":"Int"},{"uuid":"C875BE95-03D3-4994-AFE6-91567C7FD47C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DA138DC7-6069-4E0B-A0A4-4B9CE94F9663","type":"i","value":0,"nodeType":"Int"},{"uuid":"96209794-CC9E-4B1F-9301-1C22741B2E87","type":"f","value":30,"nodeType":"Float"},{"uuid":"BE8C97FA-A44C-482F-A62B-5866FDE04037","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"B01BB689-56B9-4115-B0C6-CEA4C2A4C3D0","type":"f","value":10,"nodeType":"Float"},{"uuid":"E725F187-3E17-43C8-9A2F-6082786E3A76","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"998BA438-54B8-4164-AE1F-80AB6D71BC79","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"6C5A96E4-7C29-4323-975E-15CCD0534B07","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"8305C10A-CAAB-4EE8-A007-4F32C6CD9839","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"C362076A-1B3F-4EDD-991C-BC9AB19CED1F","type":"f","value":1,"nodeType":"Float"},{"uuid":"DE66FCEA-F2C3-4F0C-BCD8-5DD888E76F10","type":"i","value":0,"nodeType":"Int"},{"uuid":"2F45C95F-D5BD-40A4-ABEB-E12ED16B7063","type":"f","value":50,"nodeType":"Float"},{"uuid":"C69732AE-7326-41F7-AA3B-298C1F4D28EB","type":"f","value":168,"nodeType":"Float"},{"uuid":"774BF5DC-78B4-4A0B-9145-A65FB93DA688","type":"f","value":1,"nodeType":"Float"},{"uuid":"6E615660-C11D-4808-B62C-74334A89049E","type":"f","value":0,"nodeType":"Float"},{"uuid":"263B0B3E-D7F1-444B-9030-961D18B1F9DA","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"A51D9C15-AD2E-4C98-BFDB-7612850237C9","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"7E02F5E4-65FA-491F-A11C-C1CADDAAD0BA","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"4EA2A9C7-44A0-4A87-AE7E-F6776796DFC3","type":"f","value":1,"nodeType":"Float"},{"uuid":"EAA7A141-3649-4219-AD41-AEEF24C86DE4","type":"i","value":2,"nodeType":"Int"},{"uuid":"B129C0D2-7F9C-4876-AAB3-F7311A88CE4A","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"1428A571-F61B-4BC0-B381-43686F6C4790","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B04D4F20-0DDD-4736-B86F-7FEA018F535C","type":"f","value":1,"nodeType":"Float"},{"uuid":"DB93F55B-3051-4F9F-8ADA-BB81F92131E3","type":"f","value":2,"nodeType":"Float"},{"uuid":"3A32E77F-BFCB-4B43-9D88-3712EABDB5A4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"E1176246-086A-48E6-9A97-694DC18BE84B","type":"f","value":1,"nodeType":"Float"},{"uuid":"E5C5E2F5-54B7-4C14-B7F0-A1DDEAF23ABC","type":"i","value":2,"nodeType":"Int"},{"uuid":"C8FCDDC4-20A1-4F59-B1A0-CA846E41F26A","type":"f","value":1,"nodeType":"Float"},{"uuid":"4695114D-676A-4314-A9F3-4BCC92588C91","type":"i","value":0,"nodeType":"Int"},{"uuid":"8E71BDD9-A69A-4895-8B24-1329F1EA21C5","type":"f","value":30,"nodeType":"Float"},{"uuid":"00E286EC-3F96-4536-8D6F-135C159EB860","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"B9CDF9E1-97D7-404A-B4D7-31517084C823","type":"f","value":10,"nodeType":"Float"},{"uuid":"DF97269D-3C95-4A20-AB63-2A2890CDEAC0","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"60F94C58-E616-47EB-8B51-CD165C07F353","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"1AEA9D48-AE85-44CC-B3F6-B49ED10190BB","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"09B36BA0-4D87-4FBD-A710-54497789FC4F","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"4DE38AA1-A016-4DBE-B27C-7B06F6A819C3","project":false,"nodeType":"Texture"},{"uuid":"4DE38AA1-A016-4DBE-B27C-7B06F6A819C3","type":"v2","index":0,"nodeType":"UV"},{"uuid":"1ACABDC8-103F-4F83-81AB-7F8B03A0F109","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"CB448DE4-48D6-45C9-8CE8-0A2B11A868EB","project":false,"nodeType":"Texture"},{"uuid":"CB448DE4-48D6-45C9-8CE8-0A2B11A868EB","type":"v2","index":0,"nodeType":"UV"},{"uuid":"337BBF59-704E-418A-9C95-BE1DCA92EFF2","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"EEB96118-F67B-4E11-A366-943CF5ECFF59","type":"f","value":1,"nodeType":"Float"},{"uuid":"589625BD-A951-4BF7-A7F1-48FEE253ACF8","type":"i","value":0,"nodeType":"Int"},{"uuid":"292840DF-A233-4149-B619-E42D6087AAD4","type":"f","value":50,"nodeType":"Float"},{"uuid":"0905777C-3F48-4EB7-AA77-755E108D2B61","type":"f","value":168,"nodeType":"Float"},{"uuid":"6E2E5808-18EE-4065-8EA1-468A6B1FFA5A","type":"f","value":1,"nodeType":"Float"},{"uuid":"545E40FA-5562-468A-BC7D-6AAED8FBA7C8","type":"f","value":0,"nodeType":"Float"},{"uuid":"94490DAC-1BEF-48EA-B131-B8BF1F7926C5","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"FB683507-20B9-4952-BF9E-7C0AC74F18BB","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A3D855E3-640A-486A-8AAE-ABACD0EA2AAE","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"65316EB0-29A5-418A-B4B8-FC4057156366","type":"f","value":1,"nodeType":"Float"},{"uuid":"803EA066-BDE9-43DF-BED6-AFC6C96B00FC","type":"i","value":2,"nodeType":"Int"},{"uuid":"6285A1C6-1FC4-4930-BC75-AF4828D944EC","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"A3F8C5F6-7E7D-42A5-BBF2-D62D51E0DDA1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2FBD921B-F302-42C0-8D39-631D59E069F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"F0D68495-960C-452E-A0E4-3FABAAA5D350","type":"f","value":2,"nodeType":"Float"},{"uuid":"DAFE5896-FE2E-44B9-BD25-9EB09CAD38C7","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"C036FF17-237C-4AC1-8848-5CB25A7FD2DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"E3ADCE9E-8A1C-4105-813F-C51A387D8183","type":"i","value":2,"nodeType":"Int"},{"uuid":"612514D1-AF34-43F7-B792-7F1D59E31546","type":"phong","color":"00B2E911-D226-4224-ACF9-1BA39BBB2349","specular":"00E286EC-3F96-4536-8D6F-135C159EB860","shininess":"8E71BDD9-A69A-4895-8B24-1329F1EA21C5","shadingAlpha":"C8FCDDC4-20A1-4F59-B1A0-CA846E41F26A","shadingBlend":"4695114D-676A-4314-A9F3-4BCC92588C91","afterColor":"D52A3ACC-9DD2-4AF2-A164-656E81AAE2DD","alpha":"BD94A7AA-F647-40FD-BDEA-E5691932BB98","nodeType":"Phong"},{"uuid":"00B2E911-D226-4224-ACF9-1BA39BBB2349","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"D52A3ACC-9DD2-4AF2-A164-656E81AAE2DD","type":"v3","a":"AC2B1933-07E5-4364-BFCC-63D7848FB671","b":"DE1DFD76-DDAA-469A-81EF-864DFA3075AA","alpha":"4E6034C0-0AD2-4A6F-A2F2-5A9E5F99D85E","mode":"E3ADCE9E-8A1C-4105-813F-C51A387D8183","nodeType":"Blend"},{"uuid":"AC2B1933-07E5-4364-BFCC-63D7848FB671","type":"v3","a":"05E0CA72-F708-49D8-B533-E63179FEB6D4","b":"1B2C8B19-EE36-4615-B920-F5104CF6A023","alpha":"0ABF3DBF-F8D9-43BF-9B00-736FCD413B7B","mode":"803EA066-BDE9-43DF-BED6-AFC6C96B00FC","nodeType":"Blend"},{"uuid":"05E0CA72-F708-49D8-B533-E63179FEB6D4","type":"v3","a":"BED55D2E-D69E-476B-83A1-23A73408E3D6","b":"0F737CED-CE73-4E53-8D52-6DB98430DBA8","alpha":"5EBBD2BE-D65E-447D-9A0B-650ED937289F","mode":"589625BD-A951-4BF7-A7F1-48FEE253ACF8","nodeType":"Blend"},{"uuid":"BED55D2E-D69E-476B-83A1-23A73408E3D6","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0F737CED-CE73-4E53-8D52-6DB98430DBA8","type":"v3","thickness":"B9CDF9E1-97D7-404A-B4D7-31517084C823","ior":"DF97269D-3C95-4A20-AB63-2A2890CDEAC0","roughness":"60F94C58-E616-47EB-8B51-CD165C07F353","alpha":"EEB96118-F67B-4E11-A366-943CF5ECFF59","calpha":"g0F737CEDCE734E538D526DB98430DBA8_calpha","nodeType":"Transmission"},{"uuid":"5EBBD2BE-D65E-447D-9A0B-650ED937289F","type":"f","src":"g0F737CEDCE734E538D526DB98430DBA8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1B2C8B19-EE36-4615-B920-F5104CF6A023","type":"v3","near":"292840DF-A233-4149-B619-E42D6087AAD4","far":"0905777C-3F48-4EB7-AA77-755E108D2B61","isVector":"6E2E5808-18EE-4065-8EA1-468A6B1FFA5A","isWorldSpace":"545E40FA-5562-468A-BC7D-6AAED8FBA7C8","origin":"94490DAC-1BEF-48EA-B131-B8BF1F7926C5","colorA":"FB683507-20B9-4952-BF9E-7C0AC74F18BB","colorB":"A3D855E3-640A-486A-8AAE-ABACD0EA2AAE","alpha":"65316EB0-29A5-418A-B4B8-FC4057156366","nodeType":"Depth"},{"uuid":"0ABF3DBF-F8D9-43BF-9B00-736FCD413B7B","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"65316EB0-29A5-418A-B4B8-FC4057156366"},"nodeType":"Expression"},{"uuid":"DE1DFD76-DDAA-469A-81EF-864DFA3075AA","type":"v3","color":"6285A1C6-1FC4-4930-BC75-AF4828D944EC","bias":"A3F8C5F6-7E7D-42A5-BBF2-D62D51E0DDA1","scale":"2FBD921B-F302-42C0-8D39-631D59E069F0","intensity":"F0D68495-960C-452E-A0E4-3FABAAA5D350","factor":"DAFE5896-FE2E-44B9-BD25-9EB09CAD38C7","alpha":"C036FF17-237C-4AC1-8848-5CB25A7FD2DE","mode":"E3ADCE9E-8A1C-4105-813F-C51A387D8183","calpha":"gDE1DFD76DDAA469A81EF864DFA3075AA_calpha","nodeType":"Fresnel"},{"uuid":"4E6034C0-0AD2-4A6F-A2F2-5A9E5F99D85E","type":"f","src":"gDE1DFD76DDAA469A81EF864DFA3075AA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BD94A7AA-F647-40FD-BDEA-E5691932BB98","type":"f","value":1,"nodeType":"Float"},{"uuid":"9ED138A0-918D-41C5-97EC-5C6E65D13919","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"BB2A9F2A-C18F-47D2-97B7-7354AF7D3051","nodeType":"Color"},{"uuid":"BB2A9F2A-C18F-47D2-97B7-7354AF7D3051","type":"f","value":1,"nodeType":"Float"},{"uuid":"09FFA581-0A97-4955-8E76-C4F3EE6EF4D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"978F61EE-7CB4-4301-8239-286E06A4816C","type":"i","value":0,"nodeType":"Int"},{"uuid":"DF91ABF2-1FA8-4591-BC3F-E0FDB346AD35","type":"f","value":1,"nodeType":"Float"},{"uuid":"E34C58BA-20D2-499F-91F8-600D695408A6","type":"i","value":0,"nodeType":"Int"},{"uuid":"4A59110E-82EE-49E9-9B61-504A7449CD19","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"2C6352C5-09B4-41D9-8F29-9F94DFB85D3D","type":"f","value":0,"nodeType":"Float"},{"uuid":"B046B8F1-8217-420D-BAA6-C281A077445C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"985BA411-7996-4471-8677-D0D51723E995","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"E8906334-6395-4C10-8D3F-01E33038B6EB","nodeType":"Color"},{"uuid":"E8906334-6395-4C10-8D3F-01E33038B6EB","type":"f","value":1,"nodeType":"Float"},{"uuid":"3CF03E16-27C3-416E-B1B0-A900141EA364","type":"f","value":1,"nodeType":"Float"},{"uuid":"1524FE6E-FA14-4C77-9EB5-55B631C692D8","type":"i","value":0,"nodeType":"Int"},{"uuid":"EA1C9C1B-27B1-4950-8832-2A4FD58BA1F4","type":"f","value":1,"nodeType":"Float"},{"uuid":"9461E671-1AD9-4E08-89F9-B7FC2C79A762","type":"i","value":0,"nodeType":"Int"},{"uuid":"AC739948-3C4D-4FB4-AAB0-98A977502B26","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"115D5F07-3DD8-4A3F-B565-70C2B5FD4627","type":"f","value":0,"nodeType":"Float"},{"uuid":"CD83A903-1FC8-452B-814C-342899DCCC4F","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"364C0B24-645B-4B0B-82BF-98EEFED1901A","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"1D69107B-3AB0-427C-8779-FB83CD25E519","nodeType":"Color"},{"uuid":"1D69107B-3AB0-427C-8779-FB83CD25E519","type":"f","value":1,"nodeType":"Float"},{"uuid":"62D84545-8E98-4E4E-A01F-41FB6467B007","type":"i","value":0,"nodeType":"Int"},{"uuid":"82896005-3159-49AB-AEEE-D2F91561CCD9","type":"f","value":1,"nodeType":"Float"},{"uuid":"62E55291-653E-467A-BFAF-D774CB39C3E8","type":"i","value":0,"nodeType":"Int"},{"uuid":"EC5D0636-B233-46FF-8308-0888C4BF4395","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"8BC2425B-A0D1-471E-80C9-1EE5184A1AF7","type":"f","value":0,"nodeType":"Float"},{"uuid":"6C4DA0A4-37EF-4FC8-9B2A-3321EB2F9F1C","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"15DA22C2-D90D-4683-B0BB-C8993F503705","type":"standard","color":"364C0B24-645B-4B0B-82BF-98EEFED1901A","roughness":"EC5D0636-B233-46FF-8308-0888C4BF4395","metalness":"8BC2425B-A0D1-471E-80C9-1EE5184A1AF7","alpha":"8D5B666A-2851-4C3A-A38F-E9A23B4EB185","reflectivity":"6C4DA0A4-37EF-4FC8-9B2A-3321EB2F9F1C","shadingAlpha":"82896005-3159-49AB-AEEE-D2F91561CCD9","shadingBlend":"62E55291-653E-467A-BFAF-D774CB39C3E8","nodeType":"Standard"},{"uuid":"8D5B666A-2851-4C3A-A38F-E9A23B4EB185","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[411.6750788643533,181],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[2163,951],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/motion_light/index.html b/site/spline/design/motion_light/index.html deleted file mode 100644 index 245cc9d52..000000000 --- a/site/spline/design/motion_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/motion_light/runtime.js b/site/spline/design/motion_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/motion_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=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+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvq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MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/motion_light/scene.json b/site/spline/design/motion_light/scene.json deleted file mode 100644 index 7b9e07722..000000000 --- a/site/spline/design/motion_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"B17A57C5-8F51-41A0-8755-72E1FB03E9BC","objectType":"Mesh3D","name":"Cube copy 2","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,137.90758729968002,76.4702603787693,-6.5271211759586265,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"57F7F0F1-9160-4D05-B547-492FD797C0C6","selectedState":0,"states":["76F3D3D8-C0FE-43DB-97E3-24EF46F53E97","6434020B-1738-409D-940A-40BC5E7AFC0E"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"B17A57C5-8F51-41A0-8755-72E1FB03E9BC","state":"6434020B-1738-409D-940A-40BC5E7AFC0E"}]}]},"geometry":"AADA6F5F-F0A7-4393-A05D-AA7C85C12C2E","material":"64C2FB1B-DA68-4F70-A7A1-19FF06C2A58C"},{"uuid":"C3B2E80D-6C99-48E6-8BD0-73EDB1A5A2D2","objectType":"EmptyObject","name":"Empty Object","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,2.954213988821323,78.13947375637262,-1.8278986208817116,1],"layers":1,"children":[{"uuid":"F97FD6FE-E22D-4DD1-BCE2-2F71029626A1","objectType":"Mesh3D","name":"Cylinder copy","matrix":[2.220446049250313e-16,-1,0,0,1,2.220446049250313e-16,0,0,0,0,1,0,42.05670039544452,21.270172757933196,11.392801428715757,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"47B339E8-A06D-4884-B232-7E753E4FEC6E"},"geometry":"B1A12F64-6790-4718-84AB-2DBE0DCCE1A1","material":"BFFDB0E0-D1E1-47E4-9FE5-B68BCE226708"},{"uuid":"559A35DF-5BB6-4A83-B12F-73C5429C6C67","objectType":"Mesh3D","name":"Cylinder","matrix":[2.220446049250319e-16,-1.0000000000000027,0,0,1.0000000000000027,2.220446049250319e-16,0,0,0,0,1,0,-36.23980155547658,143.6527982924297,11.392801428715757,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"6E237F15-790D-44CE-9AB0-72F68758A37C"},"geometry":"2192791C-A7AC-42D3-96C3-3E240F1BD070","material":"AB027DBB-5329-4819-ADB0-BBB477A75916"},{"uuid":"F425145E-E6ED-4457-881D-378DF6F62DA1","objectType":"Mesh3D","name":"Sphere copy 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,90.56466933672507,21.242780482544255,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"6F0F2894-2EF3-42A2-838F-AB974F041012"},"geometry":"01C7447A-33BC-4B1C-926F-19EF39BB716F","material":"3C66C255-C31B-41A0-BD7E-85AB3D849C15"},{"uuid":"C45162AD-DA7E-4281-BCA1-E1D253C8597A","objectType":"Mesh3D","name":"Sphere copy 3","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,8.80774252186879,143.58618168048997,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"9A591B65-8A73-40DA-A544-D0CC91792CDF"},"geometry":"EAB665F0-1E40-40ED-8A8B-1AF8C8A170F1","material":"36875B83-A9DA-4B5A-9475-F833BB18F734"},{"uuid":"67BF6A0B-FC48-40F1-8E98-14FDD90905E0","objectType":"Mesh3D","name":"Sphere copy 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-6.667675768086212,21.534769506883023,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"5B6AA930-EE3A-4AA7-870B-72143B9C2CAD"},"geometry":"EF63957E-2C9F-47E5-8CD3-437DC979027D","material":"826F268E-AED1-4D7C-BC56-9BECB819B94C"},{"uuid":"E485A7C6-2777-40E1-96FA-DF2CB158C194","objectType":"Mesh3D","name":"Sphere","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,-81.503769157484,143.58618168048997,13.688151233445751,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"5F1E2E88-30B9-4D84-8313-42AED0AC6242"},"geometry":"2C906C9F-2923-4218-B693-A73CE3780456","material":"5C7DB3F1-19DE-407B-B808-DD9672A11554"},{"uuid":"2B5541D2-AB4C-41CE-89AD-82B88248DE37","objectType":"VectorObject","name":"Shape","matrix":[1,0,0,0,0,1,-6.123233995736766e-17,0,0,6.123233995736766e-17,1,0,-81.35756293409446,147.00027808555518,8.705871452201706,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"8C197049-73D6-4544-B6F0-A476BA07AFEF"},"geometry":"53729C3F-2799-4F0B-A3A5-EBC6A189061D","material":"D8ADF0E3-9E44-4A65-8A62-978309534C63"},{"uuid":"B1FB1FBE-AD71-4B9C-9F58-A90D73AB5228","objectType":"Mesh3D","name":"Cube copy","matrix":[-1.000000000000002,1.2246467991473557e-16,-1.2246467991473557e-16,0,1.2246467991473532e-16,1,1.2246467991473532e-16,0,1.2246467991473557e-16,1.2246467991473557e-16,-1.000000000000002,0,2.954213988821323,83.99022153089638,-4.134692519274716,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-2.954213988821323,-83.99022153089638,-0.7767293570854896,1],"interaction":{"uuid":"560B628E-64D5-4014-9092-06D2B237F31F"},"geometry":"BB1C0DE3-F3CE-48BC-BA42-676289AC1A9B","material":"CD397085-4258-4E07-A7DF-0A31F61762CD"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"47019A9B-7552-4B72-BFCD-80E9E5519C68","selectedState":0,"states":["87316550-1E80-4D93-812A-E30C4F2C1BB8","67F4F780-4587-499B-9C8C-1855F5291534"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C3B2E80D-6C99-48E6-8BD0-73EDB1A5A2D2","state":"67F4F780-4587-499B-9C8C-1855F5291534"}]}]},"enableHelper":true},{"uuid":"6DF8EF9D-4969-49CE-9867-D9DFD3BA5C7B","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,190.26681927331737,-159.5397649553094,-28.830959561123997,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"interaction":{"uuid":"8B68A2AB-CB42-4A68-AE4E-57F410F3AD14","selectedState":0,"states":["E884E1FB-F8AC-4609-88A1-2C3691B8B577","F6E92645-97C1-4C61-BDD0-6F1A023B0AFA"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"6DF8EF9D-4969-49CE-9867-D9DFD3BA5C7B","state":"F6E92645-97C1-4C61-BDD0-6F1A023B0AFA"}]}]},"geometry":"68ECBCF5-158E-4504-9BAF-937F6946514F","material":"315BB0BD-39A2-4B08-A0E0-15A56FE92E1A"},{"uuid":"2E392C70-83E7-4698-904A-F180E6CE0C6B","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-300.55442995952353,-46.750852213019925,76.91744823804856,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"interaction":{"uuid":"31134673-4CA5-4BBE-B617-C0567EED6A57","selectedState":0,"states":["F8DF091B-7F4E-4E22-AA76-164CA17904BF","78BAA5F5-DCF6-4433-B914-069B752D2512"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"2E392C70-83E7-4698-904A-F180E6CE0C6B","state":"78BAA5F5-DCF6-4433-B914-069B752D2512"}]}]},"geometry":"B10604B8-AE2F-467B-A3AE-03B1D2A699A3","material":"462BA6D4-6CE2-4BAF-8B18-0E5E04F19C73"},{"uuid":"FCE0A118-CD8B-412A-BE04-206D71B2D77E","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,322.9830495527491,88.12453841135351,59.80926803392561,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"interaction":{"uuid":"182BA99F-D8FA-418D-ACCD-00844B394AAF","selectedState":0,"states":["BDB622D7-D927-47AC-9E80-49747997AA65","79524652-4473-4CEF-BF5C-86A2B405CE97"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"FCE0A118-CD8B-412A-BE04-206D71B2D77E","state":"79524652-4473-4CEF-BF5C-86A2B405CE97"}]}]},"geometry":"AD29A3D6-6999-4035-B5D6-8DB8FD78CAF2","material":"7DBFE33D-C2CD-4DC7-92A5-B4332E9BFA63"},{"uuid":"EF8D6619-6CF1-4DAB-8DD0-D2B5B82B46C2","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,87.37781944740044,-159.5397649553094,-28.830959561123997,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"interaction":{"uuid":"1D267C79-C77E-45DF-84D7-39246886FDCF","selectedState":0,"states":["12BFC9EE-BBBE-4EC8-91CA-8A4E87E56B42","23D17C53-8A88-4F03-9C13-60DE36EF8546"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"EF8D6619-6CF1-4DAB-8DD0-D2B5B82B46C2","state":"23D17C53-8A88-4F03-9C13-60DE36EF8546"}]}]},"geometry":"9D02F665-0052-48CA-9BAE-0EE141881D0B","material":"1F44AC93-5B42-4442-AEA7-7B4682498FC5"},{"uuid":"C4BB147F-7B94-42D7-8DCC-4F8F5B5CE775","objectType":"Mesh3D","name":"Cube copy","matrix":[1,0,0,0,0,0.9396926207859082,-0.3420201433256688,0,0,0.3420201433256688,0.9396926207859082,0,-132.08367510706478,76.4022285497829,-6.49995961386103,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"480E10DE-E0FA-4EDB-A975-2890EDC3E9BD","selectedState":0,"states":["6D4BDFA3-7BB9-465C-835B-427EAA005D77","F60C7DE0-999F-41F9-9E73-72961BBBE7E1"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":20},"object":"C4BB147F-7B94-42D7-8DCC-4F8F5B5CE775","state":"F60C7DE0-999F-41F9-9E73-72961BBBE7E1"}]}]},"geometry":"13B73AF4-801E-43E3-A486-4265268FC915","material":"1FEDC227-AD0C-41F2-9C51-723BF1B0E6B0"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.9371749745620865,0,-0.3488596667064745,0,-0.0902142487257256,0.9659851534004793,-0.2423511352082036,0,0.3369932586586939,0.25859753171647265,0.9052971115654477,0,332.08033859735286,310.4692493894335,892.3968118149419,1],"layers":9,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000028,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":1,"nearOrtho":-50000,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090},{"uuid":"DF328879-9A33-4E6E-A330-E22695209A02","objectType":"CombinedCamera","name":"Camera","matrix":[0.9173445553172562,6.938893903907223e-18,-0.398094168294116,0,-0.11033006064925818,0.960827922978237,-0.2542380383468571,0,0.38249999287178454,0.27714563396403513,0.8814102637408744,0,-188.1249960155061,337.7956854717466,1008.5549416061782,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"raycastLock":true,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"9449B3EE-C571-4D0F-8C64-5F87EB3B6B7E"},"enableHelper":true,"cameraType":"OrthographicCamera","targetOffset":1000.0000000000045,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1014,"right":1014,"top":530.5,"bottom":-530.5,"zoomOrtho":0.6634204312890624,"nearOrtho":50,"far":50000,"aspect":1.9114043355325165,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50}],"activeCamera":"DF328879-9A33-4E6E-A330-E22695209A02","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2028,"height":1061},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"AADA6F5F-F0A7-4393-A05D-AA7C85C12C2E","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}},{"uuid":"B1A12F64-6790-4718-84AB-2DBE0DCCE1A1","userData":{"parameters":{"width":5,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":0,"cornerSegments":8,"hollow":0,"height":88,"depth":5,"radiusTop":2.5,"radiusBottom":2.5},"type":"CylinderGeometry"}},{"uuid":"2192791C-A7AC-42D3-96C3-3E240F1BD070","userData":{"parameters":{"width":5,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":0,"cornerSegments":8,"hollow":0,"height":88,"depth":5,"radiusTop":2.5,"radiusBottom":2.5},"type":"CylinderGeometry"}},{"uuid":"01C7447A-33BC-4B1C-926F-19EF39BB716F","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"EAB665F0-1E40-40ED-8A8B-1AF8C8A170F1","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"EF63957E-2C9F-47E5-8CD3-437DC979027D","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"2C906C9F-2923-4218-B693-A73CE3780456","userData":{"parameters":{"width":16,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":16,"depth":16},"type":"SphereGeometry"}},{"uuid":"53729C3F-2799-4F0B-A3A5-EBC6A189061D","userData":{"parameters":{"width":68,"subdivisions":40,"roundness":0,"extrudeDepth":10,"surfaceMaxCount":1357,"extrudeBevelSize":4,"extrudeBevelSegments":5,"height":68,"depth":10},"shape":{"points":[0,0,-6.899526655042213,8.449483233729296e-16,96.55999999999992,-1.1825189492566843e-14,0,172.03999999999996,-121.04000000000005,56.44000000000009,-121.04000000000005,178.75441860504114,-121.04000000000005,0,172.03999999999996,-129.7364782131769,179.1922816834845,-129.7364782131769,49.640000000000036,-129.7364782131769,0,0,-8.965789692969132,88.70057880514207,-8.965789692969132,-6.461663576598593,-8.965789692969132,0],"shapeHoles":[],"isClosed":true,"roundness":0},"type":"VectorGeometry"}},{"uuid":"BB1C0DE3-F3CE-48BC-BA42-676289AC1A9B","userData":{"parameters":{"width":225,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}},{"uuid":"68ECBCF5-158E-4504-9BAF-937F6946514F","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"B10604B8-AE2F-467B-A3AE-03B1D2A699A3","userData":{"parameters":{"width":40,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"AD29A3D6-6999-4035-B5D6-8DB8FD78CAF2","userData":{"parameters":{"width":130,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":38,"depth":20},"type":"CubeGeometry"}},{"uuid":"9D02F665-0052-48CA-9BAE-0EE141881D0B","userData":{"parameters":{"width":131,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":10,"cornerSegments":8,"height":40,"depth":20},"type":"CubeGeometry"}},{"uuid":"13B73AF4-801E-43E3-A486-4265268FC915","userData":{"parameters":{"width":50,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":179,"depth":32},"type":"CubeGeometry"}}],"materials":[{"uuid":"64C2FB1B-DA68-4F70-A7A1-19FF06C2A58C","type":"ShaderMaterial","emissiveIntensity":{"uuid":"B949AA33-06AF-4268-BDD1-EEA40DA41DCA","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"DAB0723D-0B43-41B6-8CD8-5BEDC6B33AB8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"056A5707-5C18-4EFB-8B80-21BAF997F2BD","f0_alpha":"F3C99DFD-92B4-4309-AF62-0AA32AAAECBF","f0_mode":"6BC801D8-7C69-40E3-A278-DF2A7656D7F2"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"80A2ADCA-FEE7-4A90-9CC3-ECD4C6F08927","f1_mode":"4CF12F55-AD38-4D24-883D-90D51D3F247F","f1_emissive":"8AEBEF51-143D-49EB-9B9B-EF3797BC2190"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"DC37E949-CEDA-46BE-92CF-A63E76E60CBB","f2_bias":"721A72BC-DF1B-45F7-B159-05D2BCB58CFB","f2_scale":"452BB48A-A284-4420-AA76-15DF1E70BAF0","f2_intensity":"44E9F08D-3648-4866-97EB-3500D8C6790A","f2_factor":"7133B3B2-CFBA-4CD0-9B0F-1EEC5B6BFE92","f2_alpha":"0924237A-08A9-416C-8154-BD562272BF2B","f2_mode":"303C6865-0F40-4646-9113-63AB5FACADDD"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"F847B8C7-81E6-4011-B234-93EFEB9CE38B","fragment":"F847B8C7-81E6-4011-B234-93EFEB9CE38B"},{"uuid":"BFFDB0E0-D1E1-47E4-9FE5-B68BCE226708","type":"ShaderMaterial","emissiveIntensity":{"uuid":"F6DAC7DE-03E3-4A9A-8CFC-566221054568","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"29EA5954-A0F1-4C81-9E8E-11BAD12BE0D2","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"F8D8FC2E-62DF-495E-A6BF-5F83303C2CC5","f0_alpha":"B8223A1A-7D04-49E0-B2FB-2A234E8F0F64","f0_mode":"3AB50808-37F3-455B-BE9D-B0CCB865E24B"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B9DF865B-625B-40CA-86E2-3FB25A967555","f1_mode":"339B0D8D-723D-4AAB-AE6E-5A5172833843","f1_emissive":"A1ECD73D-77AE-485B-90AE-460E0457A6D7"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"DAF98C34-5F40-49D3-81C0-82A67BB66848","f2_bias":"5DF6D0C1-C593-426A-AF8C-5D93E362D38B","f2_scale":"33DEF7A5-2512-4779-8EAD-877B0031DC82","f2_intensity":"2A1621EC-8790-422D-8FC3-F226A2897CDA","f2_factor":"84D8FFBE-A6F9-46B7-9CB6-E10757DCE89C","f2_alpha":"F29D7B62-3EC2-45E1-BD74-4FBC70941E65","f2_mode":"6C17066F-6E11-4BBD-A7DB-6F61DC6430B2"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"43FD3EAD-D32B-4F9C-ACE5-3987C703E1FF","fragment":"43FD3EAD-D32B-4F9C-ACE5-3987C703E1FF"},{"uuid":"AB027DBB-5329-4819-ADB0-BBB477A75916","type":"ShaderMaterial","emissiveIntensity":{"uuid":"8B5FF59F-E780-4B06-BA90-70E46462B0D0","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"29EA5954-A0F1-4C81-9E8E-11BAD12BE0D2","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"7C3C86A8-48A7-4AEB-90E4-274BABF10275","f0_alpha":"9C45D2F0-706B-493D-BAEA-B2F0EC612A3B","f0_mode":"A5BFED7C-40D0-4758-8392-89252284806C"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DE74393B-2E26-457F-AF21-59FCA32A7ED1","f1_mode":"19B905A0-FFDE-4C0E-A3D2-979CB98419CF","f1_emissive":"A42E4123-9081-4967-8846-5320CDC351A0"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"71DAFEB8-73C7-4CA1-AC7E-AE0FDA51BF43","f2_bias":"4788AC6F-2983-44B9-B3BE-B78C9E5D05FA","f2_scale":"88448032-B2C5-4A11-B00E-2D5BA264AC1B","f2_intensity":"6A173EF5-C2BE-408F-B907-34C74116BC68","f2_factor":"52A59606-3A39-48F3-8841-4A112E360DF5","f2_alpha":"EAC56711-D2FB-4A0D-9750-BC175216D033","f2_mode":"592B8CCF-3B45-4662-95A2-D9C691BB876D"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"598E54CA-5BB3-4ED0-9DF8-2C550ADF4F00","fragment":"598E54CA-5BB3-4ED0-9DF8-2C550ADF4F00"},{"uuid":"3C66C255-C31B-41A0-BD7E-85AB3D849C15","type":"ShaderMaterial","emissiveIntensity":{"uuid":"60C85E54-3B36-4050-91EE-CE4C17903E17","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"477700C0-CF81-476C-A694-F99F151A8FF8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"CD328A15-5093-4E2E-B70B-C6C711071861","f0_alpha":"2EA409B1-E8E9-4724-94B7-133F417F1EBA","f0_mode":"F52E8BA6-02D5-4AB7-A765-42E291758A9D"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","f1_mode":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","f1_emissive":"FE92C1E7-9238-476D-AB2F-C75F36284429"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"A72A1025-349D-4096-BBE7-D54DBC6D3405","f2_bias":"BDDC2E16-3C49-438D-AF75-AF0C45B52123","f2_scale":"FA2CE152-C264-4710-9CA0-BE0C735AF726","f2_intensity":"742C7D10-7C8B-4888-961D-0E5366715768","f2_factor":"49F28E1F-94DE-4F3D-A659-C9D12F8F3374","f2_alpha":"7CE25E9B-F229-4916-8B75-C108C39198FC","f2_mode":"8BC15C32-957B-4D04-B39F-4FEC06D1BA6B"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA","fragment":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA"},{"uuid":"36875B83-A9DA-4B5A-9475-F833BB18F734","type":"ShaderMaterial","emissiveIntensity":{"uuid":"1B077F2F-8AE8-4F10-AFF7-8FA75360769D","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"477700C0-CF81-476C-A694-F99F151A8FF8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"0263B709-EB91-469A-8DEE-B4F41F316AE1","f0_alpha":"007EFE15-EC3C-4A82-AFA1-21608C3A9CA4","f0_mode":"A4135212-B9CE-46FA-88C1-476CBE59C249"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"09413C17-B2BA-4D0D-BF1F-EEBA05818935","f1_mode":"E901797A-03E2-464D-89B7-ECD2AC1B3749","f1_emissive":"068666D9-E360-4607-B6F0-39A546AE3581"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"AA8A7071-5890-45DC-B7AD-8F36BD1FB335","f2_bias":"8FA0234B-43AD-4CDC-BFED-9D976F2A8F7C","f2_scale":"4D8E34CC-570D-4F1B-86EF-F754AF684D18","f2_intensity":"995A6D00-B8CA-4A44-A1B0-E775E4BA2F43","f2_factor":"8AC05B73-E3C1-40C2-A483-0463F2C10C58","f2_alpha":"A37F39E9-F907-4B4D-9A80-A289AD95A912","f2_mode":"3F6D8204-E19A-4C67-8E4F-DEA494F0A489"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"69D13EDB-EA89-4BA9-BCBA-A52C3BA5F118","fragment":"69D13EDB-EA89-4BA9-BCBA-A52C3BA5F118"},{"uuid":"826F268E-AED1-4D7C-BC56-9BECB819B94C","type":"ShaderMaterial","emissiveIntensity":{"uuid":"CFBC4336-4A09-42AF-BAD8-1EC44828E04F","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"477700C0-CF81-476C-A694-F99F151A8FF8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"A52B95FC-05CC-4213-97AA-388431358A0F","f0_alpha":"5171B922-75B3-4E97-882C-DA914A4E1823","f0_mode":"EE52DE1D-F952-4200-9E8A-161231C6330A"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D492109B-B70D-4A50-AA44-7DFEEB8F095B","f1_mode":"5D8C878B-A56A-4A83-AFC8-0770F5AEAE88","f1_emissive":"F0F7D8BF-024A-4D94-B35F-3BD2BA3DEB9B"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"34FC9353-1402-4FC2-B03C-26899D151284","f2_bias":"416CAD2D-354F-4D33-BF64-FA5E26E777FE","f2_scale":"85932E5A-B245-42F5-875E-72CC13B02930","f2_intensity":"3073C364-F100-4D2C-B89E-E134FD15C8E7","f2_factor":"0884AED7-24C4-4822-917C-FBBCEB234D6B","f2_alpha":"A86C1483-5929-4344-9703-4B0C367357D3","f2_mode":"C8AF333B-87A0-4DAC-9571-DC3D50E044B9"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"787CC4FB-BC25-479A-85C2-2723999E46F4","fragment":"787CC4FB-BC25-479A-85C2-2723999E46F4"},{"uuid":"5C7DB3F1-19DE-407B-B808-DD9672A11554","type":"ShaderMaterial","emissiveIntensity":{"uuid":"B63EE036-5917-4FFF-AE39-A2B76BBB26FE","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"477700C0-CF81-476C-A694-F99F151A8FF8","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"A55E77F3-0E7A-4BFB-8B9D-ECEEA3D41E47","f0_alpha":"D823B045-6DBB-44B5-95A8-46BB3BA59D90","f0_mode":"043CEBF1-A8A0-4DEF-A037-D78EBA9FAEBC"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"75B1A6F3-174F-4FF8-B9A1-CEB7E99CAA3B","f1_mode":"B94C5FD1-D069-4902-A336-E0C1BF5E13A3","f1_emissive":"F32614B1-C4B6-4A85-A788-BF27D5294848"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"A4517DBD-6518-46C6-8BF9-7BBDDEAAF414","f2_bias":"C60DCC4A-8430-481C-8EA7-CDD139571E51","f2_scale":"6F3F1F37-26C3-4AF5-8819-8C26A0717B03","f2_intensity":"7E76741A-011C-4C19-A41E-F951D98901A5","f2_factor":"95CCDABF-CE1C-497D-9222-21CBEB76ADC3","f2_alpha":"F49D4EF2-FD4A-4B4E-B704-ACC07DBA5AB1","f2_mode":"107B3BD8-8299-45C2-B623-2281C5A74EA1"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"B52F1FE5-8248-4809-A1BC-ECFD458669D7","fragment":"B52F1FE5-8248-4809-A1BC-ECFD458669D7"},{"uuid":"D8ADF0E3-9E44-4A65-8A62-978309534C63","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"7B5AD11D-DBE8-41D8-A3B8-E0B74C6DEEC9","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"04C17239-B792-4814-9F3C-C27DCF81878E","f1_mode":"F4ED4209-C836-4EE3-B214-DCF3FE649D6F","f1_shininess":"D2F9BDA3-210E-4EF7-815E-697421B18D13","f1_specular":"306C8F7F-25D5-47FF-9918-128C77034ECF"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"19D30ACE-63A8-4333-9694-AAF6DC4B622B","f2_ior":"ED75662B-086F-4884-B603-7074CF262A98","f2_roughness":"52B0C0C5-D3AE-4E34-AA9A-A6A40542A993","f2_transmissionSamplerSize":"7BEAB10A-21B2-4E88-AF7D-8F7A398CAAEF","f2_transmissionSamplerMap":"462C7BB6-CE2A-453E-90E6-54E004A005DC","f2_transmissionDepthMap":"375785C5-AB5E-4D75-9B03-BC1D27F6447C","f2_aspectRatio":"6A618525-F9EB-4CE7-BA85-807FD28D7E71","f2_alpha":"45EDE4AD-35E2-41C7-A256-033BCB94839A","f2_mode":"5F91E71E-958F-4FAC-B0E3-624A64692854"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"5AAD4394-2ABA-4C74-B695-C07BAD38E659","f4_far":"243E6630-4736-4F4A-95C0-5551A01C194B","f4_isVector":"D810C776-4974-4519-9447-448551A011B5","f4_isWorldSpace":"E2222B41-1633-4D7F-818E-AC1E5E7975CE","f4_origin":"761418EB-D62B-40CE-98A6-C2698E6EE4E0","f4_colorA":"F0157471-C8F2-43F5-89C6-C1C0CF5A2452","f4_colorB":"A1813342-DF1E-4B7F-841C-8E3FCC0C7826","f4_alpha":"80205659-44F6-4D5D-AB84-EF715A19CB81","f4_mode":"EA4B6E05-A972-43D1-B6B9-202F73E2B4C4"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"024AAAAB-DC61-4E3B-87EF-FC14F751C1D3","f3_bias":"8DE59201-C5A6-48B1-910E-9EB9B16796D1","f3_scale":"4C6B84CE-9C62-4D51-A237-8B0EC9D92EBB","f3_intensity":"6BF85A80-D6C2-4050-8D83-95778D849361","f3_factor":"7CCDB5A8-94D1-4703-8804-178F7AF97031","f3_alpha":"D6D9F155-9346-4D2D-9CA4-CA76FC98B125","f3_mode":"F1A368AA-A63B-4B5C-98FF-637A2500CB35"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"9E97C8C8-C3BA-469A-A00E-8462BA517025","fragment":"9E97C8C8-C3BA-469A-A00E-8462BA517025"},{"uuid":"CD397085-4258-4E07-A7DF-0A31F61762CD","type":"ShaderMaterial","emissiveIntensity":{"uuid":"42864264-F126-4CD7-B9FF-834EE957AC6D","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"3C7491CB-03E5-48A2-9BA3-5A8797B3BCE9","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"4186C1E0-660F-47D3-8211-6FD2515573A8","f0_alpha":"08B4917E-0CF7-4750-8AD8-684B0C84F71D","f0_mode":"124B14FB-1907-4813-BA31-0C1540C66926"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6B315BDA-FD68-478F-8D51-DCB2039B20BF","f1_mode":"8D47F6CA-494D-41D0-ABBA-990FE4C44DAD","f1_emissive":"F5D9BC69-2C74-4628-ABA0-4D347B62D221"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"B9846649-DB54-4305-B88A-6F50772742E9","f2_bias":"6B21860C-E58F-4F17-936C-9271BDF7A0B9","f2_scale":"BA9E5995-E01D-43DC-B871-C6F5AB5581FF","f2_intensity":"5FC29725-8AF0-429F-B022-B782F66BAAE6","f2_factor":"AB20AB31-415C-44F6-9D3B-13298538AC9D","f2_alpha":"46421097-79F2-4A36-A009-F251F97FAD9A","f2_mode":"2E4623DC-41B9-45E7-AE08-920C892FFC2F"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"2993B1AA-F164-46FF-8F49-A9BD1C615CCC","fragment":"2993B1AA-F164-46FF-8F49-A9BD1C615CCC"},{"uuid":"315BB0BD-39A2-4B08-A0E0-15A56FE92E1A","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E4C6306-4A39-430D-BE90-A814EE3D53EE","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8FF419D0-919F-47BC-AD2D-E7DB825DD2A6","f1_mode":"BA3E0720-747D-403C-B817-E2A07CFCF1A2","f1_shininess":"1D2257E3-A893-4900-A5EC-28B0DDB8AEDE","f1_specular":"9EC49521-8B76-44B9-97BF-53335430D4A0"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"3C478B0D-2505-403F-BB7C-C30F60541400","f2_ior":"4B197A7A-0441-449C-A855-52522736CEDA","f2_roughness":"CC5410EE-8268-4F75-9C84-1995A8E9F734","f2_transmissionSamplerSize":"59137B0D-2052-4029-BF50-BA5B7463D2C8","f2_transmissionSamplerMap":"64EE1DA1-72FF-44D0-BA05-CCCC54034FB6","f2_transmissionDepthMap":"B6339D48-FC16-4589-8059-8A61773A9AD4","f2_aspectRatio":"987BF313-8DB0-4E14-91D1-3BEE65BD7F48","f2_alpha":"CA117643-E96A-447E-B6E0-6B461B66A235","f2_mode":"772C5ACF-9751-43C9-AD95-0AB1EC8E410E"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"7CEB29DC-5280-4E59-A02C-13F5CBC75649","f4_far":"AC6F780C-28D1-44BE-A2EA-52E3FC8971A3","f4_isVector":"4FBA0C68-BE26-4594-82E6-A4DD6310777B","f4_isWorldSpace":"D123784E-9817-44F9-81B9-1717F7ED2415","f4_origin":"28807E16-4340-4521-8736-EE34525FC9BC","f4_colorA":"C55222EB-7FE6-4B17-8580-EBDF2BC418DE","f4_colorB":"883958C5-E601-49E8-A2EF-6E9C368F02EF","f4_alpha":"5064EF5B-58FA-4C98-86F7-78002033AF08","f4_mode":"E4AF0BFA-8467-4730-BD26-8BD5B9DC31B8"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"C8EB663B-5838-47BC-9379-B06E5CCBD07C","f3_bias":"8180CC52-A1A5-4CFF-AA54-21B845245864","f3_scale":"30044BB4-3315-4D1D-9290-F9803D31D303","f3_intensity":"03979E02-521F-40A8-8481-5448756C8BDB","f3_factor":"0B0D4E16-604B-477D-B483-BAD1FE256453","f3_alpha":"14D4B288-4586-42F8-A4CE-52625BA6C9B4","f3_mode":"DCF6F3B8-1FD2-4203-AE4C-EDECEFBE2A97"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F7CEFA4F-6D9D-4CE7-B1F3-6270892DED53","fragment":"F7CEFA4F-6D9D-4CE7-B1F3-6270892DED53"},{"uuid":"462BA6D4-6CE2-4BAF-8B18-0E5E04F19C73","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"9E4C6306-4A39-430D-BE90-A814EE3D53EE","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BCADDF4E-F5DF-4FBE-801C-A3B0275B409A","f1_mode":"B2EF10F3-3C3C-4B77-B216-8ADD22BE7DBB","f1_shininess":"941CBD1C-A884-4495-8DF4-28AE8162D57A","f1_specular":"871CD790-E60C-4599-9DAE-7F469A246A92"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"0CBD7B52-E358-4BB2-A5F7-D832EFF15E77","f2_ior":"1763A6C9-C736-40DA-9E79-AA9CA0461A16","f2_roughness":"A945615E-69D2-427D-9185-188AAD675220","f2_transmissionSamplerSize":"9A1CB169-64E4-4E5B-918B-1DBB5A9416CD","f2_transmissionSamplerMap":"BC484E28-ADD0-4BB2-B578-9E8049539997","f2_transmissionDepthMap":"130ED571-8120-4111-85DA-5C0221B0E003","f2_aspectRatio":"322AB661-614E-42FC-AE33-EC6A20466486","f2_alpha":"79088BD1-B519-498C-9D3E-CF53A31B9A0E","f2_mode":"88BB14CB-7B9A-46FC-86E8-DD54D620F0C3"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"89DA0915-0DA8-474F-BC99-EBC491E95643","f4_far":"27AD7514-3411-49CD-97E5-EF75AE4FFA6F","f4_isVector":"F44561E0-75CB-4C35-865B-5656AAEDF0B6","f4_isWorldSpace":"A0079897-D223-438B-815B-86DD5E561D79","f4_origin":"186217A8-0632-4BD2-BC07-2CC43DBA2C08","f4_colorA":"BCF2C492-5602-4BB1-A3F7-4191E2D64E51","f4_colorB":"E59BB232-50BB-4CCB-BDC8-F0A655C952C7","f4_alpha":"68B29B55-3A58-4C8F-9125-59326E12978A","f4_mode":"9C6459F6-7830-4740-8578-21F4961669FF"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"D7D40ADF-6524-400B-A2AC-F2A5C744A0CD","f3_bias":"3AB6DD75-895E-4FFD-9FE2-11C7A7AF05EE","f3_scale":"0E4DD8AE-F669-40BB-A098-D705F7656345","f3_intensity":"61ABEDF1-8CE7-4272-8E4F-6824ADDE7300","f3_factor":"6F2B147D-9A21-477E-B713-81BF106B1849","f3_alpha":"E5E2B385-EBAB-413A-B727-E82441CD00BF","f3_mode":"B4AA47C1-1197-48F6-8C2F-1ED15726460C"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"1C34E1B0-C748-4D7D-8004-B4ADE7E37724","fragment":"1C34E1B0-C748-4D7D-8004-B4ADE7E37724"},{"uuid":"7DBFE33D-C2CD-4DC7-92A5-B4332E9BFA63","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"36520AD2-9167-483F-8357-262F5411C8BA","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B72D38B9-BAD6-4C05-870C-A8985C2D0D33","f1_mode":"E1B3665B-64E5-4CDA-851F-4563F9585EC5","f1_shininess":"02D8FBFC-FA41-4A78-8D88-1B83816AE7BA","f1_specular":"7B09D587-4B64-4318-BA4C-96C2C783553E"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"136ED8F6-9E74-4C87-9898-A71DF8D605E6","f2_ior":"2936F7EE-15D4-4C02-A12F-F37D0A5B45FA","f2_roughness":"2A4B8D12-7ABE-4FD5-80B8-ABA78C5A5334","f2_transmissionSamplerSize":"FAA469EE-C259-493B-9D94-239A3F518B3E","f2_transmissionSamplerMap":"9E0C2BEB-C953-4431-B694-9281BBCA80EE","f2_transmissionDepthMap":"0C093174-D777-4492-A31D-0037D76D1A4E","f2_aspectRatio":"DC324FE5-969A-4FDE-B00C-7D23B7CD8826","f2_alpha":"BC9B7EDB-1277-4F74-B180-CDB69B49870F","f2_mode":"58795806-1728-4812-A084-0F64820DCAB7"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"5CCC532F-EFF6-44EF-A971-8D754ABA3EBF","f4_far":"F0378C32-0B3F-4108-BCF8-AF04D32714E5","f4_isVector":"6772AFD5-AAEC-4265-BCC6-228E51BD9E43","f4_isWorldSpace":"2E9005DA-36DD-4B02-BD3A-49C61295794D","f4_origin":"57FA09A7-16B3-4C61-9114-328FACAF4E38","f4_colorA":"7F932620-1834-4ECF-B7EE-B7D33F0DEF83","f4_colorB":"A01F2480-86CB-41C0-AC96-355698A1F95A","f4_alpha":"A361C0DE-C12C-4CE5-92C5-0DD2C3580B55","f4_mode":"FB2A69F9-9392-42E6-BDD6-EE210A279B42"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"E23929D5-7F8E-43FE-A8E1-0D9FD18C5509","f3_bias":"9A62F3DB-7D37-4D6D-A7EA-50A27DD11B71","f3_scale":"C8DC14B7-1F77-4549-8088-1DBE9329503E","f3_intensity":"10DB2C08-D38A-455F-829A-B056C8DBF6ED","f3_factor":"4E7C1A9C-C8AA-4E15-804E-22E9C06DE51C","f3_alpha":"2966F6E0-A987-4928-971D-C463610E317A","f3_mode":"10CE9357-BCE1-464F-8F3B-7FD007C5161C"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F7C80620-4B1B-4BFE-A579-3B2D43542FF1","fragment":"F7C80620-4B1B-4BFE-A579-3B2D43542FF1"},{"uuid":"1F44AC93-5B42-4442-AEA7-7B4682498FC5","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"36520AD2-9167-483F-8357-262F5411C8BA","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3D7F6815-4FFC-4218-A476-8B3F4B04A202","f1_mode":"DE2C4C52-5FA5-42E0-AB9F-364714C606AD","f1_shininess":"5B673DE8-7261-4B7F-A8B9-6A6362C1C7AD","f1_specular":"CBF9062B-8E65-4441-AE98-EA1DE8BBC7A8"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"46795E16-3183-4F26-AF91-57E852079967","f2_ior":"95B73345-A423-4CF0-9AC4-E9F84381B9AA","f2_roughness":"A8830086-E26D-4BDD-9A86-92563BCA6096","f2_transmissionSamplerSize":"CF0BE228-4434-449C-851A-25967914C536","f2_transmissionSamplerMap":"71ACCB99-FD7D-4E51-9CFE-6EC63BCC418A","f2_transmissionDepthMap":"A8523778-EBF0-46D6-9C86-73E062C8E007","f2_aspectRatio":"8188EE4D-0645-4462-BC00-6971C9A67A76","f2_alpha":"EB7938F1-8C4B-4641-8DF7-15578010B956","f2_mode":"A577BBA5-0ED0-4396-BED7-CFECFD413384"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4BA9A9B8-DA8C-44B6-9B49-D5C026AB45E5","f4_far":"DCE90ECB-27FF-4BBD-BF82-7A09F3DC3CCD","f4_isVector":"B634289F-3EEE-444D-8AE2-CAB73F3472E5","f4_isWorldSpace":"B4491288-8877-42A9-A591-05B37B660927","f4_origin":"B737DF4F-0229-45E9-8A54-8F83893E422E","f4_colorA":"7E1F9D12-83AE-427E-A950-BE181F969269","f4_colorB":"513EF059-9236-4079-A973-C2D5D3B96A45","f4_alpha":"84D9AB77-BA64-4FF2-92B6-C3CCF14366C7","f4_mode":"9D5F85C4-A1BC-4152-B6D7-4D0DCC30D539"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6D1EBD4D-98B4-48EF-9F62-B292FB014B80","f3_bias":"270B3C81-CFD2-4269-8678-EACB8AC78467","f3_scale":"05E082AE-79E3-4374-ACF7-2E6C51BDE0B0","f3_intensity":"2192F4CD-36A2-4B66-8424-3EE9CC3F3569","f3_factor":"9E169CCF-EB06-41D0-B770-BF24A95E58A1","f3_alpha":"D05BA06D-D0CA-4CA4-AF9F-1D518ED2E2B2","f3_mode":"686A55D7-998E-4728-80BA-7ADF0A3F9572"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"FC9F690C-DA3B-42DA-90F2-FC9E28C7ACD0","fragment":"FC9F690C-DA3B-42DA-90F2-FC9E28C7ACD0"},{"uuid":"1FEDC227-AD0C-41F2-9C51-723BF1B0E6B0","type":"ShaderMaterial","emissiveIntensity":{"uuid":"6B01DE6E-843B-43D0-8D7F-FC59CBD73B6C","type":"f","value":1,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"LambertMaterial","category":"Lambert","nodeType":"LambertNodeMaterial","layers":{"id":3,"uuid":"379B693C-DC07-4510-A96D-31D83A0E02D5","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"EBDFB563-B0C4-4D3E-976F-A4B12691AE1C","f0_alpha":"AB0233FB-D949-440B-A162-38E1261DB179","f0_mode":"B8F83C19-BB00-4669-A63D-A3E320C5B61A"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"CF52EB2B-8678-4C54-8696-AB1C2BB9D4DE","f1_mode":"12510A4B-CD74-4BF2-93D8-F5930E5E5966","f1_emissive":"1E25A972-E32D-47ED-BB05-CB425707E304"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"2EC5BDD1-FD34-4DAB-B62C-5921B388A3D0","f2_bias":"C72AF895-255B-49D6-B658-5B785DB3CF00","f2_scale":"6896084C-9B66-4101-B3CD-99B4109A30BD","f2_intensity":"23766118-FA79-4958-9844-3A6CCC331BD2","f2_factor":"3E1D3E21-0FAF-4D74-9855-9499EAB42798","f2_alpha":"D741EEED-0164-4D74-A0D9-6469483AC439","f2_mode":"FD483E2E-E5EA-4764-A1F3-C0DBB9A53162"}}}}}},"glslVersion":null,"defines":{"LAMBERT":1},"extensions":{"derivatives":true},"vertex":"50E2DE8D-473B-4D60-8826-05E93E074A16","fragment":"50E2DE8D-473B-4D60-8826-05E93E074A16"}],"textures":[{"uuid":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"830810C7-8DEB-4820-A49C-60F5E7F691A1"},{"uuid":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2"}],"images":[{"uuid":"830810C7-8DEB-4820-A49C-60F5E7F691A1","url":{}},{"uuid":"57FE3F7F-99B0-4093-AE6C-FBBB346921B2","url":{}}],"interactionStates":[{"uuid":"76F3D3D8-C0FE-43DB-97E3-24EF46F53E97","name":"Base State","position":[137.90758729968002,76.4702603787693,-6.5271211759586265],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"19C4FD74-208C-48F3-97C9-6E6C61C4E7AF","f0_alpha":"AD4A294D-FFD8-45C0-B1B4-A594CC8FDBB2","f0_mode":"B64BA5FD-8ADF-4B8A-BD25-07E8DFE7388D"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"635D63D7-CF15-41B2-B173-22BCE0FDA9FE","f1_mode":"C90F52A6-EF7C-472F-A8B1-3C5DA35F90A3","f1_emissive":"09EAC6FB-623B-46E9-A39E-86231FF1075A"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"E2BF0488-6615-4561-A1B7-A278F7137CE5","f2_bias":"0BBF3B18-2558-4DEE-9DE5-A7788AABE253","f2_scale":"C362E34A-79BB-46A4-AECE-26D9ABA89F28","f2_intensity":"052C9EF2-4559-4A78-A3A4-B4BB06C13C40","f2_factor":"65E53D49-74C0-4933-A374-59C8BFEBF947","f2_alpha":"4F6D5A28-43A1-43CD-819E-16C5CCC373EE","f2_mode":"FFE86BAB-3DB6-4F5A-A5A8-9FA3C5F8849A"}}]}},{"uuid":"6434020B-1738-409D-940A-40BC5E7AFC0E","name":"State 1","position":[137.90758729968002,84.82107603357503,-9.56656950615214],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"1BE647BF-0942-43B4-94BB-D8E173C6E76C","f0_alpha":"41BD9FD8-668D-4D02-9213-95535ABB62FC","f0_mode":"28C82BBB-A42D-4495-99CA-5D22ABDEB1E1"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"644A43F1-0E0B-4797-8A30-CF038FBA60DC","f1_mode":"D5154E35-90D5-4321-BCC0-B80ACA947F4E","f1_emissive":"5FFBEFF4-53E3-4C13-81DC-E8C6FCDA1CAB"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"55880A47-19AE-40E1-8D40-7AE1AC739CD6","f2_bias":"36B773AC-4F7C-415D-BE31-5F2EC9429417","f2_scale":"DD363F57-5E08-4B6F-9420-3B32B58DF487","f2_intensity":"C736C0D1-A408-4E04-9264-0EFC530CACD1","f2_factor":"4E2AB60A-54E2-4FF1-B198-16C20B407F36","f2_alpha":"6F5482C3-4A5B-4850-AA2A-0A0C3986F975","f2_mode":"9F3AF229-13E4-4D55-AAEC-BD693295D4A5"}}]}},{"uuid":"87316550-1E80-4D93-812A-E30C4F2C1BB8","name":"Base State","position":[2.954213988821323,78.13947375637262,-1.8278986208817116],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"67F4F780-4587-499B-9C8C-1855F5291534","name":"State 1","position":[2.954213988821323,78.13947375637262,-1.8278986208817116],"rotation":[-0.3490658503988661,-0.15099092713231432,-3.509374828248845e-18,"XYZ"],"scale":[0.9999999999999989,0.9999999999999999,0.9999999999999998],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"E884E1FB-F8AC-4609-88A1-2C3691B8B577","name":"Base State","position":[190.26681927331737,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3CE6DE5F-3D80-4C36-9236-9F201256081F","f1_mode":"7069EC87-DF0F-4B77-B5AF-692AFA487F20","f1_shininess":"1EAF6C85-C438-44C7-811E-4E2290C030AD","f1_specular":"DECCE9E0-FE74-4A32-8189-1C328F6E4A48"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8146943A-C48A-4A10-95D0-D540B61D828B","f2_ior":"9937B907-B147-41BF-8397-62FE90E40709","f2_roughness":"5CA5CE59-106B-40D8-8CC3-CF6741009B9E","f2_transmissionSamplerSize":"EF65890E-7E85-4C2F-ADC4-7C57C4D6481A","f2_aspectRatio":"E09C143D-6028-4217-ADD6-817CD4FB5581","f2_alpha":"92C7A834-92F7-4E7C-B894-7534E9FACC3C","f2_mode":"C998946D-AAF3-4B84-918B-0B0114DA478F"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"2D69A618-0BD9-4812-8F27-028D5924AEB3","f4_far":"1BD40E33-F370-4AFA-A302-91DB389A6F3D","f4_isVector":"74399F5C-1676-416A-BC4C-C748E595C7D1","f4_isWorldSpace":"052A2D9A-3FF2-496B-92E0-3BB8692CC5E6","f4_origin":"A57E050C-2E69-487D-8927-91D4EE4D475E","f4_colorA":"4E2FF72D-D375-4699-BD45-502BC1ECA3D3","f4_colorB":"B0C488A0-FC2E-4C0D-8972-F3A8101FE12D","f4_alpha":"E135CF75-EF15-4AA0-8237-B8342619ED07","f4_mode":"FA0BEFCE-3681-4E52-A63B-F80F7C6F22E3"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6BE827D9-6A9E-470F-B92C-01EBFF52B59B","f3_bias":"61B1E3C1-BC66-47B8-9F8A-0E47F0068587","f3_scale":"07BF7643-C1ED-4224-AF4C-CF1009128A31","f3_intensity":"191AF32D-7391-46A6-AB36-C79D55122F11","f3_factor":"6B5215B9-B265-4471-B8E7-3A34B0C50E9D","f3_alpha":"4C82BE8F-AF6E-404A-8D0F-1242AD380C5E","f3_mode":"648C612E-CAE8-4E15-94B2-FD51567D4CEF"}}]}},{"uuid":"F6E92645-97C1-4C61-BDD0-6F1A023B0AFA","name":"State 1","position":[190.26681927331737,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D9FDCD0C-2E1D-4261-879D-BC89E926219C","f1_mode":"A5BE3147-6A6A-41EE-9476-13C3321CC634","f1_shininess":"1DF2E4F8-C623-492F-8995-5C33F62E4D67","f1_specular":"5046B07C-967D-4BD0-B4A4-FF9611F2144E"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"E3A50229-59BB-4ECA-BFF1-FA1CFF81CED6","f2_ior":"B24F7B13-17E7-4349-865D-78D970B853A8","f2_roughness":"4A0A8B54-7720-45C0-8BB6-77D2BC7561CC","f2_transmissionSamplerSize":"581C4732-A2B1-402F-9A82-B97076104564","f2_aspectRatio":"54E555BE-A314-4E8B-8D98-1A53780E99E4","f2_alpha":"67A29183-B491-41AB-B1C6-F0486C117E55","f2_mode":"D95380F0-53FA-458C-99B2-6830DBF3C451"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"904F7CA9-C75D-441B-AFBA-57AA8EFB1A76","f4_far":"24E496CE-A867-446C-815A-8B82A6F2B6BD","f4_isVector":"49CCDA1B-BE80-42F9-92CA-D2ABE9E3CBA6","f4_isWorldSpace":"D2D397E4-DD5C-4D2C-94B3-9D6243CD77EC","f4_origin":"85CAD9CD-C551-40C2-8A90-026A6F1C9E90","f4_colorA":"5B832657-9BEF-480A-BEA7-E5C29F9A9898","f4_colorB":"0E71ABDD-9870-4509-AE6B-EF63021A576B","f4_alpha":"9A68F445-A7F7-43FA-A056-9B8F81E6D535","f4_mode":"BA88DAE7-B48F-4C08-91FF-5B476AF2687A"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"6E08010A-4591-40D3-B586-5BC2AABA7E44","f3_bias":"EFD9217E-E09C-4C4A-8113-E795286ECECB","f3_scale":"E4CE4B2C-7579-415C-BEAE-696F7099988B","f3_intensity":"4AE5B941-BD1C-4095-9514-E09FB0D06752","f3_factor":"0DBE8ECA-438A-46B9-88C1-28D74F4ADF49","f3_alpha":"614CF1AF-BB6F-406F-B6EC-1ECE55305F8A","f3_mode":"6A83DBF1-2150-4B6B-B757-A52619F328C1"}}]}},{"uuid":"F8DF091B-7F4E-4E22-AA76-164CA17904BF","name":"Base State","position":[-300.55442995952353,-46.750852213019925,76.91744823804856],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"geometry":{"width":40,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"AD4F8525-94CC-4DD0-9B74-F09BBB856C96","f1_mode":"08112E89-EE6B-4FE8-B530-6C7B80D1AF53","f1_shininess":"78C68B14-6027-45F7-A33A-15F1B24A265F","f1_specular":"89B60EEB-B5B0-4DEF-BDF2-891A6A33F340"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"A5E9A888-1AAC-4B7E-B856-115861E4E916","f2_ior":"E68375BD-6A00-439E-AF56-9834E3BA41DB","f2_roughness":"0E143BE8-DC79-47DD-B755-4E8E7AFAE06E","f2_transmissionSamplerSize":"0D8D4166-6DE0-4B3E-96A6-45332B8CF218","f2_aspectRatio":"328D74B2-2B66-46BF-8ECE-774A5C358E5B","f2_alpha":"BB7F1FCC-5602-46BC-9CBB-68BE7B64AE3F","f2_mode":"8D73D246-84C3-42BB-BBA1-4000BC9B0365"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"030F58E7-F65C-4EF9-AA7C-850B1865347E","f4_far":"69CE0B41-C963-43DB-A24A-46CB801307D0","f4_isVector":"9F8305CB-EA2C-4A6E-943B-D96FB5B4EC5B","f4_isWorldSpace":"B76D16E8-0E24-44B4-A5D7-578FF2044A42","f4_origin":"0BDD0E4B-5597-40A2-8D33-CE2FC42EB0EF","f4_colorA":"74AAE0FA-6D89-4FA3-A0CF-BEC9DCF45D04","f4_colorB":"FAA78A30-9070-437C-AFC4-955BA0DFF7F7","f4_alpha":"23DBC43D-C0F1-402A-A16F-6E861EB270A3","f4_mode":"AE8BCAF2-F0AA-4C29-9991-FB17746F6384"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"A50CD8C0-32DA-4140-85E6-BC9EDB7E34B0","f3_bias":"E15BECDF-5119-44C6-8051-C2F9D7443553","f3_scale":"77B9F116-7DD3-4AFA-B230-BCF521BAD51F","f3_intensity":"C8B2FA8E-1852-409D-B3F6-6C0AC1133E76","f3_factor":"81CB54BD-17FE-45C7-A70A-DA69F3BF5057","f3_alpha":"45C25D1C-C419-49A9-AA9B-B2000652A2AA","f3_mode":"D6DB6241-8AAC-44AE-9C31-D661CD8681A8"}}]}},{"uuid":"78BAA5F5-DCF6-4433-B914-069B752D2512","name":"State 1","position":[-300.55442995952353,-46.750852213019925,76.91744823804856],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,119.59863327996652,222.86582165451762,-31.04075854527187,1],"geometry":{"width":40,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0DEE2B8E-5BEF-4031-8613-DC3C3C6A0B13","f1_mode":"946B0BE5-7726-45CA-BAF7-8DB2B1AE7920","f1_shininess":"EB354B67-694E-4A72-9F66-9E1A30BD50F0","f1_specular":"A352C1B8-AE00-411F-8677-5404B44313C1"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5869E869-EA57-435D-A2FE-45051A7152D5","f2_ior":"92D67B99-96D0-4907-881C-EEFA55510557","f2_roughness":"48989389-8D68-4499-A544-ED625EFCF1D4","f2_transmissionSamplerSize":"FDED0F49-0912-4C98-A79E-328266EEED29","f2_aspectRatio":"E377355A-A4B6-49DE-BAFE-DBE4D594D850","f2_alpha":"091EFFB0-400E-45C0-B298-B9098F54C581","f2_mode":"F66B2F73-EAED-4407-873D-B7B080756777"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"8DC53301-676A-4C42-905E-3F0BF8DAF835","f4_far":"F0DB15C6-1E3A-42FC-9947-1CB79CC81905","f4_isVector":"00652C32-961B-48FC-9330-D2C400D84D38","f4_isWorldSpace":"613E84CD-BCF1-472B-B7B0-40BAF80E45ED","f4_origin":"7B0130E9-76BF-41BF-87D7-E4B2CDC0C56B","f4_colorA":"264CACCA-AB57-4D74-8E72-AC9996744EA6","f4_colorB":"CF460658-74A7-4844-9D63-6AF3C67AFBD4","f4_alpha":"3EB550B8-C9D5-4288-A702-3B643882E9F0","f4_mode":"7FD2E8D4-D580-424F-9ABB-B5562284D208"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F5F585A4-D73A-46C0-969B-35CF3CE9DB91","f3_bias":"73C7CDE4-AA47-40A0-9ED7-8FEB17FB22C7","f3_scale":"BE96FC73-8972-4AF1-AA82-96B7301DE6DE","f3_intensity":"AEB4213E-21C2-47F1-99F9-25636E3E65A5","f3_factor":"74A880FC-52FC-4973-AA7A-50C7A2E4AAE5","f3_alpha":"0286A423-CA0B-4423-BFBB-29C092A18F2A","f3_mode":"E79F6519-4BA5-4096-A857-F81BAF72AAD5"}}]}},{"uuid":"BDB622D7-D927-47AC-9E80-49747997AA65","name":"Base State","position":[322.9830495527491,88.12453841135351,59.80926803392561],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"geometry":{"width":130,"height":38,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"589ED33D-990F-4994-969D-CF6292E5633F","f1_mode":"32C970C4-E8B8-4D8D-ABBF-2060B67F7B36","f1_shininess":"2C3E7640-3585-48ED-8774-01C9AC9DA8F2","f1_specular":"70E3D083-EEE3-4186-BADF-6CD8A623CC8D"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"4D445173-5EFC-4BD1-BD28-2FBDB5BF70B7","f2_ior":"36FB2791-503F-468E-9CA2-A511C61BE77C","f2_roughness":"F595AD97-32B6-45F2-8129-34E485320C54","f2_transmissionSamplerSize":"FE3894CF-467C-40B8-AFE3-EDCFC7C7F793","f2_aspectRatio":"3169F3C4-50FA-437F-ABC4-E2CDE9FDA147","f2_alpha":"48DE25AE-11C6-44E0-8B58-496BF72F2C70","f2_mode":"6EA8282C-B23E-4205-A5D4-0E5AFD29CBA1"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"232BD769-1DB7-4147-A195-FCFF339E0BA1","f4_far":"B199C487-B26B-48FF-BC9F-2EE6FCC4F067","f4_isVector":"B3A36A58-C68D-40DC-86A7-7D47219CF38B","f4_isWorldSpace":"C06E24AC-186C-462B-B0BC-8F9F70814E0C","f4_origin":"1BFA1A9E-4F71-4135-8A1C-CBAE1674EE90","f4_colorA":"30E588A6-609F-4586-B80D-ACBC0C6ADC3C","f4_colorB":"81A88FC0-B7E2-44F5-8560-5F3B96ED5A05","f4_alpha":"BB1AB063-0C97-40E0-A414-3CF199D4A05D","f4_mode":"9582F4E7-2A97-402F-8EDC-10AFC254D3E1"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"B1220916-879D-4333-96F7-01EE2A816048","f3_bias":"84CD2964-4AAA-4009-A808-2719064D5D93","f3_scale":"98EAD8C6-D086-4D3D-893F-A51FF96CE65E","f3_intensity":"4FB532E9-A988-46E2-B4E5-10910745E5F7","f3_factor":"28E901F2-1683-448E-9390-2E762F5213E0","f3_alpha":"CC5ADAF0-498C-4A35-927A-F0CCA3BA13AB","f3_mode":"502143CF-0E54-4163-B9E1-5C7019C0071F"}}]}},{"uuid":"79524652-4473-4CEF-BF5C-86A2B405CE97","name":"State 1","position":[322.9830495527491,88.12453841135351,59.80926803392561],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-99.46428771460864,150.0439069662446,22.05930297650795,1],"geometry":{"width":130,"height":38,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"B02EEF6D-C451-4E18-A401-BFE72DC8FCE8","f1_mode":"6350943E-1D1D-4558-A0B5-7AD629D1481A","f1_shininess":"E638F4BF-5CF7-400B-AB51-F3011ECE5005","f1_specular":"6AE4D631-1936-4B38-B8EF-5FF505648ACF"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"59D13C96-ABF7-428F-9CDD-D1B731AB7FA1","f2_ior":"9D661658-21DD-4B58-B8E7-762CEBA9D882","f2_roughness":"B2065FF7-8AEB-4EB0-BE87-07D80D642A6E","f2_transmissionSamplerSize":"58CE9C9A-34C9-466E-8719-B117BFE5B6A6","f2_aspectRatio":"80A19171-77FB-4A6C-A3CC-A74C26282533","f2_alpha":"4A7B4ADA-50FC-4AC1-A612-CF28079217ED","f2_mode":"9F6EE095-3F34-4367-9688-DED916A9D935"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4050E6CC-163C-4DF2-91BB-1DD7221BDDB4","f4_far":"8B3B90A5-89C3-43D5-BCB1-A7EECC825D5D","f4_isVector":"68407587-27E4-47C9-98D5-2DC20E6F6C8C","f4_isWorldSpace":"4518FA6C-265C-42F3-A8FE-35EBAD8C754F","f4_origin":"DEDBC94B-FFB8-477B-8D82-B7176A1D75D9","f4_colorA":"D9EF7422-41DA-44DA-BCB3-DE463FC8F9BC","f4_colorB":"8AEABEBF-5DEC-422D-A545-E300A3A4557F","f4_alpha":"FFA9967F-2102-4A10-B091-8397C6A058E4","f4_mode":"D41AC119-0273-4B7C-A101-1C946382A3DA"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"27F1F8DA-A6A9-4FD3-9926-8A05E7AFB525","f3_bias":"5867B28C-609F-4AF4-AA93-F6C1C7D9DDD1","f3_scale":"392CC30C-3580-4BC6-A9DC-259E52287471","f3_intensity":"B698ECB4-2F83-4B5D-AB5D-B45CD2020968","f3_factor":"B434C26E-E858-4E72-B928-9620389A484E","f3_alpha":"B9504132-CAEA-4119-BFE5-002BA0242662","f3_mode":"C7D0F32A-7E2C-4D77-AAE7-1FA8CAD019BA"}}]}},{"uuid":"12BFC9EE-BBBE-4EC8-91CA-8A4E87E56B42","name":"Base State","position":[87.37781944740044,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":131,"height":40,"depth":20},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"40D126AC-5E42-46C1-967D-9F861B35E9C9","f1_mode":"45288A6D-F2B8-4ADD-9583-DB1A28DABFD3","f1_shininess":"EC711B3F-AF1B-4C34-9FC6-7A24C3C3DCF2","f1_specular":"123417DF-794A-4511-9814-B8E2B13EC8AA"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"2623ACDB-BA6B-473C-942E-6BA062B454AD","f2_ior":"DA19B5E0-E2CE-4D3C-9ED6-19D3FCE31411","f2_roughness":"3FD3B75D-E686-403F-B592-9818D357E2CE","f2_transmissionSamplerSize":"B108958E-3276-4959-991C-BF9B1A03784F","f2_aspectRatio":"70487EEC-2D12-4DB5-99CD-61957872AE1C","f2_alpha":"9CF34647-73C7-4DE1-B5DB-737C407C04BD","f2_mode":"7F825B81-9CC8-4772-928E-12BA176E48C4"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"CDC69D18-7485-4E66-9484-FD14C58C0810","f4_far":"37CCFE18-76CF-49B3-AFC8-83D3CC2AA006","f4_isVector":"93E5AD1C-48D9-41BE-879A-E2A1B1847F46","f4_isWorldSpace":"DEB8FB88-FF72-40B1-B554-4B43929D773B","f4_origin":"811B6EB9-82A4-42C3-9C4C-E154ABBF8A42","f4_colorA":"48C9DEB2-8443-4032-AED1-CF57A77E3C36","f4_colorB":"36AA677A-BB84-4211-A3DA-8D392C4FCCBE","f4_alpha":"84DACFC5-FFDC-4904-A3DF-98503D036BCB","f4_mode":"2217950A-6582-40F2-935B-B21155E35948"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"4589D8FA-41B6-46F6-A678-B0AA811F8B9C","f3_bias":"50765C1E-023C-4E83-8065-5B7D73CCD9C7","f3_scale":"32B609A3-8996-4420-9AEA-9ACE9150C8A7","f3_intensity":"8576A92B-4D26-4BAA-B7D0-F19A2DCCE926","f3_factor":"545E7896-FD3A-4DCF-B2D9-02E02D906439","f3_alpha":"743A80E3-32FF-4843-A267-7851DAE6BA7F","f3_mode":"FFDE1251-3C12-4B30-ACE7-3ED7E4DFAF15"}}]}},{"uuid":"23D17C53-8A88-4F03-9C13-60DE36EF8546","name":"State 1","position":[87.37781944740044,-159.5397649553094,-28.830959561123997],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,-267.58055746789995,133.61374313162491,-4.134692519274751,1],"geometry":{"width":131,"height":40,"depth":30},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"20A7F308-3DDD-46D1-8C98-41DF14802304","f1_mode":"2123BD4B-018E-444F-AA7D-019135AC0AC5","f1_shininess":"A506A106-E4F7-4A31-A981-75A2125CBE9A","f1_specular":"DB1CCD56-7E03-4C73-A7E2-3876D3E2E86C"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"F43EBB60-1DCA-4902-A223-BDD325A7DC43","f2_ior":"5341B439-B76B-43A6-B73B-F66344FBF767","f2_roughness":"AB0340D2-6C2B-4803-A1C8-B2C072EEE4FA","f2_transmissionSamplerSize":"261399A9-7CC2-426D-A2D4-E0B59E239217","f2_aspectRatio":"A78C37F6-6E96-4619-B858-F37424A27E7F","f2_alpha":"A928765F-ADB5-4BF7-9A82-D4857590E749","f2_mode":"019A26CD-62E2-4CB5-83C0-497A18AF9843"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D0310BD1-0F34-439A-BAA9-C2B6538B7386","f4_far":"2AF726A5-7A81-4B9E-94D0-317177C297D3","f4_isVector":"0EC62FA5-96E6-4B3D-8A35-631DA096C770","f4_isWorldSpace":"5A32CD40-2C53-47A6-B7A8-14FA550B88F7","f4_origin":"CDA783EA-6643-41AE-83E9-38C6600A3358","f4_colorA":"7C6B4220-6988-4F4C-8968-0868755FB69F","f4_colorB":"867666B4-9EE8-4A64-9D54-88FFCE9E1CFC","f4_alpha":"408C1A23-2E05-4D48-ADD4-E51DA0570885","f4_mode":"84C7615A-D582-4FB4-A829-663AEBD258F8"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3A3CA2DF-1E65-49A8-B98A-540BB081A87B","f3_bias":"FEFE870F-7E1E-4D4B-ABCA-615102E6431B","f3_scale":"DF4D77BA-C3BC-42C3-80B6-6A199B840D94","f3_intensity":"0E6E3C8A-077B-489D-90A2-AC7FB3A22EB8","f3_factor":"50A3C46F-73E5-4836-8635-6C85FC20CECD","f3_alpha":"11A0B441-C9DA-41E9-A0B4-4AF85FC8B23E","f3_mode":"5A51776B-93C6-481F-B2AB-4EED9D05443C"}}]}},{"uuid":"6D4BDFA3-7BB9-465C-835B-427EAA005D77","name":"Base State","position":[-132.08367510706478,76.4022285497829,-6.49995961386103],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"EFD43271-BEA9-4BD9-8AEA-578D0C0D5DD2","f0_alpha":"BF14F38C-23A9-4B75-9C73-E9778C17A2C4","f0_mode":"4E80FB94-D6CC-4C3B-875B-606C49F72DF2"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"95234B55-57F6-488B-91AE-00D7AC102C0A","f1_mode":"BCAA5083-1D54-4A86-9565-F78F6A970ABC","f1_emissive":"142984B9-3A3C-4718-A746-83923DC64595"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"3766481C-BB16-4FD7-876D-CB48088BE91B","f2_bias":"97DFCF98-3A4B-451E-A945-0C32B04CB474","f2_scale":"2F83A0DE-B118-40F3-B370-C3231938101C","f2_intensity":"7DA90381-06A7-431E-A44A-E7ED134229FA","f2_factor":"BAFDB3CA-6985-4385-8EED-588811ED1A85","f2_alpha":"A46DC0DF-51F3-44F3-8653-F0CF6A1CA509","f2_mode":"DDD7CB28-AE3A-4B76-A13C-C84FD95DC6D4"}}]}},{"uuid":"F60C7DE0-999F-41F9-9E73-72961BBBE7E1","name":"State 1","position":[-132.08367510706478,85.42843404027218,-9.7852297407693],"rotation":[-0.3490658503988661,0,0,"XYZ"],"scale":[1,0.9999999999999999,0.9999999999999999],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":50,"height":179,"depth":32},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"09346473-4835-4A36-BC31-00DBA93AA0B8","f0_alpha":"2180CE89-3D88-44CA-B1BF-BCDA20910080","f0_mode":"93323213-3038-418B-B2B0-3DA19046AD62"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"171EB1CF-1B32-40A0-840C-4B6DB362AB97","f1_mode":"24AB8168-30C6-45E7-9FB5-EB00CBBBA802","f1_emissive":"2FC1579A-B9D3-4144-A4CA-91ACF603CA13"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"DBA1F452-B066-4D19-93BB-1AE2D31CE192","f2_bias":"54AF5CDA-B475-4A92-B6C5-51F3A1E98AB0","f2_scale":"4A4715E6-4629-40F5-80AA-4473081AD482","f2_intensity":"FE94338E-DB95-4FE2-937F-021A6018057A","f2_factor":"358F56FB-24B7-4113-BB43-CE759FB7F9B6","f2_alpha":"5057086B-C4B2-4DBF-A8ED-7E608434249D","f2_mode":"3D5E76E2-ECE9-4689-970A-8900D30F8A63"}}]}}],"nodes":[{"uuid":"19C4FD74-208C-48F3-97C9-6E6C61C4E7AF","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"9D8E668D-7C81-429C-8E7A-43160F6BDE0D","nodeType":"Color"},{"uuid":"9D8E668D-7C81-429C-8E7A-43160F6BDE0D","type":"f","value":1,"nodeType":"Float"},{"uuid":"AD4A294D-FFD8-45C0-B1B4-A594CC8FDBB2","type":"f","value":1,"nodeType":"Float"},{"uuid":"B64BA5FD-8ADF-4B8A-BD25-07E8DFE7388D","type":"i","value":0,"nodeType":"Int"},{"uuid":"635D63D7-CF15-41B2-B173-22BCE0FDA9FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"C90F52A6-EF7C-472F-A8B1-3C5DA35F90A3","type":"i","value":0,"nodeType":"Int"},{"uuid":"09EAC6FB-623B-46E9-A39E-86231FF1075A","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"E2BF0488-6615-4561-A1B7-A278F7137CE5","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"0BBF3B18-2558-4DEE-9DE5-A7788AABE253","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C362E34A-79BB-46A4-AECE-26D9ABA89F28","type":"f","value":1,"nodeType":"Float"},{"uuid":"052C9EF2-4559-4A78-A3A4-B4BB06C13C40","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"65E53D49-74C0-4933-A374-59C8BFEBF947","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F6D5A28-43A1-43CD-819E-16C5CCC373EE","type":"f","value":1,"nodeType":"Float"},{"uuid":"FFE86BAB-3DB6-4F5A-A5A8-9FA3C5F8849A","type":"i","value":0,"nodeType":"Int"},{"uuid":"1BE647BF-0942-43B4-94BB-D8E173C6E76C","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"2544259E-433D-4350-BC01-6010512EBC69","nodeType":"Color"},{"uuid":"2544259E-433D-4350-BC01-6010512EBC69","type":"f","value":1,"nodeType":"Float"},{"uuid":"41BD9FD8-668D-4D02-9213-95535ABB62FC","type":"f","value":1,"nodeType":"Float"},{"uuid":"28C82BBB-A42D-4495-99CA-5D22ABDEB1E1","type":"i","value":0,"nodeType":"Int"},{"uuid":"644A43F1-0E0B-4797-8A30-CF038FBA60DC","type":"f","value":1,"nodeType":"Float"},{"uuid":"D5154E35-90D5-4321-BCC0-B80ACA947F4E","type":"i","value":0,"nodeType":"Int"},{"uuid":"5FFBEFF4-53E3-4C13-81DC-E8C6FCDA1CAB","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"55880A47-19AE-40E1-8D40-7AE1AC739CD6","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"36B773AC-4F7C-415D-BE31-5F2EC9429417","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DD363F57-5E08-4B6F-9420-3B32B58DF487","type":"f","value":1,"nodeType":"Float"},{"uuid":"C736C0D1-A408-4E04-9264-0EFC530CACD1","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"4E2AB60A-54E2-4FF1-B198-16C20B407F36","type":"f","value":1,"nodeType":"Float"},{"uuid":"6F5482C3-4A5B-4850-AA2A-0A0C3986F975","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F3AF229-13E4-4D55-AAEC-BD693295D4A5","type":"i","value":0,"nodeType":"Int"},{"uuid":"056A5707-5C18-4EFB-8B80-21BAF997F2BD","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"F3C99DFD-92B4-4309-AF62-0AA32AAAECBF","nodeType":"Color"},{"uuid":"F3C99DFD-92B4-4309-AF62-0AA32AAAECBF","type":"f","value":1,"nodeType":"Float"},{"uuid":"6BC801D8-7C69-40E3-A278-DF2A7656D7F2","type":"i","value":0,"nodeType":"Int"},{"uuid":"80A2ADCA-FEE7-4A90-9CC3-ECD4C6F08927","type":"f","value":1,"nodeType":"Float"},{"uuid":"4CF12F55-AD38-4D24-883D-90D51D3F247F","type":"i","value":0,"nodeType":"Int"},{"uuid":"8AEBEF51-143D-49EB-9B9B-EF3797BC2190","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"DC37E949-CEDA-46BE-92CF-A63E76E60CBB","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"721A72BC-DF1B-45F7-B159-05D2BCB58CFB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"452BB48A-A284-4420-AA76-15DF1E70BAF0","type":"f","value":1,"nodeType":"Float"},{"uuid":"44E9F08D-3648-4866-97EB-3500D8C6790A","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"7133B3B2-CFBA-4CD0-9B0F-1EEC5B6BFE92","type":"f","value":1,"nodeType":"Float"},{"uuid":"0924237A-08A9-416C-8154-BD562272BF2B","type":"f","value":1,"nodeType":"Float"},{"uuid":"303C6865-0F40-4646-9113-63AB5FACADDD","type":"i","value":0,"nodeType":"Int"},{"uuid":"F847B8C7-81E6-4011-B234-93EFEB9CE38B","type":"lambert","color":"056A5707-5C18-4EFB-8B80-21BAF997F2BD","emissiveIntensity":"B949AA33-06AF-4268-BDD1-EEA40DA41DCA","shadingAlpha":"80A2ADCA-FEE7-4A90-9CC3-ECD4C6F08927","shadingBlend":"4CF12F55-AD38-4D24-883D-90D51D3F247F","afterColor":"FAA3F0A4-14A4-4F9A-9780-5435D8E39543","alpha":"D9A624CD-C96A-4816-8481-6879A2587C3E","emissive":"8AEBEF51-143D-49EB-9B9B-EF3797BC2190","nodeType":"Lambert"},{"uuid":"B949AA33-06AF-4268-BDD1-EEA40DA41DCA","type":"f","value":1,"nodeType":"Float"},{"uuid":"FAA3F0A4-14A4-4F9A-9780-5435D8E39543","type":"v3","a":"485AFA5A-6695-46A2-AA4B-1E6DF7B52434","b":"AB4E5823-3539-4A65-AE0A-ED11E935FF80","alpha":"C3884EF3-DBA4-401E-86B2-9D8E2FF0CF88","mode":"303C6865-0F40-4646-9113-63AB5FACADDD","nodeType":"Blend"},{"uuid":"485AFA5A-6695-46A2-AA4B-1E6DF7B52434","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AB4E5823-3539-4A65-AE0A-ED11E935FF80","type":"v3","color":"DC37E949-CEDA-46BE-92CF-A63E76E60CBB","bias":"721A72BC-DF1B-45F7-B159-05D2BCB58CFB","scale":"452BB48A-A284-4420-AA76-15DF1E70BAF0","intensity":"44E9F08D-3648-4866-97EB-3500D8C6790A","factor":"7133B3B2-CFBA-4CD0-9B0F-1EEC5B6BFE92","alpha":"0924237A-08A9-416C-8154-BD562272BF2B","mode":"303C6865-0F40-4646-9113-63AB5FACADDD","calpha":"gAB4E582335394A65AE0AED11E935FF80_calpha","nodeType":"Fresnel"},{"uuid":"C3884EF3-DBA4-401E-86B2-9D8E2FF0CF88","type":"f","src":"gAB4E582335394A65AE0AED11E935FF80_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D9A624CD-C96A-4816-8481-6879A2587C3E","type":"f","value":1,"nodeType":"Float"},{"uuid":"F8D8FC2E-62DF-495E-A6BF-5F83303C2CC5","type":"c","r":0.5490196078431373,"g":0.5882352941176471,"b":0.6392156862745098,"value":9213603,"alpha":"B8223A1A-7D04-49E0-B2FB-2A234E8F0F64","nodeType":"Color"},{"uuid":"B8223A1A-7D04-49E0-B2FB-2A234E8F0F64","type":"f","value":1,"nodeType":"Float"},{"uuid":"3AB50808-37F3-455B-BE9D-B0CCB865E24B","type":"i","value":0,"nodeType":"Int"},{"uuid":"B9DF865B-625B-40CA-86E2-3FB25A967555","type":"f","value":1,"nodeType":"Float"},{"uuid":"339B0D8D-723D-4AAB-AE6E-5A5172833843","type":"i","value":0,"nodeType":"Int"},{"uuid":"A1ECD73D-77AE-485B-90AE-460E0457A6D7","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"DAF98C34-5F40-49D3-81C0-82A67BB66848","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"5DF6D0C1-C593-426A-AF8C-5D93E362D38B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"33DEF7A5-2512-4779-8EAD-877B0031DC82","type":"f","value":1,"nodeType":"Float"},{"uuid":"2A1621EC-8790-422D-8FC3-F226A2897CDA","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"84D8FFBE-A6F9-46B7-9CB6-E10757DCE89C","type":"f","value":1,"nodeType":"Float"},{"uuid":"F29D7B62-3EC2-45E1-BD74-4FBC70941E65","type":"f","value":1,"nodeType":"Float"},{"uuid":"6C17066F-6E11-4BBD-A7DB-6F61DC6430B2","type":"i","value":0,"nodeType":"Int"},{"uuid":"43FD3EAD-D32B-4F9C-ACE5-3987C703E1FF","type":"lambert","color":"F8D8FC2E-62DF-495E-A6BF-5F83303C2CC5","emissiveIntensity":"F6DAC7DE-03E3-4A9A-8CFC-566221054568","shadingAlpha":"B9DF865B-625B-40CA-86E2-3FB25A967555","shadingBlend":"339B0D8D-723D-4AAB-AE6E-5A5172833843","afterColor":"AA28E188-C478-44BD-BC20-9D0B15908DBD","alpha":"5095B6C9-E58D-42C9-85B3-16E38CFB31EC","emissive":"A1ECD73D-77AE-485B-90AE-460E0457A6D7","nodeType":"Lambert"},{"uuid":"F6DAC7DE-03E3-4A9A-8CFC-566221054568","type":"f","value":1,"nodeType":"Float"},{"uuid":"AA28E188-C478-44BD-BC20-9D0B15908DBD","type":"v3","a":"5211DBA5-CABB-4378-AF72-128A4A1D7F57","b":"512010FA-1F3A-4547-A226-2CECE9AD3A5F","alpha":"58346E9F-1E12-40CF-8383-359112D2DB57","mode":"6C17066F-6E11-4BBD-A7DB-6F61DC6430B2","nodeType":"Blend"},{"uuid":"5211DBA5-CABB-4378-AF72-128A4A1D7F57","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"512010FA-1F3A-4547-A226-2CECE9AD3A5F","type":"v3","color":"DAF98C34-5F40-49D3-81C0-82A67BB66848","bias":"5DF6D0C1-C593-426A-AF8C-5D93E362D38B","scale":"33DEF7A5-2512-4779-8EAD-877B0031DC82","intensity":"2A1621EC-8790-422D-8FC3-F226A2897CDA","factor":"84D8FFBE-A6F9-46B7-9CB6-E10757DCE89C","alpha":"F29D7B62-3EC2-45E1-BD74-4FBC70941E65","mode":"6C17066F-6E11-4BBD-A7DB-6F61DC6430B2","calpha":"g512010FA1F3A4547A2262CECE9AD3A5F_calpha","nodeType":"Fresnel"},{"uuid":"58346E9F-1E12-40CF-8383-359112D2DB57","type":"f","src":"g512010FA1F3A4547A2262CECE9AD3A5F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5095B6C9-E58D-42C9-85B3-16E38CFB31EC","type":"f","value":1,"nodeType":"Float"},{"uuid":"7C3C86A8-48A7-4AEB-90E4-274BABF10275","type":"c","r":0.5490196078431373,"g":0.5882352941176471,"b":0.6392156862745098,"value":9213603,"alpha":"9C45D2F0-706B-493D-BAEA-B2F0EC612A3B","nodeType":"Color"},{"uuid":"9C45D2F0-706B-493D-BAEA-B2F0EC612A3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"A5BFED7C-40D0-4758-8392-89252284806C","type":"i","value":0,"nodeType":"Int"},{"uuid":"DE74393B-2E26-457F-AF21-59FCA32A7ED1","type":"f","value":1,"nodeType":"Float"},{"uuid":"19B905A0-FFDE-4C0E-A3D2-979CB98419CF","type":"i","value":0,"nodeType":"Int"},{"uuid":"A42E4123-9081-4967-8846-5320CDC351A0","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"71DAFEB8-73C7-4CA1-AC7E-AE0FDA51BF43","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"4788AC6F-2983-44B9-B3BE-B78C9E5D05FA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"88448032-B2C5-4A11-B00E-2D5BA264AC1B","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A173EF5-C2BE-408F-B907-34C74116BC68","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"52A59606-3A39-48F3-8841-4A112E360DF5","type":"f","value":1,"nodeType":"Float"},{"uuid":"EAC56711-D2FB-4A0D-9750-BC175216D033","type":"f","value":1,"nodeType":"Float"},{"uuid":"592B8CCF-3B45-4662-95A2-D9C691BB876D","type":"i","value":0,"nodeType":"Int"},{"uuid":"598E54CA-5BB3-4ED0-9DF8-2C550ADF4F00","type":"lambert","color":"7C3C86A8-48A7-4AEB-90E4-274BABF10275","emissiveIntensity":"8B5FF59F-E780-4B06-BA90-70E46462B0D0","shadingAlpha":"DE74393B-2E26-457F-AF21-59FCA32A7ED1","shadingBlend":"19B905A0-FFDE-4C0E-A3D2-979CB98419CF","afterColor":"3F58CBEC-3C1C-4F70-98F8-D59000893B60","alpha":"6F583C11-9E3E-4D90-A627-8852A0642792","emissive":"A42E4123-9081-4967-8846-5320CDC351A0","nodeType":"Lambert"},{"uuid":"8B5FF59F-E780-4B06-BA90-70E46462B0D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F58CBEC-3C1C-4F70-98F8-D59000893B60","type":"v3","a":"D5BDE69B-8A95-48FD-908C-4C4E61A8EB82","b":"DD539E45-87B3-4CEC-9C59-EB4792995E62","alpha":"9DA9C4EA-F8E2-45F4-AE93-F4A99D959E92","mode":"592B8CCF-3B45-4662-95A2-D9C691BB876D","nodeType":"Blend"},{"uuid":"D5BDE69B-8A95-48FD-908C-4C4E61A8EB82","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DD539E45-87B3-4CEC-9C59-EB4792995E62","type":"v3","color":"71DAFEB8-73C7-4CA1-AC7E-AE0FDA51BF43","bias":"4788AC6F-2983-44B9-B3BE-B78C9E5D05FA","scale":"88448032-B2C5-4A11-B00E-2D5BA264AC1B","intensity":"6A173EF5-C2BE-408F-B907-34C74116BC68","factor":"52A59606-3A39-48F3-8841-4A112E360DF5","alpha":"EAC56711-D2FB-4A0D-9750-BC175216D033","mode":"592B8CCF-3B45-4662-95A2-D9C691BB876D","calpha":"gDD539E4587B34CEC9C59EB4792995E62_calpha","nodeType":"Fresnel"},{"uuid":"9DA9C4EA-F8E2-45F4-AE93-F4A99D959E92","type":"f","src":"gDD539E4587B34CEC9C59EB4792995E62_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6F583C11-9E3E-4D90-A627-8852A0642792","type":"f","value":1,"nodeType":"Float"},{"uuid":"CD328A15-5093-4E2E-B70B-C6C711071861","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"2EA409B1-E8E9-4724-94B7-133F417F1EBA","nodeType":"Color"},{"uuid":"2EA409B1-E8E9-4724-94B7-133F417F1EBA","type":"f","value":1,"nodeType":"Float"},{"uuid":"F52E8BA6-02D5-4AB7-A765-42E291758A9D","type":"i","value":0,"nodeType":"Int"},{"uuid":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","type":"f","value":1,"nodeType":"Float"},{"uuid":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","type":"i","value":0,"nodeType":"Int"},{"uuid":"FE92C1E7-9238-476D-AB2F-C75F36284429","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A72A1025-349D-4096-BBE7-D54DBC6D3405","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"BDDC2E16-3C49-438D-AF75-AF0C45B52123","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"FA2CE152-C264-4710-9CA0-BE0C735AF726","type":"f","value":1,"nodeType":"Float"},{"uuid":"742C7D10-7C8B-4888-961D-0E5366715768","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"49F28E1F-94DE-4F3D-A659-C9D12F8F3374","type":"f","value":1,"nodeType":"Float"},{"uuid":"7CE25E9B-F229-4916-8B75-C108C39198FC","type":"f","value":1,"nodeType":"Float"},{"uuid":"8BC15C32-957B-4D04-B39F-4FEC06D1BA6B","type":"i","value":0,"nodeType":"Int"},{"uuid":"E2BF683B-7474-47CC-926C-AEDEF01D2CEA","type":"lambert","color":"CD328A15-5093-4E2E-B70B-C6C711071861","emissiveIntensity":"60C85E54-3B36-4050-91EE-CE4C17903E17","shadingAlpha":"B91D0FEE-46C3-43CF-9F5D-97D19E808F51","shadingBlend":"51F6C0A8-747E-4CC3-994F-D987F45BE6BE","afterColor":"DAAB136C-146F-48F2-A5F3-2D4C76BE0E85","alpha":"39EFACFE-0BBB-4A4F-AA96-0EA4CDAE378C","emissive":"FE92C1E7-9238-476D-AB2F-C75F36284429","nodeType":"Lambert"},{"uuid":"60C85E54-3B36-4050-91EE-CE4C17903E17","type":"f","value":1,"nodeType":"Float"},{"uuid":"DAAB136C-146F-48F2-A5F3-2D4C76BE0E85","type":"v3","a":"06D1144B-69A8-442D-A609-639558BF4E14","b":"223C8D96-8862-49B9-8BFC-0A4AD2C0839A","alpha":"6B607CE5-FE5F-4A80-A3BB-11B7620A5806","mode":"8BC15C32-957B-4D04-B39F-4FEC06D1BA6B","nodeType":"Blend"},{"uuid":"06D1144B-69A8-442D-A609-639558BF4E14","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"223C8D96-8862-49B9-8BFC-0A4AD2C0839A","type":"v3","color":"A72A1025-349D-4096-BBE7-D54DBC6D3405","bias":"BDDC2E16-3C49-438D-AF75-AF0C45B52123","scale":"FA2CE152-C264-4710-9CA0-BE0C735AF726","intensity":"742C7D10-7C8B-4888-961D-0E5366715768","factor":"49F28E1F-94DE-4F3D-A659-C9D12F8F3374","alpha":"7CE25E9B-F229-4916-8B75-C108C39198FC","mode":"8BC15C32-957B-4D04-B39F-4FEC06D1BA6B","calpha":"g223C8D96886249B98BFC0A4AD2C0839A_calpha","nodeType":"Fresnel"},{"uuid":"6B607CE5-FE5F-4A80-A3BB-11B7620A5806","type":"f","src":"g223C8D96886249B98BFC0A4AD2C0839A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"39EFACFE-0BBB-4A4F-AA96-0EA4CDAE378C","type":"f","value":1,"nodeType":"Float"},{"uuid":"0263B709-EB91-469A-8DEE-B4F41F316AE1","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"007EFE15-EC3C-4A82-AFA1-21608C3A9CA4","nodeType":"Color"},{"uuid":"007EFE15-EC3C-4A82-AFA1-21608C3A9CA4","type":"f","value":1,"nodeType":"Float"},{"uuid":"A4135212-B9CE-46FA-88C1-476CBE59C249","type":"i","value":0,"nodeType":"Int"},{"uuid":"09413C17-B2BA-4D0D-BF1F-EEBA05818935","type":"f","value":1,"nodeType":"Float"},{"uuid":"E901797A-03E2-464D-89B7-ECD2AC1B3749","type":"i","value":0,"nodeType":"Int"},{"uuid":"068666D9-E360-4607-B6F0-39A546AE3581","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"AA8A7071-5890-45DC-B7AD-8F36BD1FB335","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"8FA0234B-43AD-4CDC-BFED-9D976F2A8F7C","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4D8E34CC-570D-4F1B-86EF-F754AF684D18","type":"f","value":1,"nodeType":"Float"},{"uuid":"995A6D00-B8CA-4A44-A1B0-E775E4BA2F43","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"8AC05B73-E3C1-40C2-A483-0463F2C10C58","type":"f","value":1,"nodeType":"Float"},{"uuid":"A37F39E9-F907-4B4D-9A80-A289AD95A912","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F6D8204-E19A-4C67-8E4F-DEA494F0A489","type":"i","value":0,"nodeType":"Int"},{"uuid":"69D13EDB-EA89-4BA9-BCBA-A52C3BA5F118","type":"lambert","color":"0263B709-EB91-469A-8DEE-B4F41F316AE1","emissiveIntensity":"1B077F2F-8AE8-4F10-AFF7-8FA75360769D","shadingAlpha":"09413C17-B2BA-4D0D-BF1F-EEBA05818935","shadingBlend":"E901797A-03E2-464D-89B7-ECD2AC1B3749","afterColor":"0B3128C1-F8A9-49CC-9A20-50602E2073BB","alpha":"BF59C554-5167-4B5C-98DE-8B44B93AB344","emissive":"068666D9-E360-4607-B6F0-39A546AE3581","nodeType":"Lambert"},{"uuid":"1B077F2F-8AE8-4F10-AFF7-8FA75360769D","type":"f","value":1,"nodeType":"Float"},{"uuid":"0B3128C1-F8A9-49CC-9A20-50602E2073BB","type":"v3","a":"2A262093-543B-4D30-AB52-D4B5E79E1AF1","b":"7E5B2992-A0B9-45CB-9654-A9320C0B2A7F","alpha":"74B96CF7-03E2-4A8A-891F-28B8166F17B9","mode":"3F6D8204-E19A-4C67-8E4F-DEA494F0A489","nodeType":"Blend"},{"uuid":"2A262093-543B-4D30-AB52-D4B5E79E1AF1","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7E5B2992-A0B9-45CB-9654-A9320C0B2A7F","type":"v3","color":"AA8A7071-5890-45DC-B7AD-8F36BD1FB335","bias":"8FA0234B-43AD-4CDC-BFED-9D976F2A8F7C","scale":"4D8E34CC-570D-4F1B-86EF-F754AF684D18","intensity":"995A6D00-B8CA-4A44-A1B0-E775E4BA2F43","factor":"8AC05B73-E3C1-40C2-A483-0463F2C10C58","alpha":"A37F39E9-F907-4B4D-9A80-A289AD95A912","mode":"3F6D8204-E19A-4C67-8E4F-DEA494F0A489","calpha":"g7E5B2992A0B945CB9654A9320C0B2A7F_calpha","nodeType":"Fresnel"},{"uuid":"74B96CF7-03E2-4A8A-891F-28B8166F17B9","type":"f","src":"g7E5B2992A0B945CB9654A9320C0B2A7F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BF59C554-5167-4B5C-98DE-8B44B93AB344","type":"f","value":1,"nodeType":"Float"},{"uuid":"A52B95FC-05CC-4213-97AA-388431358A0F","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"5171B922-75B3-4E97-882C-DA914A4E1823","nodeType":"Color"},{"uuid":"5171B922-75B3-4E97-882C-DA914A4E1823","type":"f","value":1,"nodeType":"Float"},{"uuid":"EE52DE1D-F952-4200-9E8A-161231C6330A","type":"i","value":0,"nodeType":"Int"},{"uuid":"D492109B-B70D-4A50-AA44-7DFEEB8F095B","type":"f","value":1,"nodeType":"Float"},{"uuid":"5D8C878B-A56A-4A83-AFC8-0770F5AEAE88","type":"i","value":0,"nodeType":"Int"},{"uuid":"F0F7D8BF-024A-4D94-B35F-3BD2BA3DEB9B","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"34FC9353-1402-4FC2-B03C-26899D151284","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"416CAD2D-354F-4D33-BF64-FA5E26E777FE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"85932E5A-B245-42F5-875E-72CC13B02930","type":"f","value":1,"nodeType":"Float"},{"uuid":"3073C364-F100-4D2C-B89E-E134FD15C8E7","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"0884AED7-24C4-4822-917C-FBBCEB234D6B","type":"f","value":1,"nodeType":"Float"},{"uuid":"A86C1483-5929-4344-9703-4B0C367357D3","type":"f","value":1,"nodeType":"Float"},{"uuid":"C8AF333B-87A0-4DAC-9571-DC3D50E044B9","type":"i","value":0,"nodeType":"Int"},{"uuid":"787CC4FB-BC25-479A-85C2-2723999E46F4","type":"lambert","color":"A52B95FC-05CC-4213-97AA-388431358A0F","emissiveIntensity":"CFBC4336-4A09-42AF-BAD8-1EC44828E04F","shadingAlpha":"D492109B-B70D-4A50-AA44-7DFEEB8F095B","shadingBlend":"5D8C878B-A56A-4A83-AFC8-0770F5AEAE88","afterColor":"F55408B8-7D28-46B3-9464-A241DC3CF09C","alpha":"3874F61D-9FD8-488E-BD2A-7ECCD7D582AE","emissive":"F0F7D8BF-024A-4D94-B35F-3BD2BA3DEB9B","nodeType":"Lambert"},{"uuid":"CFBC4336-4A09-42AF-BAD8-1EC44828E04F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F55408B8-7D28-46B3-9464-A241DC3CF09C","type":"v3","a":"BC0B81A3-01A3-4E9D-90C1-14F6BF16EE34","b":"139A748D-42DD-4995-B95A-C9040662EE92","alpha":"AA414E43-7987-496D-BFA9-CE9189ED4D38","mode":"C8AF333B-87A0-4DAC-9571-DC3D50E044B9","nodeType":"Blend"},{"uuid":"BC0B81A3-01A3-4E9D-90C1-14F6BF16EE34","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"139A748D-42DD-4995-B95A-C9040662EE92","type":"v3","color":"34FC9353-1402-4FC2-B03C-26899D151284","bias":"416CAD2D-354F-4D33-BF64-FA5E26E777FE","scale":"85932E5A-B245-42F5-875E-72CC13B02930","intensity":"3073C364-F100-4D2C-B89E-E134FD15C8E7","factor":"0884AED7-24C4-4822-917C-FBBCEB234D6B","alpha":"A86C1483-5929-4344-9703-4B0C367357D3","mode":"C8AF333B-87A0-4DAC-9571-DC3D50E044B9","calpha":"g139A748D42DD4995B95AC9040662EE92_calpha","nodeType":"Fresnel"},{"uuid":"AA414E43-7987-496D-BFA9-CE9189ED4D38","type":"f","src":"g139A748D42DD4995B95AC9040662EE92_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"3874F61D-9FD8-488E-BD2A-7ECCD7D582AE","type":"f","value":1,"nodeType":"Float"},{"uuid":"A55E77F3-0E7A-4BFB-8B9D-ECEEA3D41E47","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"D823B045-6DBB-44B5-95A8-46BB3BA59D90","nodeType":"Color"},{"uuid":"D823B045-6DBB-44B5-95A8-46BB3BA59D90","type":"f","value":1,"nodeType":"Float"},{"uuid":"043CEBF1-A8A0-4DEF-A037-D78EBA9FAEBC","type":"i","value":0,"nodeType":"Int"},{"uuid":"75B1A6F3-174F-4FF8-B9A1-CEB7E99CAA3B","type":"f","value":1,"nodeType":"Float"},{"uuid":"B94C5FD1-D069-4902-A336-E0C1BF5E13A3","type":"i","value":0,"nodeType":"Int"},{"uuid":"F32614B1-C4B6-4A85-A788-BF27D5294848","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"A4517DBD-6518-46C6-8BF9-7BBDDEAAF414","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"C60DCC4A-8430-481C-8EA7-CDD139571E51","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6F3F1F37-26C3-4AF5-8819-8C26A0717B03","type":"f","value":1,"nodeType":"Float"},{"uuid":"7E76741A-011C-4C19-A41E-F951D98901A5","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"95CCDABF-CE1C-497D-9222-21CBEB76ADC3","type":"f","value":1,"nodeType":"Float"},{"uuid":"F49D4EF2-FD4A-4B4E-B704-ACC07DBA5AB1","type":"f","value":1,"nodeType":"Float"},{"uuid":"107B3BD8-8299-45C2-B623-2281C5A74EA1","type":"i","value":0,"nodeType":"Int"},{"uuid":"B52F1FE5-8248-4809-A1BC-ECFD458669D7","type":"lambert","color":"A55E77F3-0E7A-4BFB-8B9D-ECEEA3D41E47","emissiveIntensity":"B63EE036-5917-4FFF-AE39-A2B76BBB26FE","shadingAlpha":"75B1A6F3-174F-4FF8-B9A1-CEB7E99CAA3B","shadingBlend":"B94C5FD1-D069-4902-A336-E0C1BF5E13A3","afterColor":"2EA4DC66-0E1F-4AD9-AD1E-C8A891182539","alpha":"5D3CDB15-02B5-4ABF-9FB0-BC85FC1DD4C4","emissive":"F32614B1-C4B6-4A85-A788-BF27D5294848","nodeType":"Lambert"},{"uuid":"B63EE036-5917-4FFF-AE39-A2B76BBB26FE","type":"f","value":1,"nodeType":"Float"},{"uuid":"2EA4DC66-0E1F-4AD9-AD1E-C8A891182539","type":"v3","a":"C12CF034-8877-413B-8B0C-E0499474AB38","b":"608B3290-81C9-40F0-983A-766C1723AA17","alpha":"C54FC698-5CC7-4B21-B03C-5FE14C4DA366","mode":"107B3BD8-8299-45C2-B623-2281C5A74EA1","nodeType":"Blend"},{"uuid":"C12CF034-8877-413B-8B0C-E0499474AB38","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"608B3290-81C9-40F0-983A-766C1723AA17","type":"v3","color":"A4517DBD-6518-46C6-8BF9-7BBDDEAAF414","bias":"C60DCC4A-8430-481C-8EA7-CDD139571E51","scale":"6F3F1F37-26C3-4AF5-8819-8C26A0717B03","intensity":"7E76741A-011C-4C19-A41E-F951D98901A5","factor":"95CCDABF-CE1C-497D-9222-21CBEB76ADC3","alpha":"F49D4EF2-FD4A-4B4E-B704-ACC07DBA5AB1","mode":"107B3BD8-8299-45C2-B623-2281C5A74EA1","calpha":"g608B329081C940F0983A766C1723AA17_calpha","nodeType":"Fresnel"},{"uuid":"C54FC698-5CC7-4B21-B03C-5FE14C4DA366","type":"f","src":"g608B329081C940F0983A766C1723AA17_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5D3CDB15-02B5-4ABF-9FB0-BC85FC1DD4C4","type":"f","value":1,"nodeType":"Float"},{"uuid":"04C17239-B792-4814-9F3C-C27DCF81878E","type":"f","value":1,"nodeType":"Float"},{"uuid":"F4ED4209-C836-4EE3-B214-DCF3FE649D6F","type":"i","value":0,"nodeType":"Int"},{"uuid":"D2F9BDA3-210E-4EF7-815E-697421B18D13","type":"f","value":30,"nodeType":"Float"},{"uuid":"306C8F7F-25D5-47FF-9918-128C77034ECF","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"19D30ACE-63A8-4333-9694-AAF6DC4B622B","type":"f","value":10,"nodeType":"Float"},{"uuid":"ED75662B-086F-4884-B603-7074CF262A98","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"52B0C0C5-D3AE-4E34-AA9A-A6A40542A993","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"7BEAB10A-21B2-4E88-AF7D-8F7A398CAAEF","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"462C7BB6-CE2A-453E-90E6-54E004A005DC","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"7B797382-3263-40C7-BA71-0CB831E764E6","project":false,"nodeType":"Texture"},{"uuid":"7B797382-3263-40C7-BA71-0CB831E764E6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"375785C5-AB5E-4D75-9B03-BC1D27F6447C","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"70F29359-BE29-4FFA-98AE-7CAFD528A33F","project":false,"nodeType":"Texture"},{"uuid":"70F29359-BE29-4FFA-98AE-7CAFD528A33F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"6A618525-F9EB-4CE7-BA85-807FD28D7E71","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"45EDE4AD-35E2-41C7-A256-033BCB94839A","type":"f","value":1,"nodeType":"Float"},{"uuid":"5F91E71E-958F-4FAC-B0E3-624A64692854","type":"i","value":0,"nodeType":"Int"},{"uuid":"5AAD4394-2ABA-4C74-B695-C07BAD38E659","type":"f","value":50,"nodeType":"Float"},{"uuid":"243E6630-4736-4F4A-95C0-5551A01C194B","type":"f","value":145,"nodeType":"Float"},{"uuid":"D810C776-4974-4519-9447-448551A011B5","type":"f","value":1,"nodeType":"Float"},{"uuid":"E2222B41-1633-4D7F-818E-AC1E5E7975CE","type":"f","value":0,"nodeType":"Float"},{"uuid":"761418EB-D62B-40CE-98A6-C2698E6EE4E0","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"F0157471-C8F2-43F5-89C6-C1C0CF5A2452","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"A1813342-DF1E-4B7F-841C-8E3FCC0C7826","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"80205659-44F6-4D5D-AB84-EF715A19CB81","type":"f","value":1,"nodeType":"Float"},{"uuid":"EA4B6E05-A972-43D1-B6B9-202F73E2B4C4","type":"i","value":1,"nodeType":"Int"},{"uuid":"024AAAAB-DC61-4E3B-87EF-FC14F751C1D3","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"8DE59201-C5A6-48B1-910E-9EB9B16796D1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4C6B84CE-9C62-4D51-A237-8B0EC9D92EBB","type":"f","value":1,"nodeType":"Float"},{"uuid":"6BF85A80-D6C2-4050-8D83-95778D849361","type":"f","value":2,"nodeType":"Float"},{"uuid":"7CCDB5A8-94D1-4703-8804-178F7AF97031","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6D9F155-9346-4D2D-9CA4-CA76FC98B125","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1A368AA-A63B-4B5C-98FF-637A2500CB35","type":"i","value":2,"nodeType":"Int"},{"uuid":"9E97C8C8-C3BA-469A-A00E-8462BA517025","type":"phong","color":"B5387EDD-1D8C-4732-B1F6-7CF65C109CEA","specular":"306C8F7F-25D5-47FF-9918-128C77034ECF","shininess":"D2F9BDA3-210E-4EF7-815E-697421B18D13","shadingAlpha":"04C17239-B792-4814-9F3C-C27DCF81878E","shadingBlend":"F4ED4209-C836-4EE3-B214-DCF3FE649D6F","afterColor":"A5CC89D1-2F88-447F-8796-C58DE4323080","alpha":"B8AE4E4B-AA83-45F5-9F45-F15C298B6B3D","nodeType":"Phong"},{"uuid":"B5387EDD-1D8C-4732-B1F6-7CF65C109CEA","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"A5CC89D1-2F88-447F-8796-C58DE4323080","type":"v3","a":"2E375518-59C3-4DF0-B88B-9534E34E01B6","b":"ACCAD419-A5A0-457F-AE5C-AB51C7DB40CD","alpha":"2E5C668B-837C-4507-9677-626714B707EA","mode":"F1A368AA-A63B-4B5C-98FF-637A2500CB35","nodeType":"Blend"},{"uuid":"2E375518-59C3-4DF0-B88B-9534E34E01B6","type":"v3","a":"248FEE7A-88E2-42D6-8B94-D8CAB238A445","b":"062C919C-56A4-4FC2-90C8-551636355F4F","alpha":"92900EA2-B51F-4ABD-A95D-AFEA4530AE75","mode":"EA4B6E05-A972-43D1-B6B9-202F73E2B4C4","nodeType":"Blend"},{"uuid":"248FEE7A-88E2-42D6-8B94-D8CAB238A445","type":"v3","a":"F20ACCE3-35F9-4044-8E17-0400589F7AE8","b":"DD30CCCE-E675-4EA7-8F80-CF0EF333E250","alpha":"EE55BAF7-9F13-476B-ABCC-93C9B42BC578","mode":"5F91E71E-958F-4FAC-B0E3-624A64692854","nodeType":"Blend"},{"uuid":"F20ACCE3-35F9-4044-8E17-0400589F7AE8","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"DD30CCCE-E675-4EA7-8F80-CF0EF333E250","type":"v3","thickness":"19D30ACE-63A8-4333-9694-AAF6DC4B622B","ior":"ED75662B-086F-4884-B603-7074CF262A98","roughness":"52B0C0C5-D3AE-4E34-AA9A-A6A40542A993","alpha":"45EDE4AD-35E2-41C7-A256-033BCB94839A","calpha":"gDD30CCCEE6754EA78F80CF0EF333E250_calpha","nodeType":"Transmission"},{"uuid":"EE55BAF7-9F13-476B-ABCC-93C9B42BC578","type":"f","src":"gDD30CCCEE6754EA78F80CF0EF333E250_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"062C919C-56A4-4FC2-90C8-551636355F4F","type":"v3","near":"5AAD4394-2ABA-4C74-B695-C07BAD38E659","far":"243E6630-4736-4F4A-95C0-5551A01C194B","isVector":"D810C776-4974-4519-9447-448551A011B5","isWorldSpace":"E2222B41-1633-4D7F-818E-AC1E5E7975CE","origin":"761418EB-D62B-40CE-98A6-C2698E6EE4E0","colorA":"F0157471-C8F2-43F5-89C6-C1C0CF5A2452","colorB":"A1813342-DF1E-4B7F-841C-8E3FCC0C7826","alpha":"80205659-44F6-4D5D-AB84-EF715A19CB81","nodeType":"Depth"},{"uuid":"92900EA2-B51F-4ABD-A95D-AFEA4530AE75","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"80205659-44F6-4D5D-AB84-EF715A19CB81"},"nodeType":"Expression"},{"uuid":"ACCAD419-A5A0-457F-AE5C-AB51C7DB40CD","type":"v3","color":"024AAAAB-DC61-4E3B-87EF-FC14F751C1D3","bias":"8DE59201-C5A6-48B1-910E-9EB9B16796D1","scale":"4C6B84CE-9C62-4D51-A237-8B0EC9D92EBB","intensity":"6BF85A80-D6C2-4050-8D83-95778D849361","factor":"7CCDB5A8-94D1-4703-8804-178F7AF97031","alpha":"D6D9F155-9346-4D2D-9CA4-CA76FC98B125","mode":"F1A368AA-A63B-4B5C-98FF-637A2500CB35","calpha":"gACCAD419A5A0457FAE5CAB51C7DB40CD_calpha","nodeType":"Fresnel"},{"uuid":"2E5C668B-837C-4507-9677-626714B707EA","type":"f","src":"gACCAD419A5A0457FAE5CAB51C7DB40CD_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B8AE4E4B-AA83-45F5-9F45-F15C298B6B3D","type":"f","value":1,"nodeType":"Float"},{"uuid":"4186C1E0-660F-47D3-8211-6FD2515573A8","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"08B4917E-0CF7-4750-8AD8-684B0C84F71D","nodeType":"Color"},{"uuid":"08B4917E-0CF7-4750-8AD8-684B0C84F71D","type":"f","value":1,"nodeType":"Float"},{"uuid":"124B14FB-1907-4813-BA31-0C1540C66926","type":"i","value":0,"nodeType":"Int"},{"uuid":"6B315BDA-FD68-478F-8D51-DCB2039B20BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"8D47F6CA-494D-41D0-ABBA-990FE4C44DAD","type":"i","value":0,"nodeType":"Int"},{"uuid":"F5D9BC69-2C74-4628-ABA0-4D347B62D221","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"B9846649-DB54-4305-B88A-6F50772742E9","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"6B21860C-E58F-4F17-936C-9271BDF7A0B9","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BA9E5995-E01D-43DC-B871-C6F5AB5581FF","type":"f","value":1,"nodeType":"Float"},{"uuid":"5FC29725-8AF0-429F-B022-B782F66BAAE6","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"AB20AB31-415C-44F6-9D3B-13298538AC9D","type":"f","value":1,"nodeType":"Float"},{"uuid":"46421097-79F2-4A36-A009-F251F97FAD9A","type":"f","value":1,"nodeType":"Float"},{"uuid":"2E4623DC-41B9-45E7-AE08-920C892FFC2F","type":"i","value":0,"nodeType":"Int"},{"uuid":"2993B1AA-F164-46FF-8F49-A9BD1C615CCC","type":"lambert","color":"4186C1E0-660F-47D3-8211-6FD2515573A8","emissiveIntensity":"42864264-F126-4CD7-B9FF-834EE957AC6D","shadingAlpha":"6B315BDA-FD68-478F-8D51-DCB2039B20BF","shadingBlend":"8D47F6CA-494D-41D0-ABBA-990FE4C44DAD","afterColor":"1F4CF2D3-F99C-4F67-A7E7-2507198B18ED","alpha":"71007F4D-6B06-4181-A1D9-AA7C38DC68E1","emissive":"F5D9BC69-2C74-4628-ABA0-4D347B62D221","nodeType":"Lambert"},{"uuid":"42864264-F126-4CD7-B9FF-834EE957AC6D","type":"f","value":1,"nodeType":"Float"},{"uuid":"1F4CF2D3-F99C-4F67-A7E7-2507198B18ED","type":"v3","a":"CD534A45-F98D-4CCF-8249-DA0B17666FC8","b":"B824F67F-F0D4-4328-AAE6-C56256552FE1","alpha":"1F1B670C-260B-437E-8F97-3EDAAA46FAF1","mode":"2E4623DC-41B9-45E7-AE08-920C892FFC2F","nodeType":"Blend"},{"uuid":"CD534A45-F98D-4CCF-8249-DA0B17666FC8","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B824F67F-F0D4-4328-AAE6-C56256552FE1","type":"v3","color":"B9846649-DB54-4305-B88A-6F50772742E9","bias":"6B21860C-E58F-4F17-936C-9271BDF7A0B9","scale":"BA9E5995-E01D-43DC-B871-C6F5AB5581FF","intensity":"5FC29725-8AF0-429F-B022-B782F66BAAE6","factor":"AB20AB31-415C-44F6-9D3B-13298538AC9D","alpha":"46421097-79F2-4A36-A009-F251F97FAD9A","mode":"2E4623DC-41B9-45E7-AE08-920C892FFC2F","calpha":"gB824F67FF0D44328AAE6C56256552FE1_calpha","nodeType":"Fresnel"},{"uuid":"1F1B670C-260B-437E-8F97-3EDAAA46FAF1","type":"f","src":"gB824F67FF0D44328AAE6C56256552FE1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"71007F4D-6B06-4181-A1D9-AA7C38DC68E1","type":"f","value":1,"nodeType":"Float"},{"uuid":"3CE6DE5F-3D80-4C36-9236-9F201256081F","type":"f","value":1,"nodeType":"Float"},{"uuid":"7069EC87-DF0F-4B77-B5AF-692AFA487F20","type":"i","value":0,"nodeType":"Int"},{"uuid":"1EAF6C85-C438-44C7-811E-4E2290C030AD","type":"f","value":30,"nodeType":"Float"},{"uuid":"DECCE9E0-FE74-4A32-8189-1C328F6E4A48","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"8146943A-C48A-4A10-95D0-D540B61D828B","type":"f","value":10,"nodeType":"Float"},{"uuid":"9937B907-B147-41BF-8397-62FE90E40709","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"5CA5CE59-106B-40D8-8CC3-CF6741009B9E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"EF65890E-7E85-4C2F-ADC4-7C57C4D6481A","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E09C143D-6028-4217-ADD6-817CD4FB5581","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"92C7A834-92F7-4E7C-B894-7534E9FACC3C","type":"f","value":1,"nodeType":"Float"},{"uuid":"C998946D-AAF3-4B84-918B-0B0114DA478F","type":"i","value":0,"nodeType":"Int"},{"uuid":"2D69A618-0BD9-4812-8F27-028D5924AEB3","type":"f","value":50,"nodeType":"Float"},{"uuid":"1BD40E33-F370-4AFA-A302-91DB389A6F3D","type":"f","value":98,"nodeType":"Float"},{"uuid":"74399F5C-1676-416A-BC4C-C748E595C7D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"052A2D9A-3FF2-496B-92E0-3BB8692CC5E6","type":"f","value":0,"nodeType":"Float"},{"uuid":"A57E050C-2E69-487D-8927-91D4EE4D475E","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"4E2FF72D-D375-4699-BD45-502BC1ECA3D3","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"B0C488A0-FC2E-4C0D-8972-F3A8101FE12D","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"E135CF75-EF15-4AA0-8237-B8342619ED07","type":"f","value":1,"nodeType":"Float"},{"uuid":"FA0BEFCE-3681-4E52-A63B-F80F7C6F22E3","type":"i","value":1,"nodeType":"Int"},{"uuid":"6BE827D9-6A9E-470F-B92C-01EBFF52B59B","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"61B1E3C1-BC66-47B8-9F8A-0E47F0068587","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"07BF7643-C1ED-4224-AF4C-CF1009128A31","type":"f","value":1,"nodeType":"Float"},{"uuid":"191AF32D-7391-46A6-AB36-C79D55122F11","type":"f","value":2,"nodeType":"Float"},{"uuid":"6B5215B9-B265-4471-B8E7-3A34B0C50E9D","type":"f","value":1,"nodeType":"Float"},{"uuid":"4C82BE8F-AF6E-404A-8D0F-1242AD380C5E","type":"f","value":1,"nodeType":"Float"},{"uuid":"648C612E-CAE8-4E15-94B2-FD51567D4CEF","type":"i","value":2,"nodeType":"Int"},{"uuid":"D9FDCD0C-2E1D-4261-879D-BC89E926219C","type":"f","value":1,"nodeType":"Float"},{"uuid":"A5BE3147-6A6A-41EE-9476-13C3321CC634","type":"i","value":0,"nodeType":"Int"},{"uuid":"1DF2E4F8-C623-492F-8995-5C33F62E4D67","type":"f","value":30,"nodeType":"Float"},{"uuid":"5046B07C-967D-4BD0-B4A4-FF9611F2144E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"E3A50229-59BB-4ECA-BFF1-FA1CFF81CED6","type":"f","value":10,"nodeType":"Float"},{"uuid":"B24F7B13-17E7-4349-865D-78D970B853A8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"4A0A8B54-7720-45C0-8BB6-77D2BC7561CC","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"581C4732-A2B1-402F-9A82-B97076104564","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"54E555BE-A314-4E8B-8D98-1A53780E99E4","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"67A29183-B491-41AB-B1C6-F0486C117E55","type":"f","value":1,"nodeType":"Float"},{"uuid":"D95380F0-53FA-458C-99B2-6830DBF3C451","type":"i","value":0,"nodeType":"Int"},{"uuid":"904F7CA9-C75D-441B-AFBA-57AA8EFB1A76","type":"f","value":50,"nodeType":"Float"},{"uuid":"24E496CE-A867-446C-815A-8B82A6F2B6BD","type":"f","value":98,"nodeType":"Float"},{"uuid":"49CCDA1B-BE80-42F9-92CA-D2ABE9E3CBA6","type":"f","value":1,"nodeType":"Float"},{"uuid":"D2D397E4-DD5C-4D2C-94B3-9D6243CD77EC","type":"f","value":0,"nodeType":"Float"},{"uuid":"85CAD9CD-C551-40C2-8A90-026A6F1C9E90","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"5B832657-9BEF-480A-BEA7-E5C29F9A9898","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"0E71ABDD-9870-4509-AE6B-EF63021A576B","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"9A68F445-A7F7-43FA-A056-9B8F81E6D535","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA88DAE7-B48F-4C08-91FF-5B476AF2687A","type":"i","value":1,"nodeType":"Int"},{"uuid":"6E08010A-4591-40D3-B586-5BC2AABA7E44","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"EFD9217E-E09C-4C4A-8113-E795286ECECB","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E4CE4B2C-7579-415C-BEAE-696F7099988B","type":"f","value":1,"nodeType":"Float"},{"uuid":"4AE5B941-BD1C-4095-9514-E09FB0D06752","type":"f","value":2,"nodeType":"Float"},{"uuid":"0DBE8ECA-438A-46B9-88C1-28D74F4ADF49","type":"f","value":1,"nodeType":"Float"},{"uuid":"614CF1AF-BB6F-406F-B6EC-1ECE55305F8A","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A83DBF1-2150-4B6B-B757-A52619F328C1","type":"i","value":2,"nodeType":"Int"},{"uuid":"8FF419D0-919F-47BC-AD2D-E7DB825DD2A6","type":"f","value":1,"nodeType":"Float"},{"uuid":"BA3E0720-747D-403C-B817-E2A07CFCF1A2","type":"i","value":0,"nodeType":"Int"},{"uuid":"1D2257E3-A893-4900-A5EC-28B0DDB8AEDE","type":"f","value":30,"nodeType":"Float"},{"uuid":"9EC49521-8B76-44B9-97BF-53335430D4A0","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"3C478B0D-2505-403F-BB7C-C30F60541400","type":"f","value":10,"nodeType":"Float"},{"uuid":"4B197A7A-0441-449C-A855-52522736CEDA","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"CC5410EE-8268-4F75-9C84-1995A8E9F734","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"59137B0D-2052-4029-BF50-BA5B7463D2C8","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"64EE1DA1-72FF-44D0-BA05-CCCC54034FB6","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"5CD0B054-99FC-4FAE-AD37-722C79F47BBF","project":false,"nodeType":"Texture"},{"uuid":"5CD0B054-99FC-4FAE-AD37-722C79F47BBF","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B6339D48-FC16-4589-8059-8A61773A9AD4","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"F982E9C9-2D3E-4A0B-B894-1E9EA7E9B841","project":false,"nodeType":"Texture"},{"uuid":"F982E9C9-2D3E-4A0B-B894-1E9EA7E9B841","type":"v2","index":0,"nodeType":"UV"},{"uuid":"987BF313-8DB0-4E14-91D1-3BEE65BD7F48","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"CA117643-E96A-447E-B6E0-6B461B66A235","type":"f","value":1,"nodeType":"Float"},{"uuid":"772C5ACF-9751-43C9-AD95-0AB1EC8E410E","type":"i","value":0,"nodeType":"Int"},{"uuid":"7CEB29DC-5280-4E59-A02C-13F5CBC75649","type":"f","value":50,"nodeType":"Float"},{"uuid":"AC6F780C-28D1-44BE-A2EA-52E3FC8971A3","type":"f","value":98,"nodeType":"Float"},{"uuid":"4FBA0C68-BE26-4594-82E6-A4DD6310777B","type":"f","value":1,"nodeType":"Float"},{"uuid":"D123784E-9817-44F9-81B9-1717F7ED2415","type":"f","value":0,"nodeType":"Float"},{"uuid":"28807E16-4340-4521-8736-EE34525FC9BC","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"C55222EB-7FE6-4B17-8580-EBDF2BC418DE","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"883958C5-E601-49E8-A2EF-6E9C368F02EF","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"5064EF5B-58FA-4C98-86F7-78002033AF08","type":"f","value":1,"nodeType":"Float"},{"uuid":"E4AF0BFA-8467-4730-BD26-8BD5B9DC31B8","type":"i","value":1,"nodeType":"Int"},{"uuid":"C8EB663B-5838-47BC-9379-B06E5CCBD07C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"8180CC52-A1A5-4CFF-AA54-21B845245864","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"30044BB4-3315-4D1D-9290-F9803D31D303","type":"f","value":1,"nodeType":"Float"},{"uuid":"03979E02-521F-40A8-8481-5448756C8BDB","type":"f","value":2,"nodeType":"Float"},{"uuid":"0B0D4E16-604B-477D-B483-BAD1FE256453","type":"f","value":1,"nodeType":"Float"},{"uuid":"14D4B288-4586-42F8-A4CE-52625BA6C9B4","type":"f","value":1,"nodeType":"Float"},{"uuid":"DCF6F3B8-1FD2-4203-AE4C-EDECEFBE2A97","type":"i","value":2,"nodeType":"Int"},{"uuid":"F7CEFA4F-6D9D-4CE7-B1F3-6270892DED53","type":"phong","color":"951CA7AE-D054-4C7F-A4D0-62C3A8ADB068","specular":"9EC49521-8B76-44B9-97BF-53335430D4A0","shininess":"1D2257E3-A893-4900-A5EC-28B0DDB8AEDE","shadingAlpha":"8FF419D0-919F-47BC-AD2D-E7DB825DD2A6","shadingBlend":"BA3E0720-747D-403C-B817-E2A07CFCF1A2","afterColor":"4C404229-ACB3-456B-BC87-C4FC627DEF26","alpha":"C4D953C2-002C-43E3-B456-BC1B058426FB","nodeType":"Phong"},{"uuid":"951CA7AE-D054-4C7F-A4D0-62C3A8ADB068","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"4C404229-ACB3-456B-BC87-C4FC627DEF26","type":"v3","a":"318264FD-1166-4BF9-BE75-769BEB23A494","b":"381C9067-4C3E-41D6-9F46-1EBE754EDA52","alpha":"448E42CE-0C7E-459A-81A6-BB342150A7BF","mode":"DCF6F3B8-1FD2-4203-AE4C-EDECEFBE2A97","nodeType":"Blend"},{"uuid":"318264FD-1166-4BF9-BE75-769BEB23A494","type":"v3","a":"0662326D-D4B8-4552-AB43-D9E96D17D50D","b":"79AFCB7B-CB1E-4678-89A6-B207FB509702","alpha":"810E252D-BEBA-4BCA-8BA0-BBA11B38BB66","mode":"E4AF0BFA-8467-4730-BD26-8BD5B9DC31B8","nodeType":"Blend"},{"uuid":"0662326D-D4B8-4552-AB43-D9E96D17D50D","type":"v3","a":"25B2C693-550F-4F16-BC6B-213BF06CBD55","b":"91072FBB-26F6-4A9D-8FBC-C34184B2EE9E","alpha":"5B411C71-E2F5-4E1E-AD9C-2B39DA8F4CCA","mode":"772C5ACF-9751-43C9-AD95-0AB1EC8E410E","nodeType":"Blend"},{"uuid":"25B2C693-550F-4F16-BC6B-213BF06CBD55","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"91072FBB-26F6-4A9D-8FBC-C34184B2EE9E","type":"v3","thickness":"3C478B0D-2505-403F-BB7C-C30F60541400","ior":"4B197A7A-0441-449C-A855-52522736CEDA","roughness":"CC5410EE-8268-4F75-9C84-1995A8E9F734","alpha":"CA117643-E96A-447E-B6E0-6B461B66A235","calpha":"g91072FBB26F64A9D8FBCC34184B2EE9E_calpha","nodeType":"Transmission"},{"uuid":"5B411C71-E2F5-4E1E-AD9C-2B39DA8F4CCA","type":"f","src":"g91072FBB26F64A9D8FBCC34184B2EE9E_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"79AFCB7B-CB1E-4678-89A6-B207FB509702","type":"v3","near":"7CEB29DC-5280-4E59-A02C-13F5CBC75649","far":"AC6F780C-28D1-44BE-A2EA-52E3FC8971A3","isVector":"4FBA0C68-BE26-4594-82E6-A4DD6310777B","isWorldSpace":"D123784E-9817-44F9-81B9-1717F7ED2415","origin":"28807E16-4340-4521-8736-EE34525FC9BC","colorA":"C55222EB-7FE6-4B17-8580-EBDF2BC418DE","colorB":"883958C5-E601-49E8-A2EF-6E9C368F02EF","alpha":"5064EF5B-58FA-4C98-86F7-78002033AF08","nodeType":"Depth"},{"uuid":"810E252D-BEBA-4BCA-8BA0-BBA11B38BB66","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"5064EF5B-58FA-4C98-86F7-78002033AF08"},"nodeType":"Expression"},{"uuid":"381C9067-4C3E-41D6-9F46-1EBE754EDA52","type":"v3","color":"C8EB663B-5838-47BC-9379-B06E5CCBD07C","bias":"8180CC52-A1A5-4CFF-AA54-21B845245864","scale":"30044BB4-3315-4D1D-9290-F9803D31D303","intensity":"03979E02-521F-40A8-8481-5448756C8BDB","factor":"0B0D4E16-604B-477D-B483-BAD1FE256453","alpha":"14D4B288-4586-42F8-A4CE-52625BA6C9B4","mode":"DCF6F3B8-1FD2-4203-AE4C-EDECEFBE2A97","calpha":"g381C90674C3E41D69F461EBE754EDA52_calpha","nodeType":"Fresnel"},{"uuid":"448E42CE-0C7E-459A-81A6-BB342150A7BF","type":"f","src":"g381C90674C3E41D69F461EBE754EDA52_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C4D953C2-002C-43E3-B456-BC1B058426FB","type":"f","value":1,"nodeType":"Float"},{"uuid":"AD4F8525-94CC-4DD0-9B74-F09BBB856C96","type":"f","value":1,"nodeType":"Float"},{"uuid":"08112E89-EE6B-4FE8-B530-6C7B80D1AF53","type":"i","value":0,"nodeType":"Int"},{"uuid":"78C68B14-6027-45F7-A33A-15F1B24A265F","type":"f","value":30,"nodeType":"Float"},{"uuid":"89B60EEB-B5B0-4DEF-BDF2-891A6A33F340","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"A5E9A888-1AAC-4B7E-B856-115861E4E916","type":"f","value":10,"nodeType":"Float"},{"uuid":"E68375BD-6A00-439E-AF56-9834E3BA41DB","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0E143BE8-DC79-47DD-B755-4E8E7AFAE06E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0D8D4166-6DE0-4B3E-96A6-45332B8CF218","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"328D74B2-2B66-46BF-8ECE-774A5C358E5B","type":"v2","x":0.5669693530079455,"y":1,"nodeType":"Vector2"},{"uuid":"BB7F1FCC-5602-46BC-9CBB-68BE7B64AE3F","type":"f","value":1,"nodeType":"Float"},{"uuid":"8D73D246-84C3-42BB-BBA1-4000BC9B0365","type":"i","value":0,"nodeType":"Int"},{"uuid":"030F58E7-F65C-4EF9-AA7C-850B1865347E","type":"f","value":50,"nodeType":"Float"},{"uuid":"69CE0B41-C963-43DB-A24A-46CB801307D0","type":"f","value":98,"nodeType":"Float"},{"uuid":"9F8305CB-EA2C-4A6E-943B-D96FB5B4EC5B","type":"f","value":1,"nodeType":"Float"},{"uuid":"B76D16E8-0E24-44B4-A5D7-578FF2044A42","type":"f","value":0,"nodeType":"Float"},{"uuid":"0BDD0E4B-5597-40A2-8D33-CE2FC42EB0EF","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"74AAE0FA-6D89-4FA3-A0CF-BEC9DCF45D04","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"FAA78A30-9070-437C-AFC4-955BA0DFF7F7","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"23DBC43D-C0F1-402A-A16F-6E861EB270A3","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE8BCAF2-F0AA-4C29-9991-FB17746F6384","type":"i","value":1,"nodeType":"Int"},{"uuid":"A50CD8C0-32DA-4140-85E6-BC9EDB7E34B0","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"E15BECDF-5119-44C6-8051-C2F9D7443553","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"77B9F116-7DD3-4AFA-B230-BCF521BAD51F","type":"f","value":1,"nodeType":"Float"},{"uuid":"C8B2FA8E-1852-409D-B3F6-6C0AC1133E76","type":"f","value":2,"nodeType":"Float"},{"uuid":"81CB54BD-17FE-45C7-A70A-DA69F3BF5057","type":"f","value":1,"nodeType":"Float"},{"uuid":"45C25D1C-C419-49A9-AA9B-B2000652A2AA","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6DB6241-8AAC-44AE-9C31-D661CD8681A8","type":"i","value":2,"nodeType":"Int"},{"uuid":"0DEE2B8E-5BEF-4031-8613-DC3C3C6A0B13","type":"f","value":1,"nodeType":"Float"},{"uuid":"946B0BE5-7726-45CA-BAF7-8DB2B1AE7920","type":"i","value":0,"nodeType":"Int"},{"uuid":"EB354B67-694E-4A72-9F66-9E1A30BD50F0","type":"f","value":30,"nodeType":"Float"},{"uuid":"A352C1B8-AE00-411F-8677-5404B44313C1","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"5869E869-EA57-435D-A2FE-45051A7152D5","type":"f","value":10,"nodeType":"Float"},{"uuid":"92D67B99-96D0-4907-881C-EEFA55510557","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"48989389-8D68-4499-A544-ED625EFCF1D4","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FDED0F49-0912-4C98-A79E-328266EEED29","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E377355A-A4B6-49DE-BAFE-DBE4D594D850","type":"v2","x":0.5669693530079455,"y":1,"nodeType":"Vector2"},{"uuid":"091EFFB0-400E-45C0-B298-B9098F54C581","type":"f","value":1,"nodeType":"Float"},{"uuid":"F66B2F73-EAED-4407-873D-B7B080756777","type":"i","value":0,"nodeType":"Int"},{"uuid":"8DC53301-676A-4C42-905E-3F0BF8DAF835","type":"f","value":50,"nodeType":"Float"},{"uuid":"F0DB15C6-1E3A-42FC-9947-1CB79CC81905","type":"f","value":98,"nodeType":"Float"},{"uuid":"00652C32-961B-48FC-9330-D2C400D84D38","type":"f","value":1,"nodeType":"Float"},{"uuid":"613E84CD-BCF1-472B-B7B0-40BAF80E45ED","type":"f","value":0,"nodeType":"Float"},{"uuid":"7B0130E9-76BF-41BF-87D7-E4B2CDC0C56B","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"264CACCA-AB57-4D74-8E72-AC9996744EA6","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"CF460658-74A7-4844-9D63-6AF3C67AFBD4","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"3EB550B8-C9D5-4288-A702-3B643882E9F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"7FD2E8D4-D580-424F-9ABB-B5562284D208","type":"i","value":1,"nodeType":"Int"},{"uuid":"F5F585A4-D73A-46C0-969B-35CF3CE9DB91","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"73C7CDE4-AA47-40A0-9ED7-8FEB17FB22C7","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"BE96FC73-8972-4AF1-AA82-96B7301DE6DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"AEB4213E-21C2-47F1-99F9-25636E3E65A5","type":"f","value":2,"nodeType":"Float"},{"uuid":"74A880FC-52FC-4973-AA7A-50C7A2E4AAE5","type":"f","value":1,"nodeType":"Float"},{"uuid":"0286A423-CA0B-4423-BFBB-29C092A18F2A","type":"f","value":1,"nodeType":"Float"},{"uuid":"E79F6519-4BA5-4096-A857-F81BAF72AAD5","type":"i","value":2,"nodeType":"Int"},{"uuid":"BCADDF4E-F5DF-4FBE-801C-A3B0275B409A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2EF10F3-3C3C-4B77-B216-8ADD22BE7DBB","type":"i","value":0,"nodeType":"Int"},{"uuid":"941CBD1C-A884-4495-8DF4-28AE8162D57A","type":"f","value":30,"nodeType":"Float"},{"uuid":"871CD790-E60C-4599-9DAE-7F469A246A92","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"0CBD7B52-E358-4BB2-A5F7-D832EFF15E77","type":"f","value":10,"nodeType":"Float"},{"uuid":"1763A6C9-C736-40DA-9E79-AA9CA0461A16","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A945615E-69D2-427D-9185-188AAD675220","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"9A1CB169-64E4-4E5B-918B-1DBB5A9416CD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"BC484E28-ADD0-4BB2-B578-9E8049539997","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"53334CBD-DE94-4B45-81E3-0A587BE80220","project":false,"nodeType":"Texture"},{"uuid":"53334CBD-DE94-4B45-81E3-0A587BE80220","type":"v2","index":0,"nodeType":"UV"},{"uuid":"130ED571-8120-4111-85DA-5C0221B0E003","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"64B50FB3-FAB0-4ECD-9333-1BD4690F23AC","project":false,"nodeType":"Texture"},{"uuid":"64B50FB3-FAB0-4ECD-9333-1BD4690F23AC","type":"v2","index":0,"nodeType":"UV"},{"uuid":"322AB661-614E-42FC-AE33-EC6A20466486","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"79088BD1-B519-498C-9D3E-CF53A31B9A0E","type":"f","value":1,"nodeType":"Float"},{"uuid":"88BB14CB-7B9A-46FC-86E8-DD54D620F0C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"89DA0915-0DA8-474F-BC99-EBC491E95643","type":"f","value":50,"nodeType":"Float"},{"uuid":"27AD7514-3411-49CD-97E5-EF75AE4FFA6F","type":"f","value":98,"nodeType":"Float"},{"uuid":"F44561E0-75CB-4C35-865B-5656AAEDF0B6","type":"f","value":1,"nodeType":"Float"},{"uuid":"A0079897-D223-438B-815B-86DD5E561D79","type":"f","value":0,"nodeType":"Float"},{"uuid":"186217A8-0632-4BD2-BC07-2CC43DBA2C08","type":"v3","x":-34,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"BCF2C492-5602-4BB1-A3F7-4191E2D64E51","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"E59BB232-50BB-4CCB-BDC8-F0A655C952C7","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"68B29B55-3A58-4C8F-9125-59326E12978A","type":"f","value":1,"nodeType":"Float"},{"uuid":"9C6459F6-7830-4740-8578-21F4961669FF","type":"i","value":1,"nodeType":"Int"},{"uuid":"D7D40ADF-6524-400B-A2AC-F2A5C744A0CD","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"3AB6DD75-895E-4FFD-9FE2-11C7A7AF05EE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"0E4DD8AE-F669-40BB-A098-D705F7656345","type":"f","value":1,"nodeType":"Float"},{"uuid":"61ABEDF1-8CE7-4272-8E4F-6824ADDE7300","type":"f","value":2,"nodeType":"Float"},{"uuid":"6F2B147D-9A21-477E-B713-81BF106B1849","type":"f","value":1,"nodeType":"Float"},{"uuid":"E5E2B385-EBAB-413A-B727-E82441CD00BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4AA47C1-1197-48F6-8C2F-1ED15726460C","type":"i","value":2,"nodeType":"Int"},{"uuid":"1C34E1B0-C748-4D7D-8004-B4ADE7E37724","type":"phong","color":"FD3BF577-005F-4ADA-A3CE-D1FF48348501","specular":"871CD790-E60C-4599-9DAE-7F469A246A92","shininess":"941CBD1C-A884-4495-8DF4-28AE8162D57A","shadingAlpha":"BCADDF4E-F5DF-4FBE-801C-A3B0275B409A","shadingBlend":"B2EF10F3-3C3C-4B77-B216-8ADD22BE7DBB","afterColor":"ED365D14-8345-4F02-A4B8-4124E6D22455","alpha":"E342F42D-DA2B-4644-AB1D-DD9F2D37F34C","nodeType":"Phong"},{"uuid":"FD3BF577-005F-4ADA-A3CE-D1FF48348501","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"ED365D14-8345-4F02-A4B8-4124E6D22455","type":"v3","a":"D1BD1E18-63BA-4F9C-A2A6-30B5FBA191D7","b":"6FAA4FE5-6D6B-4F5F-917B-6F3257D39BC1","alpha":"A119E422-EC96-4A95-B844-2ACB9985D492","mode":"B4AA47C1-1197-48F6-8C2F-1ED15726460C","nodeType":"Blend"},{"uuid":"D1BD1E18-63BA-4F9C-A2A6-30B5FBA191D7","type":"v3","a":"D8C392C9-05C6-4C05-937B-7F46E9BFB2B6","b":"06EFD098-6AA7-445B-9958-4D8E0475AF57","alpha":"2358D11A-45FB-4E47-A10C-7F6DB948D676","mode":"9C6459F6-7830-4740-8578-21F4961669FF","nodeType":"Blend"},{"uuid":"D8C392C9-05C6-4C05-937B-7F46E9BFB2B6","type":"v3","a":"254CB25D-7351-4B78-9C2B-8AEBBA64AACE","b":"6E1F81EA-12AC-4AED-9891-E9AB6C49FDF0","alpha":"A7CACB08-6C1A-45CE-807D-2E0682C98709","mode":"88BB14CB-7B9A-46FC-86E8-DD54D620F0C3","nodeType":"Blend"},{"uuid":"254CB25D-7351-4B78-9C2B-8AEBBA64AACE","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6E1F81EA-12AC-4AED-9891-E9AB6C49FDF0","type":"v3","thickness":"0CBD7B52-E358-4BB2-A5F7-D832EFF15E77","ior":"1763A6C9-C736-40DA-9E79-AA9CA0461A16","roughness":"A945615E-69D2-427D-9185-188AAD675220","alpha":"79088BD1-B519-498C-9D3E-CF53A31B9A0E","calpha":"g6E1F81EA12AC4AED9891E9AB6C49FDF0_calpha","nodeType":"Transmission"},{"uuid":"A7CACB08-6C1A-45CE-807D-2E0682C98709","type":"f","src":"g6E1F81EA12AC4AED9891E9AB6C49FDF0_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"06EFD098-6AA7-445B-9958-4D8E0475AF57","type":"v3","near":"89DA0915-0DA8-474F-BC99-EBC491E95643","far":"27AD7514-3411-49CD-97E5-EF75AE4FFA6F","isVector":"F44561E0-75CB-4C35-865B-5656AAEDF0B6","isWorldSpace":"A0079897-D223-438B-815B-86DD5E561D79","origin":"186217A8-0632-4BD2-BC07-2CC43DBA2C08","colorA":"BCF2C492-5602-4BB1-A3F7-4191E2D64E51","colorB":"E59BB232-50BB-4CCB-BDC8-F0A655C952C7","alpha":"68B29B55-3A58-4C8F-9125-59326E12978A","nodeType":"Depth"},{"uuid":"2358D11A-45FB-4E47-A10C-7F6DB948D676","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"68B29B55-3A58-4C8F-9125-59326E12978A"},"nodeType":"Expression"},{"uuid":"6FAA4FE5-6D6B-4F5F-917B-6F3257D39BC1","type":"v3","color":"D7D40ADF-6524-400B-A2AC-F2A5C744A0CD","bias":"3AB6DD75-895E-4FFD-9FE2-11C7A7AF05EE","scale":"0E4DD8AE-F669-40BB-A098-D705F7656345","intensity":"61ABEDF1-8CE7-4272-8E4F-6824ADDE7300","factor":"6F2B147D-9A21-477E-B713-81BF106B1849","alpha":"E5E2B385-EBAB-413A-B727-E82441CD00BF","mode":"B4AA47C1-1197-48F6-8C2F-1ED15726460C","calpha":"g6FAA4FE56D6B4F5F917B6F3257D39BC1_calpha","nodeType":"Fresnel"},{"uuid":"A119E422-EC96-4A95-B844-2ACB9985D492","type":"f","src":"g6FAA4FE56D6B4F5F917B6F3257D39BC1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E342F42D-DA2B-4644-AB1D-DD9F2D37F34C","type":"f","value":1,"nodeType":"Float"},{"uuid":"589ED33D-990F-4994-969D-CF6292E5633F","type":"f","value":1,"nodeType":"Float"},{"uuid":"32C970C4-E8B8-4D8D-ABBF-2060B67F7B36","type":"i","value":0,"nodeType":"Int"},{"uuid":"2C3E7640-3585-48ED-8774-01C9AC9DA8F2","type":"f","value":30,"nodeType":"Float"},{"uuid":"70E3D083-EEE3-4186-BADF-6CD8A623CC8D","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"4D445173-5EFC-4BD1-BD28-2FBDB5BF70B7","type":"f","value":10,"nodeType":"Float"},{"uuid":"36FB2791-503F-468E-9CA2-A511C61BE77C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"F595AD97-32B6-45F2-8129-34E485320C54","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FE3894CF-467C-40B8-AFE3-EDCFC7C7F793","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"3169F3C4-50FA-437F-ABC4-E2CDE9FDA147","type":"v2","x":0.5669693530079455,"y":1,"nodeType":"Vector2"},{"uuid":"48DE25AE-11C6-44E0-8B58-496BF72F2C70","type":"f","value":1,"nodeType":"Float"},{"uuid":"6EA8282C-B23E-4205-A5D4-0E5AFD29CBA1","type":"i","value":0,"nodeType":"Int"},{"uuid":"232BD769-1DB7-4147-A195-FCFF339E0BA1","type":"f","value":50,"nodeType":"Float"},{"uuid":"B199C487-B26B-48FF-BC9F-2EE6FCC4F067","type":"f","value":145,"nodeType":"Float"},{"uuid":"B3A36A58-C68D-40DC-86A7-7D47219CF38B","type":"f","value":1,"nodeType":"Float"},{"uuid":"C06E24AC-186C-462B-B0BC-8F9F70814E0C","type":"f","value":0,"nodeType":"Float"},{"uuid":"1BFA1A9E-4F71-4135-8A1C-CBAE1674EE90","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"30E588A6-609F-4586-B80D-ACBC0C6ADC3C","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"81A88FC0-B7E2-44F5-8560-5F3B96ED5A05","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"BB1AB063-0C97-40E0-A414-3CF199D4A05D","type":"f","value":1,"nodeType":"Float"},{"uuid":"9582F4E7-2A97-402F-8EDC-10AFC254D3E1","type":"i","value":1,"nodeType":"Int"},{"uuid":"B1220916-879D-4333-96F7-01EE2A816048","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"84CD2964-4AAA-4009-A808-2719064D5D93","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"98EAD8C6-D086-4D3D-893F-A51FF96CE65E","type":"f","value":1,"nodeType":"Float"},{"uuid":"4FB532E9-A988-46E2-B4E5-10910745E5F7","type":"f","value":2,"nodeType":"Float"},{"uuid":"28E901F2-1683-448E-9390-2E762F5213E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC5ADAF0-498C-4A35-927A-F0CCA3BA13AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"502143CF-0E54-4163-B9E1-5C7019C0071F","type":"i","value":2,"nodeType":"Int"},{"uuid":"B02EEF6D-C451-4E18-A401-BFE72DC8FCE8","type":"f","value":1,"nodeType":"Float"},{"uuid":"6350943E-1D1D-4558-A0B5-7AD629D1481A","type":"i","value":0,"nodeType":"Int"},{"uuid":"E638F4BF-5CF7-400B-AB51-F3011ECE5005","type":"f","value":30,"nodeType":"Float"},{"uuid":"6AE4D631-1936-4B38-B8EF-5FF505648ACF","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"59D13C96-ABF7-428F-9CDD-D1B731AB7FA1","type":"f","value":10,"nodeType":"Float"},{"uuid":"9D661658-21DD-4B58-B8E7-762CEBA9D882","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"B2065FF7-8AEB-4EB0-BE87-07D80D642A6E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"58CE9C9A-34C9-466E-8719-B117BFE5B6A6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"80A19171-77FB-4A6C-A3CC-A74C26282533","type":"v2","x":0.5669693530079455,"y":1,"nodeType":"Vector2"},{"uuid":"4A7B4ADA-50FC-4AC1-A612-CF28079217ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"9F6EE095-3F34-4367-9688-DED916A9D935","type":"i","value":0,"nodeType":"Int"},{"uuid":"4050E6CC-163C-4DF2-91BB-1DD7221BDDB4","type":"f","value":50,"nodeType":"Float"},{"uuid":"8B3B90A5-89C3-43D5-BCB1-A7EECC825D5D","type":"f","value":145,"nodeType":"Float"},{"uuid":"68407587-27E4-47C9-98D5-2DC20E6F6C8C","type":"f","value":1,"nodeType":"Float"},{"uuid":"4518FA6C-265C-42F3-A8FE-35EBAD8C754F","type":"f","value":0,"nodeType":"Float"},{"uuid":"DEDBC94B-FFB8-477B-8D82-B7176A1D75D9","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"D9EF7422-41DA-44DA-BCB3-DE463FC8F9BC","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"8AEABEBF-5DEC-422D-A545-E300A3A4557F","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"FFA9967F-2102-4A10-B091-8397C6A058E4","type":"f","value":1,"nodeType":"Float"},{"uuid":"D41AC119-0273-4B7C-A101-1C946382A3DA","type":"i","value":1,"nodeType":"Int"},{"uuid":"27F1F8DA-A6A9-4FD3-9926-8A05E7AFB525","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"5867B28C-609F-4AF4-AA93-F6C1C7D9DDD1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"392CC30C-3580-4BC6-A9DC-259E52287471","type":"f","value":1,"nodeType":"Float"},{"uuid":"B698ECB4-2F83-4B5D-AB5D-B45CD2020968","type":"f","value":2,"nodeType":"Float"},{"uuid":"B434C26E-E858-4E72-B928-9620389A484E","type":"f","value":1,"nodeType":"Float"},{"uuid":"B9504132-CAEA-4119-BFE5-002BA0242662","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7D0F32A-7E2C-4D77-AAE7-1FA8CAD019BA","type":"i","value":2,"nodeType":"Int"},{"uuid":"B72D38B9-BAD6-4C05-870C-A8985C2D0D33","type":"f","value":1,"nodeType":"Float"},{"uuid":"E1B3665B-64E5-4CDA-851F-4563F9585EC5","type":"i","value":0,"nodeType":"Int"},{"uuid":"02D8FBFC-FA41-4A78-8D88-1B83816AE7BA","type":"f","value":30,"nodeType":"Float"},{"uuid":"7B09D587-4B64-4318-BA4C-96C2C783553E","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"136ED8F6-9E74-4C87-9898-A71DF8D605E6","type":"f","value":10,"nodeType":"Float"},{"uuid":"2936F7EE-15D4-4C02-A12F-F37D0A5B45FA","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"2A4B8D12-7ABE-4FD5-80B8-ABA78C5A5334","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"FAA469EE-C259-493B-9D94-239A3F518B3E","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9E0C2BEB-C953-4431-B694-9281BBCA80EE","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"BCE349C7-E856-43C9-A30F-45FF7760090D","project":false,"nodeType":"Texture"},{"uuid":"BCE349C7-E856-43C9-A30F-45FF7760090D","type":"v2","index":0,"nodeType":"UV"},{"uuid":"0C093174-D777-4492-A31D-0037D76D1A4E","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"86BE903A-335F-42EE-9DA2-7CFBCA90A470","project":false,"nodeType":"Texture"},{"uuid":"86BE903A-335F-42EE-9DA2-7CFBCA90A470","type":"v2","index":0,"nodeType":"UV"},{"uuid":"DC324FE5-969A-4FDE-B00C-7D23B7CD8826","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"BC9B7EDB-1277-4F74-B180-CDB69B49870F","type":"f","value":1,"nodeType":"Float"},{"uuid":"58795806-1728-4812-A084-0F64820DCAB7","type":"i","value":0,"nodeType":"Int"},{"uuid":"5CCC532F-EFF6-44EF-A971-8D754ABA3EBF","type":"f","value":50,"nodeType":"Float"},{"uuid":"F0378C32-0B3F-4108-BCF8-AF04D32714E5","type":"f","value":145,"nodeType":"Float"},{"uuid":"6772AFD5-AAEC-4265-BCC6-228E51BD9E43","type":"f","value":1,"nodeType":"Float"},{"uuid":"2E9005DA-36DD-4B02-BD3A-49C61295794D","type":"f","value":0,"nodeType":"Float"},{"uuid":"57FA09A7-16B3-4C61-9114-328FACAF4E38","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7F932620-1834-4ECF-B7EE-B7D33F0DEF83","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"A01F2480-86CB-41C0-AC96-355698A1F95A","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"A361C0DE-C12C-4CE5-92C5-0DD2C3580B55","type":"f","value":1,"nodeType":"Float"},{"uuid":"FB2A69F9-9392-42E6-BDD6-EE210A279B42","type":"i","value":1,"nodeType":"Int"},{"uuid":"E23929D5-7F8E-43FE-A8E1-0D9FD18C5509","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"9A62F3DB-7D37-4D6D-A7EA-50A27DD11B71","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C8DC14B7-1F77-4549-8088-1DBE9329503E","type":"f","value":1,"nodeType":"Float"},{"uuid":"10DB2C08-D38A-455F-829A-B056C8DBF6ED","type":"f","value":2,"nodeType":"Float"},{"uuid":"4E7C1A9C-C8AA-4E15-804E-22E9C06DE51C","type":"f","value":1,"nodeType":"Float"},{"uuid":"2966F6E0-A987-4928-971D-C463610E317A","type":"f","value":1,"nodeType":"Float"},{"uuid":"10CE9357-BCE1-464F-8F3B-7FD007C5161C","type":"i","value":2,"nodeType":"Int"},{"uuid":"F7C80620-4B1B-4BFE-A579-3B2D43542FF1","type":"phong","color":"0026F55C-B5EB-4E85-8CF4-1BDF9B2D4394","specular":"7B09D587-4B64-4318-BA4C-96C2C783553E","shininess":"02D8FBFC-FA41-4A78-8D88-1B83816AE7BA","shadingAlpha":"B72D38B9-BAD6-4C05-870C-A8985C2D0D33","shadingBlend":"E1B3665B-64E5-4CDA-851F-4563F9585EC5","afterColor":"8289BE31-70DA-4AFB-A7E3-123E1E4808CA","alpha":"69593447-80E9-4834-9E33-2CDC99CF7B24","nodeType":"Phong"},{"uuid":"0026F55C-B5EB-4E85-8CF4-1BDF9B2D4394","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"8289BE31-70DA-4AFB-A7E3-123E1E4808CA","type":"v3","a":"4C786B9B-ECDB-4492-973E-1B02C4F8E4F2","b":"F1A17835-221E-4038-B377-649713F25BA5","alpha":"1FE53AA2-B796-4D5C-BF77-2101E77B97A9","mode":"10CE9357-BCE1-464F-8F3B-7FD007C5161C","nodeType":"Blend"},{"uuid":"4C786B9B-ECDB-4492-973E-1B02C4F8E4F2","type":"v3","a":"75354582-C575-4C23-8729-98423B5796FF","b":"7DAD67CD-A1EE-453A-82D6-71B60D9FCC0A","alpha":"D0F2070B-F0B8-4C31-9C25-09D486820BA6","mode":"FB2A69F9-9392-42E6-BDD6-EE210A279B42","nodeType":"Blend"},{"uuid":"75354582-C575-4C23-8729-98423B5796FF","type":"v3","a":"21C0797C-7476-4C97-A17B-F77A5D13B743","b":"255B802B-90B7-46EC-8D65-9C21C555E82F","alpha":"10F82406-A104-4E79-94BF-9CB5A6DFBB1F","mode":"58795806-1728-4812-A084-0F64820DCAB7","nodeType":"Blend"},{"uuid":"21C0797C-7476-4C97-A17B-F77A5D13B743","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"255B802B-90B7-46EC-8D65-9C21C555E82F","type":"v3","thickness":"136ED8F6-9E74-4C87-9898-A71DF8D605E6","ior":"2936F7EE-15D4-4C02-A12F-F37D0A5B45FA","roughness":"2A4B8D12-7ABE-4FD5-80B8-ABA78C5A5334","alpha":"BC9B7EDB-1277-4F74-B180-CDB69B49870F","calpha":"g255B802B90B746EC8D659C21C555E82F_calpha","nodeType":"Transmission"},{"uuid":"10F82406-A104-4E79-94BF-9CB5A6DFBB1F","type":"f","src":"g255B802B90B746EC8D659C21C555E82F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7DAD67CD-A1EE-453A-82D6-71B60D9FCC0A","type":"v3","near":"5CCC532F-EFF6-44EF-A971-8D754ABA3EBF","far":"F0378C32-0B3F-4108-BCF8-AF04D32714E5","isVector":"6772AFD5-AAEC-4265-BCC6-228E51BD9E43","isWorldSpace":"2E9005DA-36DD-4B02-BD3A-49C61295794D","origin":"57FA09A7-16B3-4C61-9114-328FACAF4E38","colorA":"7F932620-1834-4ECF-B7EE-B7D33F0DEF83","colorB":"A01F2480-86CB-41C0-AC96-355698A1F95A","alpha":"A361C0DE-C12C-4CE5-92C5-0DD2C3580B55","nodeType":"Depth"},{"uuid":"D0F2070B-F0B8-4C31-9C25-09D486820BA6","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A361C0DE-C12C-4CE5-92C5-0DD2C3580B55"},"nodeType":"Expression"},{"uuid":"F1A17835-221E-4038-B377-649713F25BA5","type":"v3","color":"E23929D5-7F8E-43FE-A8E1-0D9FD18C5509","bias":"9A62F3DB-7D37-4D6D-A7EA-50A27DD11B71","scale":"C8DC14B7-1F77-4549-8088-1DBE9329503E","intensity":"10DB2C08-D38A-455F-829A-B056C8DBF6ED","factor":"4E7C1A9C-C8AA-4E15-804E-22E9C06DE51C","alpha":"2966F6E0-A987-4928-971D-C463610E317A","mode":"10CE9357-BCE1-464F-8F3B-7FD007C5161C","calpha":"gF1A17835221E4038B377649713F25BA5_calpha","nodeType":"Fresnel"},{"uuid":"1FE53AA2-B796-4D5C-BF77-2101E77B97A9","type":"f","src":"gF1A17835221E4038B377649713F25BA5_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"69593447-80E9-4834-9E33-2CDC99CF7B24","type":"f","value":1,"nodeType":"Float"},{"uuid":"40D126AC-5E42-46C1-967D-9F861B35E9C9","type":"f","value":1,"nodeType":"Float"},{"uuid":"45288A6D-F2B8-4ADD-9583-DB1A28DABFD3","type":"i","value":0,"nodeType":"Int"},{"uuid":"EC711B3F-AF1B-4C34-9FC6-7A24C3C3DCF2","type":"f","value":30,"nodeType":"Float"},{"uuid":"123417DF-794A-4511-9814-B8E2B13EC8AA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"2623ACDB-BA6B-473C-942E-6BA062B454AD","type":"f","value":10,"nodeType":"Float"},{"uuid":"DA19B5E0-E2CE-4D3C-9ED6-19D3FCE31411","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3FD3B75D-E686-403F-B592-9818D357E2CE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B108958E-3276-4959-991C-BF9B1A03784F","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"70487EEC-2D12-4DB5-99CD-61957872AE1C","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"9CF34647-73C7-4DE1-B5DB-737C407C04BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"7F825B81-9CC8-4772-928E-12BA176E48C4","type":"i","value":0,"nodeType":"Int"},{"uuid":"CDC69D18-7485-4E66-9484-FD14C58C0810","type":"f","value":50,"nodeType":"Float"},{"uuid":"37CCFE18-76CF-49B3-AFC8-83D3CC2AA006","type":"f","value":145,"nodeType":"Float"},{"uuid":"93E5AD1C-48D9-41BE-879A-E2A1B1847F46","type":"f","value":1,"nodeType":"Float"},{"uuid":"DEB8FB88-FF72-40B1-B554-4B43929D773B","type":"f","value":0,"nodeType":"Float"},{"uuid":"811B6EB9-82A4-42C3-9C4C-E154ABBF8A42","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"48C9DEB2-8443-4032-AED1-CF57A77E3C36","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"36AA677A-BB84-4211-A3DA-8D392C4FCCBE","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"84DACFC5-FFDC-4904-A3DF-98503D036BCB","type":"f","value":1,"nodeType":"Float"},{"uuid":"2217950A-6582-40F2-935B-B21155E35948","type":"i","value":1,"nodeType":"Int"},{"uuid":"4589D8FA-41B6-46F6-A678-B0AA811F8B9C","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"50765C1E-023C-4E83-8065-5B7D73CCD9C7","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"32B609A3-8996-4420-9AEA-9ACE9150C8A7","type":"f","value":1,"nodeType":"Float"},{"uuid":"8576A92B-4D26-4BAA-B7D0-F19A2DCCE926","type":"f","value":2,"nodeType":"Float"},{"uuid":"545E7896-FD3A-4DCF-B2D9-02E02D906439","type":"f","value":1,"nodeType":"Float"},{"uuid":"743A80E3-32FF-4843-A267-7851DAE6BA7F","type":"f","value":1,"nodeType":"Float"},{"uuid":"FFDE1251-3C12-4B30-ACE7-3ED7E4DFAF15","type":"i","value":2,"nodeType":"Int"},{"uuid":"20A7F308-3DDD-46D1-8C98-41DF14802304","type":"f","value":1,"nodeType":"Float"},{"uuid":"2123BD4B-018E-444F-AA7D-019135AC0AC5","type":"i","value":0,"nodeType":"Int"},{"uuid":"A506A106-E4F7-4A31-A981-75A2125CBE9A","type":"f","value":30,"nodeType":"Float"},{"uuid":"DB1CCD56-7E03-4C73-A7E2-3876D3E2E86C","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"F43EBB60-1DCA-4902-A223-BDD325A7DC43","type":"f","value":10,"nodeType":"Float"},{"uuid":"5341B439-B76B-43A6-B73B-F66344FBF767","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"AB0340D2-6C2B-4803-A1C8-B2C072EEE4FA","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"261399A9-7CC2-426D-A2D4-E0B59E239217","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"A78C37F6-6E96-4619-B858-F37424A27E7F","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"A928765F-ADB5-4BF7-9A82-D4857590E749","type":"f","value":1,"nodeType":"Float"},{"uuid":"019A26CD-62E2-4CB5-83C0-497A18AF9843","type":"i","value":0,"nodeType":"Int"},{"uuid":"D0310BD1-0F34-439A-BAA9-C2B6538B7386","type":"f","value":50,"nodeType":"Float"},{"uuid":"2AF726A5-7A81-4B9E-94D0-317177C297D3","type":"f","value":145,"nodeType":"Float"},{"uuid":"0EC62FA5-96E6-4B3D-8A35-631DA096C770","type":"f","value":1,"nodeType":"Float"},{"uuid":"5A32CD40-2C53-47A6-B7A8-14FA550B88F7","type":"f","value":0,"nodeType":"Float"},{"uuid":"CDA783EA-6643-41AE-83E9-38C6600A3358","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7C6B4220-6988-4F4C-8968-0868755FB69F","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"867666B4-9EE8-4A64-9D54-88FFCE9E1CFC","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"408C1A23-2E05-4D48-ADD4-E51DA0570885","type":"f","value":1,"nodeType":"Float"},{"uuid":"84C7615A-D582-4FB4-A829-663AEBD258F8","type":"i","value":1,"nodeType":"Int"},{"uuid":"3A3CA2DF-1E65-49A8-B98A-540BB081A87B","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"FEFE870F-7E1E-4D4B-ABCA-615102E6431B","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DF4D77BA-C3BC-42C3-80B6-6A199B840D94","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E6E3C8A-077B-489D-90A2-AC7FB3A22EB8","type":"f","value":2,"nodeType":"Float"},{"uuid":"50A3C46F-73E5-4836-8635-6C85FC20CECD","type":"f","value":1,"nodeType":"Float"},{"uuid":"11A0B441-C9DA-41E9-A0B4-4AF85FC8B23E","type":"f","value":1,"nodeType":"Float"},{"uuid":"5A51776B-93C6-481F-B2AB-4EED9D05443C","type":"i","value":2,"nodeType":"Int"},{"uuid":"3D7F6815-4FFC-4218-A476-8B3F4B04A202","type":"f","value":1,"nodeType":"Float"},{"uuid":"DE2C4C52-5FA5-42E0-AB9F-364714C606AD","type":"i","value":0,"nodeType":"Int"},{"uuid":"5B673DE8-7261-4B7F-A8B9-6A6362C1C7AD","type":"f","value":30,"nodeType":"Float"},{"uuid":"CBF9062B-8E65-4441-AE98-EA1DE8BBC7A8","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"46795E16-3183-4F26-AF91-57E852079967","type":"f","value":10,"nodeType":"Float"},{"uuid":"95B73345-A423-4CF0-9AC4-E9F84381B9AA","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A8830086-E26D-4BDD-9A86-92563BCA6096","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CF0BE228-4434-449C-851A-25967914C536","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"71ACCB99-FD7D-4E51-9CFE-6EC63BCC418A","type":"v4","value":"D01EF7DA-32FA-4650-ACE9-7B7C4A0D2689","uv":"A8663918-9993-4A5E-A4DF-54F4E396F5D8","project":false,"nodeType":"Texture"},{"uuid":"A8663918-9993-4A5E-A4DF-54F4E396F5D8","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A8523778-EBF0-46D6-9C86-73E062C8E007","type":"v4","value":"9D55E33B-E6C6-42C1-9522-1AB1E5918B83","uv":"A54557F6-5050-4BB5-857F-6CA0732D81AC","project":false,"nodeType":"Texture"},{"uuid":"A54557F6-5050-4BB5-857F-6CA0732D81AC","type":"v2","index":0,"nodeType":"UV"},{"uuid":"8188EE4D-0645-4462-BC00-6971C9A67A76","type":"v2","x":0.5231755424063116,"y":1,"nodeType":"Vector2"},{"uuid":"EB7938F1-8C4B-4641-8DF7-15578010B956","type":"f","value":1,"nodeType":"Float"},{"uuid":"A577BBA5-0ED0-4396-BED7-CFECFD413384","type":"i","value":0,"nodeType":"Int"},{"uuid":"4BA9A9B8-DA8C-44B6-9B49-D5C026AB45E5","type":"f","value":50,"nodeType":"Float"},{"uuid":"DCE90ECB-27FF-4BBD-BF82-7A09F3DC3CCD","type":"f","value":145,"nodeType":"Float"},{"uuid":"B634289F-3EEE-444D-8AE2-CAB73F3472E5","type":"f","value":1,"nodeType":"Float"},{"uuid":"B4491288-8877-42A9-A591-05B37B660927","type":"f","value":0,"nodeType":"Float"},{"uuid":"B737DF4F-0229-45E9-8A54-8F83893E422E","type":"v3","x":-63,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"7E1F9D12-83AE-427E-A950-BE181F969269","type":"c","r":0.8745098039215686,"g":0.8980392156862745,"b":1,"value":14673407,"nodeType":"Color"},{"uuid":"513EF059-9236-4079-A973-C2D5D3B96A45","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"84D9AB77-BA64-4FF2-92B6-C3CCF14366C7","type":"f","value":1,"nodeType":"Float"},{"uuid":"9D5F85C4-A1BC-4152-B6D7-4D0DCC30D539","type":"i","value":1,"nodeType":"Int"},{"uuid":"6D1EBD4D-98B4-48EF-9F62-B292FB014B80","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"270B3C81-CFD2-4269-8678-EACB8AC78467","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"05E082AE-79E3-4374-ACF7-2E6C51BDE0B0","type":"f","value":1,"nodeType":"Float"},{"uuid":"2192F4CD-36A2-4B66-8424-3EE9CC3F3569","type":"f","value":2,"nodeType":"Float"},{"uuid":"9E169CCF-EB06-41D0-B770-BF24A95E58A1","type":"f","value":1,"nodeType":"Float"},{"uuid":"D05BA06D-D0CA-4CA4-AF9F-1D518ED2E2B2","type":"f","value":1,"nodeType":"Float"},{"uuid":"686A55D7-998E-4728-80BA-7ADF0A3F9572","type":"i","value":2,"nodeType":"Int"},{"uuid":"FC9F690C-DA3B-42DA-90F2-FC9E28C7ACD0","type":"phong","color":"051D7577-F4C2-4560-B9EB-F88A31404DF3","specular":"CBF9062B-8E65-4441-AE98-EA1DE8BBC7A8","shininess":"5B673DE8-7261-4B7F-A8B9-6A6362C1C7AD","shadingAlpha":"3D7F6815-4FFC-4218-A476-8B3F4B04A202","shadingBlend":"DE2C4C52-5FA5-42E0-AB9F-364714C606AD","afterColor":"B515ABF6-224E-46C6-8294-F5118BAB3C12","alpha":"1AD60A5C-06E6-428A-A78B-9945F919F532","nodeType":"Phong"},{"uuid":"051D7577-F4C2-4560-B9EB-F88A31404DF3","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"B515ABF6-224E-46C6-8294-F5118BAB3C12","type":"v3","a":"AA9FDAFD-4266-450D-B8D9-2A0C40208521","b":"3BCD5B30-CF12-4525-B772-FE4E00D6CC6B","alpha":"DC70C61B-90FF-4F92-B0EF-0D114261C122","mode":"686A55D7-998E-4728-80BA-7ADF0A3F9572","nodeType":"Blend"},{"uuid":"AA9FDAFD-4266-450D-B8D9-2A0C40208521","type":"v3","a":"B6612214-6512-4D33-BC2D-ABF936E4BAD1","b":"A2A1A920-4CCB-4C41-AE57-929648936E73","alpha":"2ABEE521-A0FF-4AC8-BE0F-E73672787DC7","mode":"9D5F85C4-A1BC-4152-B6D7-4D0DCC30D539","nodeType":"Blend"},{"uuid":"B6612214-6512-4D33-BC2D-ABF936E4BAD1","type":"v3","a":"3814F21C-39EA-418E-8FC6-AADA8286BE15","b":"D4DC3C6B-8336-427F-BC79-16EA2491E107","alpha":"A5291C3F-E5BE-464A-AE24-BE42787C0B34","mode":"A577BBA5-0ED0-4396-BED7-CFECFD413384","nodeType":"Blend"},{"uuid":"3814F21C-39EA-418E-8FC6-AADA8286BE15","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"D4DC3C6B-8336-427F-BC79-16EA2491E107","type":"v3","thickness":"46795E16-3183-4F26-AF91-57E852079967","ior":"95B73345-A423-4CF0-9AC4-E9F84381B9AA","roughness":"A8830086-E26D-4BDD-9A86-92563BCA6096","alpha":"EB7938F1-8C4B-4641-8DF7-15578010B956","calpha":"gD4DC3C6B8336427FBC7916EA2491E107_calpha","nodeType":"Transmission"},{"uuid":"A5291C3F-E5BE-464A-AE24-BE42787C0B34","type":"f","src":"gD4DC3C6B8336427FBC7916EA2491E107_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A2A1A920-4CCB-4C41-AE57-929648936E73","type":"v3","near":"4BA9A9B8-DA8C-44B6-9B49-D5C026AB45E5","far":"DCE90ECB-27FF-4BBD-BF82-7A09F3DC3CCD","isVector":"B634289F-3EEE-444D-8AE2-CAB73F3472E5","isWorldSpace":"B4491288-8877-42A9-A591-05B37B660927","origin":"B737DF4F-0229-45E9-8A54-8F83893E422E","colorA":"7E1F9D12-83AE-427E-A950-BE181F969269","colorB":"513EF059-9236-4079-A973-C2D5D3B96A45","alpha":"84D9AB77-BA64-4FF2-92B6-C3CCF14366C7","nodeType":"Depth"},{"uuid":"2ABEE521-A0FF-4AC8-BE0F-E73672787DC7","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"84D9AB77-BA64-4FF2-92B6-C3CCF14366C7"},"nodeType":"Expression"},{"uuid":"3BCD5B30-CF12-4525-B772-FE4E00D6CC6B","type":"v3","color":"6D1EBD4D-98B4-48EF-9F62-B292FB014B80","bias":"270B3C81-CFD2-4269-8678-EACB8AC78467","scale":"05E082AE-79E3-4374-ACF7-2E6C51BDE0B0","intensity":"2192F4CD-36A2-4B66-8424-3EE9CC3F3569","factor":"9E169CCF-EB06-41D0-B770-BF24A95E58A1","alpha":"D05BA06D-D0CA-4CA4-AF9F-1D518ED2E2B2","mode":"686A55D7-998E-4728-80BA-7ADF0A3F9572","calpha":"g3BCD5B30CF124525B772FE4E00D6CC6B_calpha","nodeType":"Fresnel"},{"uuid":"DC70C61B-90FF-4F92-B0EF-0D114261C122","type":"f","src":"g3BCD5B30CF124525B772FE4E00D6CC6B_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1AD60A5C-06E6-428A-A78B-9945F919F532","type":"f","value":1,"nodeType":"Float"},{"uuid":"EFD43271-BEA9-4BD9-8AEA-578D0C0D5DD2","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"4773F5FC-3010-4136-A238-B3BBCBD9A768","nodeType":"Color"},{"uuid":"4773F5FC-3010-4136-A238-B3BBCBD9A768","type":"f","value":1,"nodeType":"Float"},{"uuid":"BF14F38C-23A9-4B75-9C73-E9778C17A2C4","type":"f","value":1,"nodeType":"Float"},{"uuid":"4E80FB94-D6CC-4C3B-875B-606C49F72DF2","type":"i","value":0,"nodeType":"Int"},{"uuid":"95234B55-57F6-488B-91AE-00D7AC102C0A","type":"f","value":1,"nodeType":"Float"},{"uuid":"BCAA5083-1D54-4A86-9565-F78F6A970ABC","type":"i","value":0,"nodeType":"Int"},{"uuid":"142984B9-3A3C-4718-A746-83923DC64595","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"3766481C-BB16-4FD7-876D-CB48088BE91B","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"97DFCF98-3A4B-451E-A945-0C32B04CB474","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"2F83A0DE-B118-40F3-B370-C3231938101C","type":"f","value":1,"nodeType":"Float"},{"uuid":"7DA90381-06A7-431E-A44A-E7ED134229FA","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"BAFDB3CA-6985-4385-8EED-588811ED1A85","type":"f","value":1,"nodeType":"Float"},{"uuid":"A46DC0DF-51F3-44F3-8653-F0CF6A1CA509","type":"f","value":1,"nodeType":"Float"},{"uuid":"DDD7CB28-AE3A-4B76-A13C-C84FD95DC6D4","type":"i","value":0,"nodeType":"Int"},{"uuid":"09346473-4835-4A36-BC31-00DBA93AA0B8","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"F8FD649F-0D21-4DA0-B35F-EFC57210C05C","nodeType":"Color"},{"uuid":"F8FD649F-0D21-4DA0-B35F-EFC57210C05C","type":"f","value":1,"nodeType":"Float"},{"uuid":"2180CE89-3D88-44CA-B1BF-BCDA20910080","type":"f","value":1,"nodeType":"Float"},{"uuid":"93323213-3038-418B-B2B0-3DA19046AD62","type":"i","value":0,"nodeType":"Int"},{"uuid":"171EB1CF-1B32-40A0-840C-4B6DB362AB97","type":"f","value":1,"nodeType":"Float"},{"uuid":"24AB8168-30C6-45E7-9FB5-EB00CBBBA802","type":"i","value":0,"nodeType":"Int"},{"uuid":"2FC1579A-B9D3-4144-A4CA-91ACF603CA13","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"DBA1F452-B066-4D19-93BB-1AE2D31CE192","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"54AF5CDA-B475-4A92-B6C5-51F3A1E98AB0","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4A4715E6-4629-40F5-80AA-4473081AD482","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE94338E-DB95-4FE2-937F-021A6018057A","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"358F56FB-24B7-4113-BB43-CE759FB7F9B6","type":"f","value":1,"nodeType":"Float"},{"uuid":"5057086B-C4B2-4DBF-A8ED-7E608434249D","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D5E76E2-ECE9-4689-970A-8900D30F8A63","type":"i","value":0,"nodeType":"Int"},{"uuid":"EBDFB563-B0C4-4D3E-976F-A4B12691AE1C","type":"c","r":0.8901960784313725,"g":0.9294117647058824,"b":0.9764705882352941,"value":14937593,"alpha":"AB0233FB-D949-440B-A162-38E1261DB179","nodeType":"Color"},{"uuid":"AB0233FB-D949-440B-A162-38E1261DB179","type":"f","value":1,"nodeType":"Float"},{"uuid":"B8F83C19-BB00-4669-A63D-A3E320C5B61A","type":"i","value":0,"nodeType":"Int"},{"uuid":"CF52EB2B-8678-4C54-8696-AB1C2BB9D4DE","type":"f","value":1,"nodeType":"Float"},{"uuid":"12510A4B-CD74-4BF2-93D8-F5930E5E5966","type":"i","value":0,"nodeType":"Int"},{"uuid":"1E25A972-E32D-47ED-BB05-CB425707E304","type":"c","r":0.16470588235294117,"g":0.16470588235294117,"b":0.16470588235294117,"value":2763306,"nodeType":"Color"},{"uuid":"2EC5BDD1-FD34-4DAB-B62C-5921B388A3D0","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"C72AF895-255B-49D6-B658-5B785DB3CF00","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6896084C-9B66-4101-B3CD-99B4109A30BD","type":"f","value":1,"nodeType":"Float"},{"uuid":"23766118-FA79-4958-9844-3A6CCC331BD2","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"3E1D3E21-0FAF-4D74-9855-9499EAB42798","type":"f","value":1,"nodeType":"Float"},{"uuid":"D741EEED-0164-4D74-A0D9-6469483AC439","type":"f","value":1,"nodeType":"Float"},{"uuid":"FD483E2E-E5EA-4764-A1F3-C0DBB9A53162","type":"i","value":0,"nodeType":"Int"},{"uuid":"50E2DE8D-473B-4D60-8826-05E93E074A16","type":"lambert","color":"EBDFB563-B0C4-4D3E-976F-A4B12691AE1C","emissiveIntensity":"6B01DE6E-843B-43D0-8D7F-FC59CBD73B6C","shadingAlpha":"CF52EB2B-8678-4C54-8696-AB1C2BB9D4DE","shadingBlend":"12510A4B-CD74-4BF2-93D8-F5930E5E5966","afterColor":"4F5B488D-7F79-4E17-AD77-934C1CC0D155","alpha":"250D7436-2DE6-464E-B578-2C228CFD27AA","emissive":"1E25A972-E32D-47ED-BB05-CB425707E304","nodeType":"Lambert"},{"uuid":"6B01DE6E-843B-43D0-8D7F-FC59CBD73B6C","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F5B488D-7F79-4E17-AD77-934C1CC0D155","type":"v3","a":"CD101E6C-8F09-464D-9DAE-6D0FCEA4F525","b":"5D775B17-B4CD-41AF-90FA-3F9087BF2FFB","alpha":"30DF6028-1213-425E-B318-BD4F4FA02536","mode":"FD483E2E-E5EA-4764-A1F3-C0DBB9A53162","nodeType":"Blend"},{"uuid":"CD101E6C-8F09-464D-9DAE-6D0FCEA4F525","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5D775B17-B4CD-41AF-90FA-3F9087BF2FFB","type":"v3","color":"2EC5BDD1-FD34-4DAB-B62C-5921B388A3D0","bias":"C72AF895-255B-49D6-B658-5B785DB3CF00","scale":"6896084C-9B66-4101-B3CD-99B4109A30BD","intensity":"23766118-FA79-4958-9844-3A6CCC331BD2","factor":"3E1D3E21-0FAF-4D74-9855-9499EAB42798","alpha":"D741EEED-0164-4D74-A0D9-6469483AC439","mode":"FD483E2E-E5EA-4764-A1F3-C0DBB9A53162","calpha":"g5D775B17B4CD41AF90FA3F9087BF2FFB_calpha","nodeType":"Fresnel"},{"uuid":"30DF6028-1213-425E-B318-BD4F4FA02536","type":"f","src":"g5D775B17B4CD41AF90FA3F9087BF2FFB_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"250D7436-2DE6-464E-B578-2C228CFD27AA","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[411.6750788643533,181],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[2028,1061],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/value_dark/index.html b/site/spline/design/value_dark/index.html deleted file mode 100644 index 776fb6703..000000000 --- a/site/spline/design/value_dark/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/value_dark/runtime.js b/site/spline/design/value_dark/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/value_dark/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=h*v*c-m*d*c+m*l*f-a*v*f-h*l*g+a*d*g,x=p*d*c-u*v*c-p*l*f+o*v*f+u*l*g-o*d*g,b=u*m*c-p*h*c+p*a*f-o*m*f-u*a*g+o*h*g,w=p*h*l-u*m*l-p*a*d+o*m*d+u*a*v-o*h*v,_=t*y+n*x+i*b+s*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/_;return e[0]=y*S,e[1]=(m*d*s-h*v*s-m*i*f+n*v*f+h*i*g-n*d*g)*S,e[2]=(a*v*s-m*l*s+m*i*c-n*v*c-a*i*g+n*l*g)*S,e[3]=(h*l*s-a*d*s-h*i*c+n*d*c+a*i*f-n*l*f)*S,e[4]=x*S,e[5]=(u*v*s-p*d*s+p*i*f-t*v*f-u*i*g+t*d*g)*S,e[6]=(p*l*s-o*v*s-p*i*c+t*v*c+o*i*g-t*l*g)*S,e[7]=(o*d*s-u*l*s+u*i*c-t*d*c-o*i*f+t*l*f)*S,e[8]=b*S,e[9]=(p*h*s-u*m*s-p*n*f+t*m*f+u*n*g-t*h*g)*S,e[10]=(o*m*s-p*a*s+p*n*c-t*m*c-o*n*g+t*a*g)*S,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*f-t*a*f)*S,e[12]=w*S,e[13]=(u*m*i-p*h*i+p*n*d-t*m*d-u*n*v+t*h*v)*S,e[14]=(p*a*i-o*m*i-p*n*l+t*m*l+o*n*v-t*a*v)*S,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*d+t*a*d)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYH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I0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/value_dark/scene.json b/site/spline/design/value_dark/scene.json deleted file mode 100644 index 76e4b4688..000000000 --- a/site/spline/design/value_dark/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"950B644B-0874-4AB4-8E13-C75872A15555","objectType":"Mesh3D","name":"Cube","matrix":[0.9647988483708523,0.2501733769353302,0.08109539848256787,0,2.498001805406605e-16,0.30836049114984276,-0.9512695766699522,0,-0.26298893927743905,0.9177837920613917,0.29750584674443664,0,-132.1635384266761,-51.1373856647624,-495.86793449695807,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D91BDAE0-CA29-4D50-B8F0-7F8C28F2F6C8","selectedState":0,"states":["BC58F3BD-3CD5-4903-BCE1-C32002D556A2","71CFA7D6-3621-4E22-B4C1-AA0E70477794"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":10000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"950B644B-0874-4AB4-8E13-C75872A15555","state":"71CFA7D6-3621-4E22-B4C1-AA0E70477794"}]}]},"geometry":"5274D67D-12C1-4D74-8411-7ECB575B0313","material":"03E2FAA7-A10E-47A9-BE71-FDB1627E1729"},{"uuid":"C86B2A7B-3B2F-4DE3-93C3-9F31FA3AA6AF","objectType":"Mesh3D","name":"Pyramid","matrix":[0.921222240059181,0.3129380918188313,-0.23112623197968907,0,-0.15216225389559598,0.8366046839787403,0.5262501793199195,0,0.3580450152002586,-0.44962468063221667,0.8183162063998398,0,29.837735321981295,174.88806212317647,343.15660199269524,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"16A2F995-29A3-4EAE-8C55-D6BD90F7B6DB","selectedState":0,"states":["9F8D0167-E3AC-4D02-AC9B-AFF3DCBDED1F","3C323F54-4B75-4F4C-B824-5D44E6A2C87B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"C86B2A7B-3B2F-4DE3-93C3-9F31FA3AA6AF","state":"3C323F54-4B75-4F4C-B824-5D44E6A2C87B"}]}]},"geometry":"1F9B7F64-562E-48B5-AA8D-AB049BCF5A7F","material":"F1D638D4-2839-4455-B7D1-BC1AA8EEC31B"},{"uuid":"9A1BE607-5F7C-4A48-A391-2F9D0D53C052","objectType":"Mesh3D","name":"Sphere","matrix":[0.7102640395405213,0.0018619098245032384,-0.7039328998046519,0,-0.014548138389689462,0.9998217460169199,-0.012034444776121977,0,0.7037850139104808,0.018788546603729236,0.7101645194682319,0,-333.61962033438857,62.4305143567372,-274.8879842740688,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A6F8889C-7FF0-418E-87C4-2671CD4AF81C","selectedState":0,"states":["14EA539B-8A15-4CC1-893E-755FC9F429FB","DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"9A1BE607-5F7C-4A48-A391-2F9D0D53C052","state":"DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5"}]}]},"geometry":"B93FB9F3-1D56-4D51-A5D0-2C905080D2E9","material":"388208C0-10EB-4CBA-A79E-986934045EC9"},{"uuid":"44B84140-AEF9-4DCA-B7C8-6596C10F4DBD","objectType":"EmptyObject","name":"Empty Object","matrix":[1.0000000000000187,-1.2246467991473764e-16,2.4492935982947523e-16,0,1.224646799147353e-16,1,1.2246467991473535e-16,0,-2.4492935982947523e-16,-1.224646799147376e-16,1.0000000000000187,0,8.228765814177173e-16,209.99207679614122,8.228765814177175e-16,1],"layers":1,"children":[{"uuid":"DAEA5101-78CB-4EEB-8C78-098C5E5B73C8","objectType":"Mesh3D","name":"Cylinder 5","matrix":[0.9063077870366493,-0.4226182617406996,0,0,0.42261826174069905,0.9063077870366482,0,0,0,0,1,0,0,203.27277959150527,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-203.27277959150527,0,1],"interaction":{"uuid":"903A6D0C-5FF4-46F4-A91C-5D8D0FED70F1"},"geometry":"9294E6E3-BE82-4FDE-8D84-9B3B9D0873AA","material":"485A21AB-FFDF-4F14-A946-85CAD0F1F036"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"717F2892-231C-463E-A420-52DE8C0266A6","selectedState":0,"states":["28C6E18F-BD7B-413E-B4ED-F42B470C1036","60958BAD-DABC-41F6-B777-52A02438E644"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"44B84140-AEF9-4DCA-B7C8-6596C10F4DBD","state":"60958BAD-DABC-41F6-B777-52A02438E644"}]}]},"enableHelper":true},{"uuid":"E3AFEE9D-EDBC-4D54-86F7-76B07F6EDAE0","objectType":"EmptyObject","name":"Empty Object 2","matrix":[1.0000000000000264,-1.2246467991473855e-16,-7.498798913309486e-33,0,1.2246467991473532e-16,1,1.2246467991473532e-16,0,-7.498798913309486e-33,-1.2246467991473855e-16,1.0000000000000264,0,0,153.05834378711734,0,1],"layers":1,"children":[{"uuid":"CD4B4889-F6DC-4394-87D2-E5594286D1EC","objectType":"Mesh3D","name":"Cylinder 6","matrix":[0.9848077530122072,0.17364817766693055,0,0,-0.17364817766693036,0.9848077530122061,0,0,0,0,1.0000000000000027,0,0,153.05834378711734,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-153.05834378711734,0,1],"interaction":{"uuid":"C801B051-9433-4377-9522-842DA765958E"},"geometry":"15CDDD19-C630-4301-A0D3-7344F369BBBF","material":"34F893C2-E688-43C9-97FA-C62067BE65DD"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A4871482-3E26-457D-8E3F-41187D48225A","selectedState":0,"states":["307C44B4-30D0-4E0B-B608-EBE4C807AA0B","D31CB886-58BE-48A1-A431-1DF575DCAC6E"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"E3AFEE9D-EDBC-4D54-86F7-76B07F6EDAE0","state":"D31CB886-58BE-48A1-A431-1DF575DCAC6E"}]}]},"enableHelper":true},{"uuid":"9B504F2D-F8FA-438A-97FD-2F4C12D25CCF","objectType":"EmptyObject","name":"Empty Object 3","matrix":[1.000000000000036,-1.2246467991473976e-16,2.4492935982947947e-16,0,1.224646799147353e-16,1,1.2246467991473535e-16,0,-2.4492935982947947e-16,-1.224646799147397e-16,1.000000000000036,0,0,115.09081537009483,0,1],"layers":1,"children":[{"uuid":"2B6095AC-DDB5-4792-AA4A-012696E82814","objectType":"Mesh3D","name":"Cylinder 4","matrix":[0.9848077530122067,-0.1736481776669303,0,0,0.17364817766693014,0.9848077530122058,0,0,0,0,1.0000000000000027,0,0,115.09081537009482,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-115.09081537009483,0,1],"interaction":{"uuid":"45093491-6F28-40B2-85F3-DAE0EA9345A7"},"geometry":"A9EE3835-2150-421D-A9F6-9E7DB6177DBB","material":"F65FD184-5290-4DB7-B156-366B75D65DE7"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"94153E49-39FE-43BD-A82B-DE30BE8251D2","selectedState":0,"states":["83EC61E5-EF47-4AEB-BA00-B0133D85C366","25749767-B480-4A5B-9EAA-2B33D9EF0B84"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"9B504F2D-F8FA-438A-97FD-2F4C12D25CCF","state":"25749767-B480-4A5B-9EAA-2B33D9EF0B84"}]}]},"enableHelper":true},{"uuid":"258ECED6-2FB9-4861-89DF-7012F5101209","objectType":"Mesh3D","name":"Cylinder 3","matrix":[0.939692620785907,0.3420201433256685,0,0,-0.3420201433256685,0.939692620785907,0,0,0,0,1,0,-4.079219866531334e-15,129.78775382679308,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A57F85C9-6398-4DF1-A5C1-DACBC30A085B","selectedState":0,"states":["9C36471C-D54D-40ED-B233-7308B35AE9BF","78C26B35-2E45-4B25-BBC0-902DC72A3D6B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":3},"object":"258ECED6-2FB9-4861-89DF-7012F5101209","state":"78C26B35-2E45-4B25-BBC0-902DC72A3D6B"}]}]},"geometry":"C04F3942-5D98-4AD6-A3E7-ED464E0855B7","material":"C0D428BA-8004-4A1B-8523-4A63F5E83102"},{"uuid":"4B96348E-A91F-4323-8817-5B291CD09604","objectType":"Mesh3D","name":"Cylinder 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,12.599699723028607,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B662A976-6DE3-49C5-B575-B36820A82CBD"},"geometry":"C687EB7E-087A-44CC-A5FD-F0404363FE2D","material":"ACBDE249-37DE-4939-8796-FE13AEB1B5FD"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.7198070142279037,-2.7755575615628914e-17,-0.694174230484185,0,-0.2980938893618321,0.903103811757994,-0.309101178117,0,0.6269113935744398,0.4294222923745128,0.6500604582793605,0,92.78058679147841,521.849837080967,1104.1139798336742,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":999.9999999999989,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.5987369392383788,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[0.1411764705882353,0.1411764705882353,0.1411764705882353],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"5274D67D-12C1-4D74-8411-7ECB575B0313","userData":{"parameters":{"width":30,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":30,"depth":30},"type":"CubeGeometry"}},{"uuid":"1F9B7F64-562E-48B5-AA8D-AB049BCF5A7F","userData":{"parameters":{"width":61,"radialSegments":4,"heightSegments":1,"cornerRadius":8,"cornerSegments":8,"openEnded":false,"height":45,"depth":61},"type":"PyramidGeometry"}},{"uuid":"B93FB9F3-1D56-4D51-A5D0-2C905080D2E9","userData":{"parameters":{"width":38,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":38,"depth":38},"type":"SphereGeometry"}},{"uuid":"9294E6E3-BE82-4FDE-8D84-9B3B9D0873AA","userData":{"parameters":{"width":130,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.9,"height":24,"depth":130,"radiusTop":65,"radiusBottom":65},"type":"CylinderGeometry"}},{"uuid":"15CDDD19-C630-4301-A0D3-7344F369BBBF","userData":{"parameters":{"width":200,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.92,"height":28,"depth":200,"radiusTop":100,"radiusBottom":100},"type":"CylinderGeometry"}},{"uuid":"A9EE3835-2150-421D-A9F6-9E7DB6177DBB","userData":{"parameters":{"width":290,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.92,"height":28,"depth":290,"radiusTop":145,"radiusBottom":145},"type":"CylinderGeometry"}},{"uuid":"C04F3942-5D98-4AD6-A3E7-ED464E0855B7","userData":{"parameters":{"width":420,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":350,"cornerRadius":4,"cornerSegments":8,"hollow":0.93,"height":36,"depth":420,"radiusTop":210,"radiusBottom":210},"type":"CylinderGeometry"}},{"uuid":"C687EB7E-087A-44CC-A5FD-F0404363FE2D","userData":{"parameters":{"width":76,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0,"height":400,"depth":76,"radiusTop":38,"radiusBottom":38},"type":"CylinderGeometry"}}],"materials":[{"uuid":"03E2FAA7-A10E-47A9-BE71-FDB1627E1729","type":"ShaderMaterial","reflectivity":{"uuid":"FA202678-6ED4-43E7-89C5-005A0D6DD93B","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"40645A36-E0F9-4977-A09D-A4F1E4032774","f0_alpha":"58AEFAA9-E19E-43AC-8F6B-3A8DA7A1E9F5","f0_mode":"C6FFEB39-9203-4529-B0E1-D7C810815369"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F85279E3-EC88-45B6-B3C5-BACFA184EE29","f1_mode":"550FFE4C-542B-4CCF-9A73-D04EDA5012EC","f1_roughness":"223463DA-CAEC-45F2-B5DA-1A12C0623180","f1_metalness":"6ACFA727-6F87-4810-B473-00AD2A02B3A8","f1_reflectivity":"FA202678-6ED4-43E7-89C5-005A0D6DD93B"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"CEC716B8-CEB7-4AB1-84C3-04CBD59A6910","fragment":"CEC716B8-CEB7-4AB1-84C3-04CBD59A6910"},{"uuid":"F1D638D4-2839-4455-B7D1-BC1AA8EEC31B","type":"ShaderMaterial","reflectivity":{"uuid":"493ECAB3-6B7B-4A28-BFEC-F3FB46979F70","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"39EDD61A-D487-4B4B-8572-1413BF2E1938","f0_alpha":"57588C00-B1B0-4C60-8FA6-5907608C4557","f0_mode":"BDD6053B-94F8-4366-BEC9-60E2D0D676EC"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5A86B73D-BF9D-4843-AF8E-B309AA40EB1F","f1_mode":"532AA33F-A032-4B70-B6A8-EA3473E0FB7D","f1_roughness":"4DB029D8-51BE-43F2-9F3F-14FA43DEDC29","f1_metalness":"A2EFBF02-9D71-40E4-BCC1-BD38EDC5362A","f1_reflectivity":"493ECAB3-6B7B-4A28-BFEC-F3FB46979F70"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"F7D09E41-AFB6-41D3-9145-873A637A1EDB","fragment":"F7D09E41-AFB6-41D3-9145-873A637A1EDB"},{"uuid":"388208C0-10EB-4CBA-A79E-986934045EC9","type":"ShaderMaterial","reflectivity":{"uuid":"6A5F01EE-FF6B-4040-BDC9-0310FB9BD7AE","type":"f","value":0.5,"nodeType":"Float"},"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhysicalMaterial","category":"Physical","nodeType":"StandardNodeMaterial","layers":{"id":3,"uuid":"F1BE0A0C-A832-49A2-888F-0C2AE0FDA578","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"36F2DFDD-321A-45F4-BF1D-989630CEA17A","f0_alpha":"15D667E7-7E98-4CA2-ADEB-C1D2892B3FB5","f0_mode":"40EF97E6-8E4E-4E17-80B6-E5B1488D4C02"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7B4D5FF9-DB80-4052-B406-F4B1489CBDC7","f1_mode":"55CCF909-8D75-480D-83B5-D7A6DE759344","f1_roughness":"922ADD5C-0787-474D-BBC7-4A8F853F5C00","f1_metalness":"BC88F3D1-6631-4562-B3CD-880A725A2F51","f1_reflectivity":"6A5F01EE-FF6B-4040-BDC9-0310FB9BD7AE"}}}}},"glslVersion":null,"defines":{"STANDARD":1},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"E5B68283-F195-44E0-91B2-E46AEAEE0FFF","fragment":"E5B68283-F195-44E0-91B2-E46AEAEE0FFF"},{"uuid":"485A21AB-FFDF-4F14-A946-85CAD0F1F036","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"E64A571D-42FE-4197-A36B-833B17F679A7","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"922ACA10-2A1F-4F15-93D6-D56C4838685D","f1_mode":"28897FA5-CB1E-4D9E-879D-09FF627C0250","f1_shininess":"F586F0FB-346B-4252-B546-4CB27E864DDF","f1_specular":"CA9D6688-2953-46C2-8395-8D8B111A7541"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"02B04CCB-B154-4DD3-8B06-B81D1DD5DB41","f2_ior":"EA044829-C4D1-4F8A-BB02-83FDDF408618","f2_roughness":"77AF1A59-D3F2-4028-8A16-6B54F1DCD004","f2_transmissionSamplerSize":"83B55791-5361-463C-B9C0-5CB0FA23C071","f2_transmissionSamplerMap":"7585657B-2961-4F9F-A7B9-081751C09AA1","f2_transmissionDepthMap":"5531D20E-39C2-452D-A4DD-7291CB475759","f2_aspectRatio":"68095B12-FCC3-4339-A89F-95BF6A6A88B3","f2_alpha":"8613C8CF-216F-4EED-B399-F598BE8EB22A","f2_mode":"B9B11474-F062-4D78-B3B0-0C769FCB4FDE"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"54C4FF63-DB8B-44A3-ABB6-5995EE7569C1","f4_far":"74D6416E-0F67-4B28-819F-79A611BD1306","f4_isVector":"1AF34F2D-00CD-4EAB-89ED-7662BFDE6596","f4_isWorldSpace":"1BAE74FA-F0CB-4F94-B66E-B3354A5EBD84","f4_origin":"EBC248C7-383F-42DF-B261-A98106DE995D","f4_colorA":"DB1B2332-0376-4A6E-A33F-8EAD981D9D0F","f4_colorB":"28452C36-5196-4B11-9FAB-18D79357C40F","f4_alpha":"65BFD46B-A412-4A36-B160-436547C81077","f4_mode":"128B229B-57C4-4EC0-AD1E-C26D9D3411E3"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3E95FAB6-914D-48E4-9A56-2C5F8ADC39FE","f3_bias":"FDD5E25F-0B35-4027-80C1-BBD87C71E041","f3_scale":"DC75FD77-2DEE-4B20-82A5-0896D152C1DF","f3_intensity":"D9CE2A25-103A-41F2-8EAA-30F0B2B8085B","f3_factor":"2F91873C-88C2-4923-96E8-0774B939FE8A","f3_alpha":"63E9024F-54DD-466F-8BC8-63051C85BBE4","f3_mode":"E3A4FC93-13ED-4FFD-92C4-A82719A280D7"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"759F3BB7-826C-40DB-81A1-F9ED672B4182","fragment":"759F3BB7-826C-40DB-81A1-F9ED672B4182"},{"uuid":"34F893C2-E688-43C9-97FA-C62067BE65DD","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"4DD9770B-33CC-4065-A0FD-D8BE9E158514","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5DB16E6A-4BA5-4828-B83C-E21E6879A882","f1_mode":"8EC3385B-CBB3-493C-9B66-892AD1BE117E","f1_shininess":"65A25B05-177C-47D1-8169-B6343130A9FC","f1_specular":"89A1AA0C-9C98-47BE-8E71-5B356E7A6CBC"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"E7725BFD-8225-4280-8E2E-315AE1336A2B","f2_ior":"337300EB-D45B-402A-92B6-6F8887D9A061","f2_roughness":"5EE14E46-F127-4BDE-9326-DEB23DFB69F3","f2_transmissionSamplerSize":"8181B280-AFFF-4FA4-B841-3CD861C330CD","f2_transmissionSamplerMap":"78B5AEA9-1E73-47EB-8A0F-1AE76372D33D","f2_transmissionDepthMap":"B0F42AD4-0B1D-437E-8AAE-1D8F22C38160","f2_aspectRatio":"BBB7BF63-42F0-4E31-85A4-06319CEACB4E","f2_alpha":"7893AAC3-8168-40CC-A287-289E235A1C40","f2_mode":"916D0BE7-10AA-4534-A9D4-77E613CBC05B"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"4F54A8CA-483E-4AC4-B441-C7941544395A","f4_far":"8B67670B-EA7D-40A4-9E5D-5660B2AC669D","f4_isVector":"5340DBD4-ABC3-409F-BF66-79CB58D04B78","f4_isWorldSpace":"89FC5EF6-BD41-4250-9B05-322BD82D9F97","f4_origin":"C540EADF-3227-47D1-A031-37DE0A87868A","f4_colorA":"3C7FDFCA-6E48-4C77-8D66-6FFA6F1C6BBA","f4_colorB":"1EB1CACF-CE7A-4E12-A7FB-3B69C4636699","f4_alpha":"1C049BFE-C809-4483-AA57-7EA802D74CAA","f4_mode":"8245FAC3-A0EC-4039-AF4B-D84D2CB5D9E2"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"0168D899-2E28-4095-A93E-59798F3829AB","f3_bias":"54353878-8F33-4D14-94F0-42669AC0163F","f3_scale":"3234C440-C1CB-4C9F-84ED-811DAD26B5D5","f3_intensity":"B8B6AD94-F2B1-40B8-95C1-7AA764787C2D","f3_factor":"A63AEDD9-6FB1-4343-9D5A-D5B5C5FD6214","f3_alpha":"C00860C1-EFE1-4522-BFD7-85E318C1E24D","f3_mode":"F58070D5-DFEF-4968-9ADA-38F094AA4DD2"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"80AA167F-B4C9-4FA1-9774-F3D25B806D5D","fragment":"80AA167F-B4C9-4FA1-9774-F3D25B806D5D"},{"uuid":"F65FD184-5290-4DB7-B156-366B75D65DE7","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"89813A95-ECDE-4319-884C-E9A88564ACF2","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"F3E3AF9F-99D7-430D-AA61-2A6732D08B73","f1_mode":"102BDA9C-1661-4764-9CBB-7376970F3DDE","f1_shininess":"0B953891-B25F-4E60-A2F5-6F201D8DEBCE","f1_specular":"E22FDA75-4FCC-4054-ACCD-3ED754D858A9"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"5F7F9FD1-31AE-4160-A232-33E07CD8E0BE","f2_ior":"6987D3EB-5FAE-4A7A-8B80-C8D4216FE73E","f2_roughness":"3C2C53F4-3F7D-4F55-A325-E7509B460E48","f2_transmissionSamplerSize":"B118EE41-B040-4051-8D21-77D6A8CDB053","f2_transmissionSamplerMap":"705D423D-179B-40E2-829F-8B3EF3613526","f2_transmissionDepthMap":"A0813A0A-942A-4514-BFA6-782146AACF16","f2_aspectRatio":"31F70C41-F0A8-442F-80C5-A5AEADEF9557","f2_alpha":"012C29F8-CC9A-42C9-A591-2BA265EAC759","f2_mode":"541ED7AB-D3D1-4C46-A3A5-411C6544B668"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"F653182E-A893-4452-BE42-BD6343BFB093","f4_far":"81CE29B1-134D-42AB-BA86-0667716857F5","f4_isVector":"1820E89E-5FDF-42DB-8591-3CA6BE145D22","f4_isWorldSpace":"411D6225-E76D-47F3-91E8-199F6FC45054","f4_origin":"3B016C55-558B-46AA-9711-E47435D8ACC5","f4_colorA":"62AEF880-2524-4057-9215-121E2F49B7D1","f4_colorB":"4D2B4869-26F1-492B-9B5C-206F55E6226E","f4_alpha":"624D80B0-A341-420F-82E9-E47EC9C1D894","f4_mode":"2672D4F9-2420-497F-B16F-7E7E20C94B91"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"ECC897B0-7106-403B-A826-85FFF0EB533C","f3_bias":"53AAB4E9-BECA-4F8A-B100-DA7A53F6A8DA","f3_scale":"58F7140C-66B5-4165-96A3-99E24FCC8CAF","f3_intensity":"9D653E82-C20B-4ECC-81CF-D9CE46EAD821","f3_factor":"E895251B-1A4D-48B7-AC95-097A493A5EE8","f3_alpha":"7DC39B2C-6B55-4C71-B72B-4A86C5888A95","f3_mode":"87483C50-79E7-4179-9033-D2C18FF3B270"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"BB264838-F363-4DE0-8BFE-F5BE2CB9C1C8","fragment":"BB264838-F363-4DE0-8BFE-F5BE2CB9C1C8"},{"uuid":"C0D428BA-8004-4A1B-8523-4A63F5E83102","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"DA022C08-56DA-4E52-872E-821916572CC0","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"EC5958E6-6D9E-4A34-AA59-F64751B0D15A","f1_mode":"9797CCD6-3EF2-4F93-AE15-18922F7FAE99","f1_shininess":"C696EC60-9463-42FA-A631-A1693E60078C","f1_specular":"25777677-2FA4-47E3-81B6-61B55D3134F9"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"40420D6C-C8DC-4CF1-A69E-68CE3AC0B922","f2_ior":"A1C20BE9-AAC1-489E-9435-DCBD1842042F","f2_roughness":"806668D2-DFAF-4F12-89B9-4F448484FE14","f2_transmissionSamplerSize":"64581A62-E63A-4D05-9F36-652826A52BBE","f2_transmissionSamplerMap":"4218C3B7-A9CA-405C-A3D2-00F954828C8F","f2_transmissionDepthMap":"98456443-6F02-4EBD-BA1D-9B6326B9754D","f2_aspectRatio":"E1E3E577-03E3-4FA0-9803-185BA3A9862A","f2_alpha":"81C42831-F8E4-4067-A898-A662BE2C385A","f2_mode":"B35BCFCB-26F3-45ED-A509-529497848A32"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"FB2D4319-DAFB-41E2-B547-9201D098298B","f4_far":"4FA681DC-17B4-4167-ACEA-76AD97D6E086","f4_isVector":"17AC2720-E8CD-4952-99AB-83DF8CC65ECB","f4_isWorldSpace":"9408ED5E-F919-4E68-A668-1C256DA0407B","f4_origin":"9AB87A13-E568-431A-A9CB-A09C7D5443B9","f4_colorA":"D56E1A4F-817E-44B7-86A8-D7BB3B041411","f4_colorB":"BC1F8B74-D4ED-448F-B64B-582033119D35","f4_alpha":"F88D76E9-893E-4698-9C20-E47F0D96E5E0","f4_mode":"1571B315-0EED-4272-93E1-A6AE6625C26F"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"FF043C84-8324-4296-86BF-E9D1D84B86AB","f3_bias":"7835C5C6-D9ED-4B81-BB52-C71A7260DDA2","f3_scale":"32854021-F981-4C8C-8430-03EF232C6372","f3_intensity":"1BFBF410-6821-4FD6-8EB3-8101CC445CB1","f3_factor":"B41047EA-6F2A-4E6C-9BB7-514B252982B4","f3_alpha":"1A93B872-7891-4D7A-89D1-0CCDAB18DAE1","f3_mode":"55559687-A382-4137-927B-4839E301C3FC"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"A78E61A6-3485-47DC-A241-F2EB6E30B300","fragment":"A78E61A6-3485-47DC-A241-F2EB6E30B300"},{"uuid":"ACBDE249-37DE-4939-8796-FE13AEB1B5FD","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"D30B5B81-2C34-4084-B822-FD19A05B9F4D","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E397B9A8-7218-4E7D-BB06-B3E851361CBC","f1_mode":"7C4915EA-AB08-4E03-9FF3-1A4643980C64","f1_shininess":"55F00D93-EE69-4150-A0BE-83B39131092B","f1_specular":"5F7B7637-9FDB-46CC-A0F4-9FEB2E2175B0"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"265D96C8-EDA1-4F8F-80FE-0B27F065BA50","f2_ior":"591C4D5B-C51C-4869-AA6F-37A76419517C","f2_roughness":"747BC561-705E-4125-80B9-86E4ACF22A97","f2_transmissionSamplerSize":"F19EB058-A12B-41AB-BD31-5E2D09845783","f2_transmissionSamplerMap":"C4D697CC-AFE1-4C98-9B61-679942ADAEA0","f2_transmissionDepthMap":"5ACBF950-D91F-464D-A29E-0E0C2B640454","f2_aspectRatio":"3857E7DA-9D35-4F1C-A1D9-BB36BD5CA774","f2_alpha":"85613281-9B5F-4538-8BB8-4CDFDFFE1C97","f2_mode":"26878463-19E4-4DF0-9235-BB5A7728FD96"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"F33F5641-D75E-4CF2-AE61-D424135438DC","f4_far":"0F849EF0-9C01-4BE2-AE99-4CC52C626031","f4_isVector":"79578348-97F1-47B5-93D7-B5747604A4FA","f4_isWorldSpace":"9A0AFD39-3916-4046-B7AA-EB04EA9E5D37","f4_origin":"1CA6FA3D-274B-429E-926F-7D0A48AB8630","f4_colorA":"7D007604-317E-4E2C-A12D-41B98D522AD2","f4_colorB":"53C722C1-7D99-41AC-9FFF-998217E720A5","f4_alpha":"3719BABB-8CA5-4CD8-B7D5-14FFE5A8E354","f4_mode":"AA423DFE-1EB1-4D25-9A93-19365B9CA33D"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"3408E833-4CED-43B1-8F78-58EAA8DEA70F","f3_bias":"23749EF7-25B5-4D6B-B568-ABC724D84EBE","f3_scale":"C7F0311A-4FDD-4503-8CD7-C0BFFCDE36C2","f3_intensity":"AE4E882A-06DF-486B-86F0-E20296669322","f3_factor":"E229B714-B25C-4B16-9414-2F2879A61602","f3_alpha":"636ED21B-2F4E-4C0E-9640-CE7EFC37CE8E","f3_mode":"97A024BC-3FBB-4E92-A067-079EA7743C5F"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"C1D2394B-BE61-4204-AD84-A4197E18D522","fragment":"C1D2394B-BE61-4204-AD84-A4197E18D522"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"BC58F3BD-3CD5-4903-BCE1-C32002D556A2","name":"Base State","position":[-132.1635384266761,-51.1373856647624,-495.86793449695807],"rotation":[-1.2573272724375641,-0.2661188930565406,-2.5891426069016284e-16,"XYZ"],"scale":[0.999999999999998,1.000000000000001,0.9999999999999923],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":30,"height":30,"depth":30},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"C7F7FAE1-04FC-42BB-ACD9-5EAC9F3990D8","f0_alpha":"FE3BC49C-265F-4C48-AB47-8C6132FA9130","f0_mode":"6DE34EE6-DDAC-45B9-AFE1-EDE79E2BED91"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"5D2E1E59-7B59-4E76-8FFB-1288B9FC2BA2","f1_mode":"90E783E2-2A42-4155-9C99-D679F7E8F257","f1_roughness":"FFA2FE51-0B7A-4403-8177-62F3C483D512","f1_metalness":"1F52E0F1-249A-44F1-A177-7FD149E73A84","f1_reflectivity":"B5D9628E-8CA5-40CC-976A-144984F9FA47"}}]}},{"uuid":"71CFA7D6-3621-4E22-B4C1-AA0E70477794","name":"State 1","position":[-132.1635384266761,-51.1373856647624,-495.86793449695807],"rotation":[-1.5872191416320136,-1.2040861197618644,1.537887162294093,"XYZ"],"scale":[1.0000000000000038,1.0000000000000109,0.9999999999999971],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":40},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"0CB5A688-86E9-460C-9FD8-27EB984F1B2B","f0_alpha":"141E3742-5AD2-4B80-84C8-E5A0F5AC575A","f0_mode":"B570A1A1-6024-47CB-8848-502E9265162C"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"BB3EB35F-63D7-4CC1-9CE3-6710DA360FBC","f1_mode":"B73DB477-28D6-44DF-8EDB-F96FE64603C3","f1_roughness":"8FDDF264-5400-44F3-A4D0-EB50C69DC540","f1_metalness":"6883E3A4-5023-484C-B1C0-4B90E389AB2D","f1_reflectivity":"3F8CC89D-833E-4CF2-83B8-200E1AE14571"}}]}},{"uuid":"9F8D0167-E3AC-4D02-AC9B-AFF3DCBDED1F","name":"Base State","position":[29.837735321981295,174.88806212317647,343.15660199269524],"rotation":[0.502421637412679,0.36617325636721515,0.16369631063246787,"XYZ"],"scale":[0.9999999999999978,1.0000000000000016,1.0000000000000007],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":61,"height":45,"depth":61},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"68495F92-4DD5-4805-8A0B-57720073D6F7","f0_alpha":"90C9CA41-DF25-4C7A-AA24-A10E093FFDF1","f0_mode":"A92EA7AB-E83E-4A2E-8DF4-DAA25D41AB23"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E21E9DF0-B9F5-4E0F-A696-DDAC08EFAC44","f1_mode":"6A3E765B-6A76-402A-92BE-AE78F4C87028","f1_roughness":"3440A14A-02C8-4863-A09C-6039EE1553AD","f1_metalness":"37327088-4B77-4283-A004-345B51A32971","f1_reflectivity":"7C466E14-6135-4FD4-B92B-E75CB5652752"}}]}},{"uuid":"3C323F54-4B75-4F4C-B824-5D44E6A2C87B","name":"State 1","position":[29.844518132183396,174.8507694921833,343.13314377626017],"rotation":[-0.10974678314739215,0.05016625548815775,1.178569242773016,"XYZ"],"scale":[1.0000000000000002,1.0000000000000047,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":75,"height":55,"depth":75},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"EDDCE079-3CB4-4935-A64F-15DF28A63CFE","f0_alpha":"8DD2D304-3076-44D4-AA90-16E5A52910E2","f0_mode":"10E9508F-7C62-4953-B41F-EA461AF48118"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"54C4EB74-E8E4-4418-8415-49AE233F9A27","f1_mode":"04EEA18B-C1A9-494C-8B23-FE627E564F11","f1_roughness":"B290CF2A-07BF-41BF-88EE-88918674726D","f1_metalness":"B029C024-8D3A-4E0F-8BF3-B9CD642067F0","f1_reflectivity":"A3CA2A6C-DD0C-4BF3-ABF7-05693D919704"}}]}},{"uuid":"14EA539B-8A15-4CC1-893E-755FC9F429FB","name":"Base State","position":[-333.61962033438857,62.4305143567372,-274.8879842740688],"rotation":[-0.026450441036634055,0.7807114405723217,0.020479854778938232,"XYZ"],"scale":[0.9999999999999998,0.9999999999999987,1.0000000000000004],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":38,"height":38,"depth":38},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"4C5475FE-CFDE-4BA8-A438-B1045D463183","f0_alpha":"E5438F57-ED3D-4F90-8C90-E5E1F9CC420D","f0_mode":"1B5E54E1-1CB6-4FE2-BFC9-9CE3B1CB23D8"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"FAD4CB46-491E-4EBA-ACCD-F60AC5931352","f1_mode":"D9B21134-CF38-4F01-BCEF-0ACBCBAE88AC","f1_roughness":"61F2A656-EC08-4C8C-8353-2A58257F7B46","f1_metalness":"E5C08C6C-F4B7-41D0-8031-8E7CE150D0DD","f1_reflectivity":"7EDD491E-4DAE-43E4-B40A-5BE0FC4E667A"}}]}},{"uuid":"DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5","name":"State 1","position":[-333.61962033438857,62.4305143567372,-274.8879842740688],"rotation":[-0.026450441036634055,0.7807114405723217,0.020479854778938232,"XYZ"],"scale":[0.9999999999999998,0.9999999999999987,1.0000000000000004],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":53,"height":53,"depth":53},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"8B5E26DC-B8AE-44FA-8A14-EF638327305B","f0_alpha":"B230E51A-6EF9-4026-8929-A3B96EFF4128","f0_mode":"AE9841C6-65F9-4F5D-AFE2-70C394993B54"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3AA5110A-9151-4C96-905D-F63481C5E362","f1_mode":"72045C6F-9CE5-42C3-84C0-C18E902A8105","f1_roughness":"3A096916-6D92-4824-BFCB-D49213EDFF3F","f1_metalness":"6AD9A118-336E-4A3E-B1D5-949E945F1E6A","f1_reflectivity":"24D038E6-1DA1-4C02-BF41-271B45A49A3A"}}]}},{"uuid":"28C6E18F-BD7B-413E-B4ED-F42B470C1036","name":"Base State","position":[8.228765814177173e-16,209.99207679614122,8.228765814177175e-16],"rotation":[1.224646799147353e-16,-2.4492935982947064e-16,-1.224646799147353e-16,"XYZ"],"scale":[1.0000000000000187,1,1.0000000000000187],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"60958BAD-DABC-41F6-B777-52A02438E644","name":"State 1","position":[8.228765814177173e-16,209.99207679614122,8.228765814177175e-16],"rotation":[-3.141592653589793,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.0000000000000318,1,1.0000000000000318],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"307C44B4-30D0-4E0B-B608-EBE4C807AA0B","name":"Base State","position":[0,153.05834378711734,0],"rotation":[1.2246467991473532e-16,-7.498798913309288e-33,-1.2246467991473532e-16,"XYZ"],"scale":[1.0000000000000264,1,1.0000000000000264],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"D31CB886-58BE-48A1-A431-1DF575DCAC6E","name":"State 1","position":[0,153.05834378711734,0],"rotation":[-3.141592653589793,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.0000000000000355,1,1.0000000000000355],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"83EC61E5-EF47-4AEB-BA00-B0133D85C366","name":"Base State","position":[0,115.09081537009483,0],"rotation":[1.224646799147353e-16,-2.4492935982947064e-16,-1.224646799147353e-16,"XYZ"],"scale":[1.000000000000036,1,1.000000000000036],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"25749767-B480-4A5B-9EAA-2B33D9EF0B84","name":"State 1","position":[0,115.09081537009483,0],"rotation":[-3.141592653589793,0.08726646259971674,-3.141592653589793,"XYZ"],"scale":[1.0000000000000506,1,1.0000000000000506],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"9C36471C-D54D-40ED-B233-7308B35AE9BF","name":"Base State","position":[-4.079219866531334e-15,129.78775382679308,0],"rotation":[0,0,0.3490658503988662,"XYZ"],"scale":[0.9999999999999986,0.9999999999999986,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":420,"height":36,"depth":420},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D7629B1E-02EC-4D77-82BD-A388386043E3","f1_mode":"33811EF2-A6B8-4042-9C6C-8EBE214FAF6D","f1_shininess":"1C6684DD-F233-4349-B376-B18EBEA24898","f1_specular":"D652A07D-C761-4C06-82DD-33FAA2B0FEAD"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"A2AA9206-C4A9-4249-B5D2-B654E2B6FC6C","f2_ior":"D3616FD2-71EC-4D86-9240-9D7D50CD9E53","f2_roughness":"4DBDDB88-8E36-4A9C-9F79-EFBAECF8DD88","f2_transmissionSamplerSize":"23C6C823-6151-4F1A-AC6E-822F11D583BC","f2_aspectRatio":"78B98B2F-8B10-4DD5-9FA8-6695BB14C91D","f2_alpha":"05271F0A-911A-4F5F-A74B-42E1DE40DDD1","f2_mode":"915AAD79-9C78-40E6-BD71-A6019656CBAC"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"0C66A8AB-16C4-4D0C-8D9B-AD40C471FFAE","f4_far":"7F13A951-4AF8-40DA-A9B3-461EED8AF1B3","f4_isVector":"C62C29CE-D460-4017-B6E9-DF02E7729266","f4_isWorldSpace":"EDC4DC12-4F82-4153-88FD-5C85DEF219B9","f4_origin":"16447837-59B7-4622-AB96-3F4066A01051","f4_colorA":"4BE69034-B838-4B39-8A27-1E88363681AA","f4_colorB":"C87EAD46-A2E0-4ABD-A46E-C4891ADE1C39","f4_alpha":"61135000-6615-428A-AE39-097DC5CE1094","f4_mode":"3E594976-F8BC-469E-8031-E1484B4AFCF0"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"94ED5572-2D19-4B14-8E33-14C1D77C21B9","f3_bias":"65BC394B-D1D5-4D1A-8B4A-F217C546EB6F","f3_scale":"F21B4381-44AD-484C-8CFD-3F0D51971219","f3_intensity":"C681BCF7-47C7-404A-A283-6D4C33FDD39C","f3_factor":"AA63B105-3C3A-4887-96E0-DEA94CD38488","f3_alpha":"717AE919-122A-4498-8569-5323883ECFFF","f3_mode":"8FA8789B-D81E-4808-9874-50DF2450EDC5"}}]}},{"uuid":"78C26B35-2E45-4B25-BBC0-902DC72A3D6B","name":"State 1","position":[-4.079219866531334e-15,129.78775382679308,0],"rotation":[-3.141592653589793,1.1507915602278503e-16,2.792526803190927,"XYZ"],"scale":[1.000000000000053,0.999999999999999,1.0000000000000613],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":420,"height":36,"depth":420},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"ECED4DEC-AC09-42FF-BCB4-422DC7CFD531","f1_mode":"A1F1C8CD-1E57-4773-96BF-8F555EF59489","f1_shininess":"089B8258-4756-42F5-9B1F-660055820BDE","f1_specular":"4BF405F8-D1E4-4C4F-8D92-3690831A1A9D"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"02894D8C-61AD-4BA1-9098-CB25B68A84DF","f2_ior":"4684C3D9-2B52-4D13-B87C-38B6CF688ECD","f2_roughness":"A10FBCAA-DA97-438A-8D92-284643A05EEE","f2_transmissionSamplerSize":"46C9030B-8D25-4123-AD69-A59FB161FD64","f2_aspectRatio":"69A1884F-7EFA-4714-AECB-62ACE3C834CA","f2_alpha":"E3F5A097-E117-45AC-BAF2-8A66DE8665A5","f2_mode":"2B00D9D5-F62B-488B-88B9-ACFA16DDB3FA"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"A2CE6C51-DF51-4B44-AAF0-CA7E2CD1D744","f4_far":"0B66C73F-1774-4C77-B784-2A135EB2604B","f4_isVector":"08B9C2DC-C1E8-44F6-98A9-A3A61A6FDDDD","f4_isWorldSpace":"D11F3F92-6F11-4EF7-97CB-6CAE93970B90","f4_origin":"6D23A188-7D3F-4DA7-8164-F04F36EBE573","f4_colorA":"5F7F198C-D50C-4F95-BC15-4DC74F456DFA","f4_colorB":"F369DEC4-AD9E-4769-A026-CABD58D91478","f4_alpha":"7FE8F585-7F8E-4CBD-91D3-61F1203749DC","f4_mode":"073536A9-555A-425F-9F7E-BFA674AF4443"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"2765E471-A42A-4060-8362-34301ECA4A5F","f3_bias":"0CB42569-449D-4994-8891-7D79429405CC","f3_scale":"4DF47492-8810-4B1A-900F-1500C860567E","f3_intensity":"D1F8A716-1F10-4767-A7A1-99A554DBC968","f3_factor":"B64E2E96-1497-4074-83EF-4F43588C8C1B","f3_alpha":"A3E9C48A-E567-4E63-80E5-6D49D80F70C6","f3_mode":"F5E27EF4-E53A-4B40-8736-BA90DBB0A6BD"}}]}}],"nodes":[{"uuid":"C7F7FAE1-04FC-42BB-ACD9-5EAC9F3990D8","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"767D6ECF-25F9-4685-9C3A-5524CD4BDE47","nodeType":"Color"},{"uuid":"767D6ECF-25F9-4685-9C3A-5524CD4BDE47","type":"f","value":1,"nodeType":"Float"},{"uuid":"FE3BC49C-265F-4C48-AB47-8C6132FA9130","type":"f","value":1,"nodeType":"Float"},{"uuid":"6DE34EE6-DDAC-45B9-AFE1-EDE79E2BED91","type":"i","value":0,"nodeType":"Int"},{"uuid":"5D2E1E59-7B59-4E76-8FFB-1288B9FC2BA2","type":"f","value":1,"nodeType":"Float"},{"uuid":"90E783E2-2A42-4155-9C99-D679F7E8F257","type":"i","value":0,"nodeType":"Int"},{"uuid":"FFA2FE51-0B7A-4403-8177-62F3C483D512","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"1F52E0F1-249A-44F1-A177-7FD149E73A84","type":"f","value":0,"nodeType":"Float"},{"uuid":"B5D9628E-8CA5-40CC-976A-144984F9FA47","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0CB5A688-86E9-460C-9FD8-27EB984F1B2B","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"3B41345E-1A0E-4178-81AD-A1A75F5E19EF","nodeType":"Color"},{"uuid":"3B41345E-1A0E-4178-81AD-A1A75F5E19EF","type":"f","value":1,"nodeType":"Float"},{"uuid":"141E3742-5AD2-4B80-84C8-E5A0F5AC575A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B570A1A1-6024-47CB-8848-502E9265162C","type":"i","value":0,"nodeType":"Int"},{"uuid":"BB3EB35F-63D7-4CC1-9CE3-6710DA360FBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"B73DB477-28D6-44DF-8EDB-F96FE64603C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"8FDDF264-5400-44F3-A4D0-EB50C69DC540","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"6883E3A4-5023-484C-B1C0-4B90E389AB2D","type":"f","value":0,"nodeType":"Float"},{"uuid":"3F8CC89D-833E-4CF2-83B8-200E1AE14571","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"40645A36-E0F9-4977-A09D-A4F1E4032774","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"58AEFAA9-E19E-43AC-8F6B-3A8DA7A1E9F5","nodeType":"Color"},{"uuid":"58AEFAA9-E19E-43AC-8F6B-3A8DA7A1E9F5","type":"f","value":1,"nodeType":"Float"},{"uuid":"C6FFEB39-9203-4529-B0E1-D7C810815369","type":"i","value":0,"nodeType":"Int"},{"uuid":"F85279E3-EC88-45B6-B3C5-BACFA184EE29","type":"f","value":1,"nodeType":"Float"},{"uuid":"550FFE4C-542B-4CCF-9A73-D04EDA5012EC","type":"i","value":0,"nodeType":"Int"},{"uuid":"223463DA-CAEC-45F2-B5DA-1A12C0623180","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"6ACFA727-6F87-4810-B473-00AD2A02B3A8","type":"f","value":0,"nodeType":"Float"},{"uuid":"FA202678-6ED4-43E7-89C5-005A0D6DD93B","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"CEC716B8-CEB7-4AB1-84C3-04CBD59A6910","type":"standard","color":"40645A36-E0F9-4977-A09D-A4F1E4032774","roughness":"223463DA-CAEC-45F2-B5DA-1A12C0623180","metalness":"6ACFA727-6F87-4810-B473-00AD2A02B3A8","alpha":"404191C6-FA03-4D1C-B476-F7C022090E4D","reflectivity":"FA202678-6ED4-43E7-89C5-005A0D6DD93B","shadingAlpha":"F85279E3-EC88-45B6-B3C5-BACFA184EE29","shadingBlend":"550FFE4C-542B-4CCF-9A73-D04EDA5012EC","nodeType":"Standard"},{"uuid":"404191C6-FA03-4D1C-B476-F7C022090E4D","type":"f","value":1,"nodeType":"Float"},{"uuid":"68495F92-4DD5-4805-8A0B-57720073D6F7","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"B7339059-576D-4D05-83D8-D15D17E54ED4","nodeType":"Color"},{"uuid":"B7339059-576D-4D05-83D8-D15D17E54ED4","type":"f","value":1,"nodeType":"Float"},{"uuid":"90C9CA41-DF25-4C7A-AA24-A10E093FFDF1","type":"f","value":1,"nodeType":"Float"},{"uuid":"A92EA7AB-E83E-4A2E-8DF4-DAA25D41AB23","type":"i","value":0,"nodeType":"Int"},{"uuid":"E21E9DF0-B9F5-4E0F-A696-DDAC08EFAC44","type":"f","value":1,"nodeType":"Float"},{"uuid":"6A3E765B-6A76-402A-92BE-AE78F4C87028","type":"i","value":0,"nodeType":"Int"},{"uuid":"3440A14A-02C8-4863-A09C-6039EE1553AD","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"37327088-4B77-4283-A004-345B51A32971","type":"f","value":0,"nodeType":"Float"},{"uuid":"7C466E14-6135-4FD4-B92B-E75CB5652752","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"EDDCE079-3CB4-4935-A64F-15DF28A63CFE","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"D32D0ECB-763D-4E8E-9E1B-378A982155C8","nodeType":"Color"},{"uuid":"D32D0ECB-763D-4E8E-9E1B-378A982155C8","type":"f","value":1,"nodeType":"Float"},{"uuid":"8DD2D304-3076-44D4-AA90-16E5A52910E2","type":"f","value":1,"nodeType":"Float"},{"uuid":"10E9508F-7C62-4953-B41F-EA461AF48118","type":"i","value":0,"nodeType":"Int"},{"uuid":"54C4EB74-E8E4-4418-8415-49AE233F9A27","type":"f","value":1,"nodeType":"Float"},{"uuid":"04EEA18B-C1A9-494C-8B23-FE627E564F11","type":"i","value":0,"nodeType":"Int"},{"uuid":"B290CF2A-07BF-41BF-88EE-88918674726D","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"B029C024-8D3A-4E0F-8BF3-B9CD642067F0","type":"f","value":0,"nodeType":"Float"},{"uuid":"A3CA2A6C-DD0C-4BF3-ABF7-05693D919704","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"39EDD61A-D487-4B4B-8572-1413BF2E1938","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"57588C00-B1B0-4C60-8FA6-5907608C4557","nodeType":"Color"},{"uuid":"57588C00-B1B0-4C60-8FA6-5907608C4557","type":"f","value":1,"nodeType":"Float"},{"uuid":"BDD6053B-94F8-4366-BEC9-60E2D0D676EC","type":"i","value":0,"nodeType":"Int"},{"uuid":"5A86B73D-BF9D-4843-AF8E-B309AA40EB1F","type":"f","value":1,"nodeType":"Float"},{"uuid":"532AA33F-A032-4B70-B6A8-EA3473E0FB7D","type":"i","value":0,"nodeType":"Int"},{"uuid":"4DB029D8-51BE-43F2-9F3F-14FA43DEDC29","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"A2EFBF02-9D71-40E4-BCC1-BD38EDC5362A","type":"f","value":0,"nodeType":"Float"},{"uuid":"493ECAB3-6B7B-4A28-BFEC-F3FB46979F70","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F7D09E41-AFB6-41D3-9145-873A637A1EDB","type":"standard","color":"39EDD61A-D487-4B4B-8572-1413BF2E1938","roughness":"4DB029D8-51BE-43F2-9F3F-14FA43DEDC29","metalness":"A2EFBF02-9D71-40E4-BCC1-BD38EDC5362A","alpha":"441F00EB-6258-443F-9741-CC1F132E6029","reflectivity":"493ECAB3-6B7B-4A28-BFEC-F3FB46979F70","shadingAlpha":"5A86B73D-BF9D-4843-AF8E-B309AA40EB1F","shadingBlend":"532AA33F-A032-4B70-B6A8-EA3473E0FB7D","nodeType":"Standard"},{"uuid":"441F00EB-6258-443F-9741-CC1F132E6029","type":"f","value":1,"nodeType":"Float"},{"uuid":"4C5475FE-CFDE-4BA8-A438-B1045D463183","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"1C7C3589-04BF-4388-A84F-CF9558326331","nodeType":"Color"},{"uuid":"1C7C3589-04BF-4388-A84F-CF9558326331","type":"f","value":1,"nodeType":"Float"},{"uuid":"E5438F57-ED3D-4F90-8C90-E5E1F9CC420D","type":"f","value":1,"nodeType":"Float"},{"uuid":"1B5E54E1-1CB6-4FE2-BFC9-9CE3B1CB23D8","type":"i","value":0,"nodeType":"Int"},{"uuid":"FAD4CB46-491E-4EBA-ACCD-F60AC5931352","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9B21134-CF38-4F01-BCEF-0ACBCBAE88AC","type":"i","value":0,"nodeType":"Int"},{"uuid":"61F2A656-EC08-4C8C-8353-2A58257F7B46","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"E5C08C6C-F4B7-41D0-8031-8E7CE150D0DD","type":"f","value":0,"nodeType":"Float"},{"uuid":"7EDD491E-4DAE-43E4-B40A-5BE0FC4E667A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8B5E26DC-B8AE-44FA-8A14-EF638327305B","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"90D08870-2963-49BF-945B-BE055AD19417","nodeType":"Color"},{"uuid":"90D08870-2963-49BF-945B-BE055AD19417","type":"f","value":1,"nodeType":"Float"},{"uuid":"B230E51A-6EF9-4026-8929-A3B96EFF4128","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE9841C6-65F9-4F5D-AFE2-70C394993B54","type":"i","value":0,"nodeType":"Int"},{"uuid":"3AA5110A-9151-4C96-905D-F63481C5E362","type":"f","value":1,"nodeType":"Float"},{"uuid":"72045C6F-9CE5-42C3-84C0-C18E902A8105","type":"i","value":0,"nodeType":"Int"},{"uuid":"3A096916-6D92-4824-BFCB-D49213EDFF3F","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"6AD9A118-336E-4A3E-B1D5-949E945F1E6A","type":"f","value":0,"nodeType":"Float"},{"uuid":"24D038E6-1DA1-4C02-BF41-271B45A49A3A","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"36F2DFDD-321A-45F4-BF1D-989630CEA17A","type":"c","r":0.24705882352941178,"g":0.25882352941176473,"b":0.27450980392156865,"value":4145734,"alpha":"15D667E7-7E98-4CA2-ADEB-C1D2892B3FB5","nodeType":"Color"},{"uuid":"15D667E7-7E98-4CA2-ADEB-C1D2892B3FB5","type":"f","value":1,"nodeType":"Float"},{"uuid":"40EF97E6-8E4E-4E17-80B6-E5B1488D4C02","type":"i","value":0,"nodeType":"Int"},{"uuid":"7B4D5FF9-DB80-4052-B406-F4B1489CBDC7","type":"f","value":1,"nodeType":"Float"},{"uuid":"55CCF909-8D75-480D-83B5-D7A6DE759344","type":"i","value":0,"nodeType":"Int"},{"uuid":"922ADD5C-0787-474D-BBC7-4A8F853F5C00","type":"f","value":0.3,"nodeType":"Float"},{"uuid":"BC88F3D1-6631-4562-B3CD-880A725A2F51","type":"f","value":0,"nodeType":"Float"},{"uuid":"6A5F01EE-FF6B-4040-BDC9-0310FB9BD7AE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"E5B68283-F195-44E0-91B2-E46AEAEE0FFF","type":"standard","color":"36F2DFDD-321A-45F4-BF1D-989630CEA17A","roughness":"922ADD5C-0787-474D-BBC7-4A8F853F5C00","metalness":"BC88F3D1-6631-4562-B3CD-880A725A2F51","alpha":"9DF997E5-B8D8-49B4-82A0-2A70E8E672B0","reflectivity":"6A5F01EE-FF6B-4040-BDC9-0310FB9BD7AE","shadingAlpha":"7B4D5FF9-DB80-4052-B406-F4B1489CBDC7","shadingBlend":"55CCF909-8D75-480D-83B5-D7A6DE759344","nodeType":"Standard"},{"uuid":"9DF997E5-B8D8-49B4-82A0-2A70E8E672B0","type":"f","value":1,"nodeType":"Float"},{"uuid":"922ACA10-2A1F-4F15-93D6-D56C4838685D","type":"f","value":1,"nodeType":"Float"},{"uuid":"28897FA5-CB1E-4D9E-879D-09FF627C0250","type":"i","value":0,"nodeType":"Int"},{"uuid":"F586F0FB-346B-4252-B546-4CB27E864DDF","type":"f","value":30,"nodeType":"Float"},{"uuid":"CA9D6688-2953-46C2-8395-8D8B111A7541","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"02B04CCB-B154-4DD3-8B06-B81D1DD5DB41","type":"f","value":10,"nodeType":"Float"},{"uuid":"EA044829-C4D1-4F8A-BB02-83FDDF408618","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"77AF1A59-D3F2-4028-8A16-6B54F1DCD004","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"83B55791-5361-463C-B9C0-5CB0FA23C071","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"7585657B-2961-4F9F-A7B9-081751C09AA1","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"CEBC44D1-2460-4E62-8F36-EA9B8CC3E93F","project":false,"nodeType":"Texture"},{"uuid":"CEBC44D1-2460-4E62-8F36-EA9B8CC3E93F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5531D20E-39C2-452D-A4DD-7291CB475759","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"DBC5C825-D94C-4D10-8D08-0F736B0D48D5","project":false,"nodeType":"Texture"},{"uuid":"DBC5C825-D94C-4D10-8D08-0F736B0D48D5","type":"v2","index":0,"nodeType":"UV"},{"uuid":"68095B12-FCC3-4339-A89F-95BF6A6A88B3","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"8613C8CF-216F-4EED-B399-F598BE8EB22A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B9B11474-F062-4D78-B3B0-0C769FCB4FDE","type":"i","value":0,"nodeType":"Int"},{"uuid":"54C4FF63-DB8B-44A3-ABB6-5995EE7569C1","type":"f","value":50,"nodeType":"Float"},{"uuid":"74D6416E-0F67-4B28-819F-79A611BD1306","type":"f","value":249,"nodeType":"Float"},{"uuid":"1AF34F2D-00CD-4EAB-89ED-7662BFDE6596","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BAE74FA-F0CB-4F94-B66E-B3354A5EBD84","type":"f","value":0,"nodeType":"Float"},{"uuid":"EBC248C7-383F-42DF-B261-A98106DE995D","type":"v3","x":-103,"y":-40,"z":202,"nodeType":"Vector3"},{"uuid":"DB1B2332-0376-4A6E-A33F-8EAD981D9D0F","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"28452C36-5196-4B11-9FAB-18D79357C40F","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"65BFD46B-A412-4A36-B160-436547C81077","type":"f","value":1,"nodeType":"Float"},{"uuid":"128B229B-57C4-4EC0-AD1E-C26D9D3411E3","type":"i","value":2,"nodeType":"Int"},{"uuid":"3E95FAB6-914D-48E4-9A56-2C5F8ADC39FE","type":"c","r":0.28627450980392155,"g":0.4549019607843137,"b":1,"value":4814079,"nodeType":"Color"},{"uuid":"FDD5E25F-0B35-4027-80C1-BBD87C71E041","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"DC75FD77-2DEE-4B20-82A5-0896D152C1DF","type":"f","value":1,"nodeType":"Float"},{"uuid":"D9CE2A25-103A-41F2-8EAA-30F0B2B8085B","type":"f","value":2,"nodeType":"Float"},{"uuid":"2F91873C-88C2-4923-96E8-0774B939FE8A","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"63E9024F-54DD-466F-8BC8-63051C85BBE4","type":"f","value":1,"nodeType":"Float"},{"uuid":"E3A4FC93-13ED-4FFD-92C4-A82719A280D7","type":"i","value":2,"nodeType":"Int"},{"uuid":"759F3BB7-826C-40DB-81A1-F9ED672B4182","type":"phong","color":"264C252A-C26E-4817-9DBD-0EB21DB1022A","specular":"CA9D6688-2953-46C2-8395-8D8B111A7541","shininess":"F586F0FB-346B-4252-B546-4CB27E864DDF","shadingAlpha":"922ACA10-2A1F-4F15-93D6-D56C4838685D","shadingBlend":"28897FA5-CB1E-4D9E-879D-09FF627C0250","afterColor":"1D944C5B-692C-4509-B790-FC49FE822F3F","alpha":"4126720E-BA08-4424-B9E7-AFD73881246F","nodeType":"Phong"},{"uuid":"264C252A-C26E-4817-9DBD-0EB21DB1022A","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"1D944C5B-692C-4509-B790-FC49FE822F3F","type":"v3","a":"F28E75FC-C2A0-41C9-8FE0-A3323AAFE966","b":"4CBC86D6-24F5-4293-A909-C3B11E7303AD","alpha":"3949CA81-029E-4E2D-9A1B-5901BB561C71","mode":"E3A4FC93-13ED-4FFD-92C4-A82719A280D7","nodeType":"Blend"},{"uuid":"F28E75FC-C2A0-41C9-8FE0-A3323AAFE966","type":"v3","a":"E95D3F6B-B34A-4FCF-AA7A-41D193C6E254","b":"AD80D975-A53D-4CAA-B3EE-9F865C057882","alpha":"A3672E5F-15BE-49B7-8D8D-FF2E2B8B270C","mode":"128B229B-57C4-4EC0-AD1E-C26D9D3411E3","nodeType":"Blend"},{"uuid":"E95D3F6B-B34A-4FCF-AA7A-41D193C6E254","type":"v3","a":"69B6627F-981F-4245-AF10-B762B37362FD","b":"7151BD0A-CD8A-4A47-8A29-14A82AEAD4FA","alpha":"0AC724AA-AAC3-4EAD-B56B-ACDC093A4474","mode":"B9B11474-F062-4D78-B3B0-0C769FCB4FDE","nodeType":"Blend"},{"uuid":"69B6627F-981F-4245-AF10-B762B37362FD","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7151BD0A-CD8A-4A47-8A29-14A82AEAD4FA","type":"v3","thickness":"02B04CCB-B154-4DD3-8B06-B81D1DD5DB41","ior":"EA044829-C4D1-4F8A-BB02-83FDDF408618","roughness":"77AF1A59-D3F2-4028-8A16-6B54F1DCD004","alpha":"8613C8CF-216F-4EED-B399-F598BE8EB22A","calpha":"g7151BD0ACD8A4A478A2914A82AEAD4FA_calpha","nodeType":"Transmission"},{"uuid":"0AC724AA-AAC3-4EAD-B56B-ACDC093A4474","type":"f","src":"g7151BD0ACD8A4A478A2914A82AEAD4FA_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AD80D975-A53D-4CAA-B3EE-9F865C057882","type":"v3","near":"54C4FF63-DB8B-44A3-ABB6-5995EE7569C1","far":"74D6416E-0F67-4B28-819F-79A611BD1306","isVector":"1AF34F2D-00CD-4EAB-89ED-7662BFDE6596","isWorldSpace":"1BAE74FA-F0CB-4F94-B66E-B3354A5EBD84","origin":"EBC248C7-383F-42DF-B261-A98106DE995D","colorA":"DB1B2332-0376-4A6E-A33F-8EAD981D9D0F","colorB":"28452C36-5196-4B11-9FAB-18D79357C40F","alpha":"65BFD46B-A412-4A36-B160-436547C81077","nodeType":"Depth"},{"uuid":"A3672E5F-15BE-49B7-8D8D-FF2E2B8B270C","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"65BFD46B-A412-4A36-B160-436547C81077"},"nodeType":"Expression"},{"uuid":"4CBC86D6-24F5-4293-A909-C3B11E7303AD","type":"v3","color":"3E95FAB6-914D-48E4-9A56-2C5F8ADC39FE","bias":"FDD5E25F-0B35-4027-80C1-BBD87C71E041","scale":"DC75FD77-2DEE-4B20-82A5-0896D152C1DF","intensity":"D9CE2A25-103A-41F2-8EAA-30F0B2B8085B","factor":"2F91873C-88C2-4923-96E8-0774B939FE8A","alpha":"63E9024F-54DD-466F-8BC8-63051C85BBE4","mode":"E3A4FC93-13ED-4FFD-92C4-A82719A280D7","calpha":"g4CBC86D624F54293A909C3B11E7303AD_calpha","nodeType":"Fresnel"},{"uuid":"3949CA81-029E-4E2D-9A1B-5901BB561C71","type":"f","src":"g4CBC86D624F54293A909C3B11E7303AD_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4126720E-BA08-4424-B9E7-AFD73881246F","type":"f","value":1,"nodeType":"Float"},{"uuid":"5DB16E6A-4BA5-4828-B83C-E21E6879A882","type":"f","value":1,"nodeType":"Float"},{"uuid":"8EC3385B-CBB3-493C-9B66-892AD1BE117E","type":"i","value":0,"nodeType":"Int"},{"uuid":"65A25B05-177C-47D1-8169-B6343130A9FC","type":"f","value":30,"nodeType":"Float"},{"uuid":"89A1AA0C-9C98-47BE-8E71-5B356E7A6CBC","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"E7725BFD-8225-4280-8E2E-315AE1336A2B","type":"f","value":10,"nodeType":"Float"},{"uuid":"337300EB-D45B-402A-92B6-6F8887D9A061","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"5EE14E46-F127-4BDE-9326-DEB23DFB69F3","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"8181B280-AFFF-4FA4-B841-3CD861C330CD","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"78B5AEA9-1E73-47EB-8A0F-1AE76372D33D","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"8D0E2C9C-9A36-4FEC-A72F-E1A3C1144E2F","project":false,"nodeType":"Texture"},{"uuid":"8D0E2C9C-9A36-4FEC-A72F-E1A3C1144E2F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B0F42AD4-0B1D-437E-8AAE-1D8F22C38160","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"30973577-10DD-4F9F-8B4E-15CE44DA8073","project":false,"nodeType":"Texture"},{"uuid":"30973577-10DD-4F9F-8B4E-15CE44DA8073","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BBB7BF63-42F0-4E31-85A4-06319CEACB4E","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"7893AAC3-8168-40CC-A287-289E235A1C40","type":"f","value":1,"nodeType":"Float"},{"uuid":"916D0BE7-10AA-4534-A9D4-77E613CBC05B","type":"i","value":0,"nodeType":"Int"},{"uuid":"4F54A8CA-483E-4AC4-B441-C7941544395A","type":"f","value":50,"nodeType":"Float"},{"uuid":"8B67670B-EA7D-40A4-9E5D-5660B2AC669D","type":"f","value":324,"nodeType":"Float"},{"uuid":"5340DBD4-ABC3-409F-BF66-79CB58D04B78","type":"f","value":1,"nodeType":"Float"},{"uuid":"89FC5EF6-BD41-4250-9B05-322BD82D9F97","type":"f","value":0,"nodeType":"Float"},{"uuid":"C540EADF-3227-47D1-A031-37DE0A87868A","type":"v3","x":-103,"y":-40,"z":202,"nodeType":"Vector3"},{"uuid":"3C7FDFCA-6E48-4C77-8D66-6FFA6F1C6BBA","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"1EB1CACF-CE7A-4E12-A7FB-3B69C4636699","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"1C049BFE-C809-4483-AA57-7EA802D74CAA","type":"f","value":1,"nodeType":"Float"},{"uuid":"8245FAC3-A0EC-4039-AF4B-D84D2CB5D9E2","type":"i","value":2,"nodeType":"Int"},{"uuid":"0168D899-2E28-4095-A93E-59798F3829AB","type":"c","r":0.28627450980392155,"g":0.4549019607843137,"b":1,"value":4814079,"nodeType":"Color"},{"uuid":"54353878-8F33-4D14-94F0-42669AC0163F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"3234C440-C1CB-4C9F-84ED-811DAD26B5D5","type":"f","value":1,"nodeType":"Float"},{"uuid":"B8B6AD94-F2B1-40B8-95C1-7AA764787C2D","type":"f","value":2,"nodeType":"Float"},{"uuid":"A63AEDD9-6FB1-4343-9D5A-D5B5C5FD6214","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"C00860C1-EFE1-4522-BFD7-85E318C1E24D","type":"f","value":1,"nodeType":"Float"},{"uuid":"F58070D5-DFEF-4968-9ADA-38F094AA4DD2","type":"i","value":2,"nodeType":"Int"},{"uuid":"80AA167F-B4C9-4FA1-9774-F3D25B806D5D","type":"phong","color":"754CE66B-8374-46D6-9B8C-33F38CA3CFE3","specular":"89A1AA0C-9C98-47BE-8E71-5B356E7A6CBC","shininess":"65A25B05-177C-47D1-8169-B6343130A9FC","shadingAlpha":"5DB16E6A-4BA5-4828-B83C-E21E6879A882","shadingBlend":"8EC3385B-CBB3-493C-9B66-892AD1BE117E","afterColor":"97572F6D-CBC2-42CD-BE63-841FBCD7280C","alpha":"083EE7BD-1A93-44F3-821C-5B2F4613DC7F","nodeType":"Phong"},{"uuid":"754CE66B-8374-46D6-9B8C-33F38CA3CFE3","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"97572F6D-CBC2-42CD-BE63-841FBCD7280C","type":"v3","a":"88EADD2C-0B83-4AA9-85B3-BA67101EB1C6","b":"A46CEA70-095B-4026-996C-B27BE303DBAF","alpha":"61E74665-C911-402E-83AF-1BC904C48AE5","mode":"F58070D5-DFEF-4968-9ADA-38F094AA4DD2","nodeType":"Blend"},{"uuid":"88EADD2C-0B83-4AA9-85B3-BA67101EB1C6","type":"v3","a":"4F51FC2D-0A46-48FE-B0E9-0E6B2CCB5003","b":"9602EF43-33A7-4C1C-9231-3DD637DE4BD6","alpha":"74166C95-A8E4-4623-AF52-BDCE56DC32C6","mode":"8245FAC3-A0EC-4039-AF4B-D84D2CB5D9E2","nodeType":"Blend"},{"uuid":"4F51FC2D-0A46-48FE-B0E9-0E6B2CCB5003","type":"v3","a":"D46F4638-240E-4AAF-97CD-205C4AFA29D6","b":"8CDD2818-31EE-4740-8574-4A1A87604F19","alpha":"3F24CF1C-F19B-4FFC-A860-C3F4A5D536DB","mode":"916D0BE7-10AA-4534-A9D4-77E613CBC05B","nodeType":"Blend"},{"uuid":"D46F4638-240E-4AAF-97CD-205C4AFA29D6","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"8CDD2818-31EE-4740-8574-4A1A87604F19","type":"v3","thickness":"E7725BFD-8225-4280-8E2E-315AE1336A2B","ior":"337300EB-D45B-402A-92B6-6F8887D9A061","roughness":"5EE14E46-F127-4BDE-9326-DEB23DFB69F3","alpha":"7893AAC3-8168-40CC-A287-289E235A1C40","calpha":"g8CDD281831EE474085744A1A87604F19_calpha","nodeType":"Transmission"},{"uuid":"3F24CF1C-F19B-4FFC-A860-C3F4A5D536DB","type":"f","src":"g8CDD281831EE474085744A1A87604F19_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"9602EF43-33A7-4C1C-9231-3DD637DE4BD6","type":"v3","near":"4F54A8CA-483E-4AC4-B441-C7941544395A","far":"8B67670B-EA7D-40A4-9E5D-5660B2AC669D","isVector":"5340DBD4-ABC3-409F-BF66-79CB58D04B78","isWorldSpace":"89FC5EF6-BD41-4250-9B05-322BD82D9F97","origin":"C540EADF-3227-47D1-A031-37DE0A87868A","colorA":"3C7FDFCA-6E48-4C77-8D66-6FFA6F1C6BBA","colorB":"1EB1CACF-CE7A-4E12-A7FB-3B69C4636699","alpha":"1C049BFE-C809-4483-AA57-7EA802D74CAA","nodeType":"Depth"},{"uuid":"74166C95-A8E4-4623-AF52-BDCE56DC32C6","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"1C049BFE-C809-4483-AA57-7EA802D74CAA"},"nodeType":"Expression"},{"uuid":"A46CEA70-095B-4026-996C-B27BE303DBAF","type":"v3","color":"0168D899-2E28-4095-A93E-59798F3829AB","bias":"54353878-8F33-4D14-94F0-42669AC0163F","scale":"3234C440-C1CB-4C9F-84ED-811DAD26B5D5","intensity":"B8B6AD94-F2B1-40B8-95C1-7AA764787C2D","factor":"A63AEDD9-6FB1-4343-9D5A-D5B5C5FD6214","alpha":"C00860C1-EFE1-4522-BFD7-85E318C1E24D","mode":"F58070D5-DFEF-4968-9ADA-38F094AA4DD2","calpha":"gA46CEA70095B4026996CB27BE303DBAF_calpha","nodeType":"Fresnel"},{"uuid":"61E74665-C911-402E-83AF-1BC904C48AE5","type":"f","src":"gA46CEA70095B4026996CB27BE303DBAF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"083EE7BD-1A93-44F3-821C-5B2F4613DC7F","type":"f","value":1,"nodeType":"Float"},{"uuid":"F3E3AF9F-99D7-430D-AA61-2A6732D08B73","type":"f","value":1,"nodeType":"Float"},{"uuid":"102BDA9C-1661-4764-9CBB-7376970F3DDE","type":"i","value":0,"nodeType":"Int"},{"uuid":"0B953891-B25F-4E60-A2F5-6F201D8DEBCE","type":"f","value":30,"nodeType":"Float"},{"uuid":"E22FDA75-4FCC-4054-ACCD-3ED754D858A9","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"5F7F9FD1-31AE-4160-A232-33E07CD8E0BE","type":"f","value":10,"nodeType":"Float"},{"uuid":"6987D3EB-5FAE-4A7A-8B80-C8D4216FE73E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"3C2C53F4-3F7D-4F55-A325-E7509B460E48","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"B118EE41-B040-4051-8D21-77D6A8CDB053","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"705D423D-179B-40E2-829F-8B3EF3613526","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"0E3BCC9F-70CB-4101-A150-8F8EB72DDD54","project":false,"nodeType":"Texture"},{"uuid":"0E3BCC9F-70CB-4101-A150-8F8EB72DDD54","type":"v2","index":0,"nodeType":"UV"},{"uuid":"A0813A0A-942A-4514-BFA6-782146AACF16","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"10653DBF-F119-4450-80FE-38CF12DB8A16","project":false,"nodeType":"Texture"},{"uuid":"10653DBF-F119-4450-80FE-38CF12DB8A16","type":"v2","index":0,"nodeType":"UV"},{"uuid":"31F70C41-F0A8-442F-80C5-A5AEADEF9557","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"012C29F8-CC9A-42C9-A591-2BA265EAC759","type":"f","value":1,"nodeType":"Float"},{"uuid":"541ED7AB-D3D1-4C46-A3A5-411C6544B668","type":"i","value":0,"nodeType":"Int"},{"uuid":"F653182E-A893-4452-BE42-BD6343BFB093","type":"f","value":50,"nodeType":"Float"},{"uuid":"81CE29B1-134D-42AB-BA86-0667716857F5","type":"f","value":264,"nodeType":"Float"},{"uuid":"1820E89E-5FDF-42DB-8591-3CA6BE145D22","type":"f","value":1,"nodeType":"Float"},{"uuid":"411D6225-E76D-47F3-91E8-199F6FC45054","type":"f","value":0,"nodeType":"Float"},{"uuid":"3B016C55-558B-46AA-9711-E47435D8ACC5","type":"v3","x":-103,"y":-40,"z":202,"nodeType":"Vector3"},{"uuid":"62AEF880-2524-4057-9215-121E2F49B7D1","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"4D2B4869-26F1-492B-9B5C-206F55E6226E","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"624D80B0-A341-420F-82E9-E47EC9C1D894","type":"f","value":1,"nodeType":"Float"},{"uuid":"2672D4F9-2420-497F-B16F-7E7E20C94B91","type":"i","value":2,"nodeType":"Int"},{"uuid":"ECC897B0-7106-403B-A826-85FFF0EB533C","type":"c","r":0.28627450980392155,"g":0.4549019607843137,"b":1,"value":4814079,"nodeType":"Color"},{"uuid":"53AAB4E9-BECA-4F8A-B100-DA7A53F6A8DA","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"58F7140C-66B5-4165-96A3-99E24FCC8CAF","type":"f","value":1,"nodeType":"Float"},{"uuid":"9D653E82-C20B-4ECC-81CF-D9CE46EAD821","type":"f","value":2,"nodeType":"Float"},{"uuid":"E895251B-1A4D-48B7-AC95-097A493A5EE8","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"7DC39B2C-6B55-4C71-B72B-4A86C5888A95","type":"f","value":1,"nodeType":"Float"},{"uuid":"87483C50-79E7-4179-9033-D2C18FF3B270","type":"i","value":2,"nodeType":"Int"},{"uuid":"BB264838-F363-4DE0-8BFE-F5BE2CB9C1C8","type":"phong","color":"D3D5DDDB-6F17-4DF5-9896-E022059B8555","specular":"E22FDA75-4FCC-4054-ACCD-3ED754D858A9","shininess":"0B953891-B25F-4E60-A2F5-6F201D8DEBCE","shadingAlpha":"F3E3AF9F-99D7-430D-AA61-2A6732D08B73","shadingBlend":"102BDA9C-1661-4764-9CBB-7376970F3DDE","afterColor":"EB73FBCE-6F80-47D9-84B4-8A5554FB7226","alpha":"F377FDF2-2104-4E6F-9E63-AB321EF80952","nodeType":"Phong"},{"uuid":"D3D5DDDB-6F17-4DF5-9896-E022059B8555","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"EB73FBCE-6F80-47D9-84B4-8A5554FB7226","type":"v3","a":"046ACA33-70F0-4E91-AB5F-B51752E3742F","b":"0E8E1CB6-8BDB-4A03-A708-368199EA17CF","alpha":"EE73F6B9-FAE8-410B-BF06-28D2B1B4F780","mode":"87483C50-79E7-4179-9033-D2C18FF3B270","nodeType":"Blend"},{"uuid":"046ACA33-70F0-4E91-AB5F-B51752E3742F","type":"v3","a":"FAE793E2-A82B-4028-9041-1302E787CADE","b":"4E46EB7D-70EC-47D2-B176-88F664F89A16","alpha":"78CB4B53-7C95-4B7C-84F1-7DCD4BC81997","mode":"2672D4F9-2420-497F-B16F-7E7E20C94B91","nodeType":"Blend"},{"uuid":"FAE793E2-A82B-4028-9041-1302E787CADE","type":"v3","a":"148FF2F1-5F53-4C18-91ED-3D010E18031E","b":"7778AFC7-C89E-41FA-A970-F749E470B4C1","alpha":"E1C22AF9-2B6A-432D-A258-B58559AF3904","mode":"541ED7AB-D3D1-4C46-A3A5-411C6544B668","nodeType":"Blend"},{"uuid":"148FF2F1-5F53-4C18-91ED-3D010E18031E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"7778AFC7-C89E-41FA-A970-F749E470B4C1","type":"v3","thickness":"5F7F9FD1-31AE-4160-A232-33E07CD8E0BE","ior":"6987D3EB-5FAE-4A7A-8B80-C8D4216FE73E","roughness":"3C2C53F4-3F7D-4F55-A325-E7509B460E48","alpha":"012C29F8-CC9A-42C9-A591-2BA265EAC759","calpha":"g7778AFC7C89E41FAA970F749E470B4C1_calpha","nodeType":"Transmission"},{"uuid":"E1C22AF9-2B6A-432D-A258-B58559AF3904","type":"f","src":"g7778AFC7C89E41FAA970F749E470B4C1_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"4E46EB7D-70EC-47D2-B176-88F664F89A16","type":"v3","near":"F653182E-A893-4452-BE42-BD6343BFB093","far":"81CE29B1-134D-42AB-BA86-0667716857F5","isVector":"1820E89E-5FDF-42DB-8591-3CA6BE145D22","isWorldSpace":"411D6225-E76D-47F3-91E8-199F6FC45054","origin":"3B016C55-558B-46AA-9711-E47435D8ACC5","colorA":"62AEF880-2524-4057-9215-121E2F49B7D1","colorB":"4D2B4869-26F1-492B-9B5C-206F55E6226E","alpha":"624D80B0-A341-420F-82E9-E47EC9C1D894","nodeType":"Depth"},{"uuid":"78CB4B53-7C95-4B7C-84F1-7DCD4BC81997","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"624D80B0-A341-420F-82E9-E47EC9C1D894"},"nodeType":"Expression"},{"uuid":"0E8E1CB6-8BDB-4A03-A708-368199EA17CF","type":"v3","color":"ECC897B0-7106-403B-A826-85FFF0EB533C","bias":"53AAB4E9-BECA-4F8A-B100-DA7A53F6A8DA","scale":"58F7140C-66B5-4165-96A3-99E24FCC8CAF","intensity":"9D653E82-C20B-4ECC-81CF-D9CE46EAD821","factor":"E895251B-1A4D-48B7-AC95-097A493A5EE8","alpha":"7DC39B2C-6B55-4C71-B72B-4A86C5888A95","mode":"87483C50-79E7-4179-9033-D2C18FF3B270","calpha":"g0E8E1CB68BDB4A03A708368199EA17CF_calpha","nodeType":"Fresnel"},{"uuid":"EE73F6B9-FAE8-410B-BF06-28D2B1B4F780","type":"f","src":"g0E8E1CB68BDB4A03A708368199EA17CF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F377FDF2-2104-4E6F-9E63-AB321EF80952","type":"f","value":1,"nodeType":"Float"},{"uuid":"D7629B1E-02EC-4D77-82BD-A388386043E3","type":"f","value":1,"nodeType":"Float"},{"uuid":"33811EF2-A6B8-4042-9C6C-8EBE214FAF6D","type":"i","value":0,"nodeType":"Int"},{"uuid":"1C6684DD-F233-4349-B376-B18EBEA24898","type":"f","value":30,"nodeType":"Float"},{"uuid":"D652A07D-C761-4C06-82DD-33FAA2B0FEAD","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"A2AA9206-C4A9-4249-B5D2-B654E2B6FC6C","type":"f","value":10,"nodeType":"Float"},{"uuid":"D3616FD2-71EC-4D86-9240-9D7D50CD9E53","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"4DBDDB88-8E36-4A9C-9F79-EFBAECF8DD88","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"23C6C823-6151-4F1A-AC6E-822F11D583BC","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"78B98B2F-8B10-4DD5-9FA8-6695BB14C91D","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"05271F0A-911A-4F5F-A74B-42E1DE40DDD1","type":"f","value":1,"nodeType":"Float"},{"uuid":"915AAD79-9C78-40E6-BD71-A6019656CBAC","type":"i","value":0,"nodeType":"Int"},{"uuid":"0C66A8AB-16C4-4D0C-8D9B-AD40C471FFAE","type":"f","value":50,"nodeType":"Float"},{"uuid":"7F13A951-4AF8-40DA-A9B3-461EED8AF1B3","type":"f","value":395,"nodeType":"Float"},{"uuid":"C62C29CE-D460-4017-B6E9-DF02E7729266","type":"f","value":1,"nodeType":"Float"},{"uuid":"EDC4DC12-4F82-4153-88FD-5C85DEF219B9","type":"f","value":0,"nodeType":"Float"},{"uuid":"16447837-59B7-4622-AB96-3F4066A01051","type":"v3","x":-103,"y":-40,"z":202,"nodeType":"Vector3"},{"uuid":"4BE69034-B838-4B39-8A27-1E88363681AA","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"C87EAD46-A2E0-4ABD-A46E-C4891ADE1C39","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"61135000-6615-428A-AE39-097DC5CE1094","type":"f","value":1,"nodeType":"Float"},{"uuid":"3E594976-F8BC-469E-8031-E1484B4AFCF0","type":"i","value":2,"nodeType":"Int"},{"uuid":"94ED5572-2D19-4B14-8E33-14C1D77C21B9","type":"c","r":0.28627450980392155,"g":0.45098039215686275,"b":1,"value":4813823,"nodeType":"Color"},{"uuid":"65BC394B-D1D5-4D1A-8B4A-F217C546EB6F","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"F21B4381-44AD-484C-8CFD-3F0D51971219","type":"f","value":1,"nodeType":"Float"},{"uuid":"C681BCF7-47C7-404A-A283-6D4C33FDD39C","type":"f","value":2,"nodeType":"Float"},{"uuid":"AA63B105-3C3A-4887-96E0-DEA94CD38488","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"717AE919-122A-4498-8569-5323883ECFFF","type":"f","value":1,"nodeType":"Float"},{"uuid":"8FA8789B-D81E-4808-9874-50DF2450EDC5","type":"i","value":2,"nodeType":"Int"},{"uuid":"ECED4DEC-AC09-42FF-BCB4-422DC7CFD531","type":"f","value":1,"nodeType":"Float"},{"uuid":"A1F1C8CD-1E57-4773-96BF-8F555EF59489","type":"i","value":0,"nodeType":"Int"},{"uuid":"089B8258-4756-42F5-9B1F-660055820BDE","type":"f","value":30,"nodeType":"Float"},{"uuid":"4BF405F8-D1E4-4C4F-8D92-3690831A1A9D","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"02894D8C-61AD-4BA1-9098-CB25B68A84DF","type":"f","value":10,"nodeType":"Float"},{"uuid":"4684C3D9-2B52-4D13-B87C-38B6CF688ECD","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"A10FBCAA-DA97-438A-8D92-284643A05EEE","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"46C9030B-8D25-4123-AD69-A59FB161FD64","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"69A1884F-7EFA-4714-AECB-62ACE3C834CA","type":"v2","x":0.506640625,"y":1,"nodeType":"Vector2"},{"uuid":"E3F5A097-E117-45AC-BAF2-8A66DE8665A5","type":"f","value":1,"nodeType":"Float"},{"uuid":"2B00D9D5-F62B-488B-88B9-ACFA16DDB3FA","type":"i","value":0,"nodeType":"Int"},{"uuid":"A2CE6C51-DF51-4B44-AAF0-CA7E2CD1D744","type":"f","value":50,"nodeType":"Float"},{"uuid":"0B66C73F-1774-4C77-B784-2A135EB2604B","type":"f","value":168,"nodeType":"Float"},{"uuid":"08B9C2DC-C1E8-44F6-98A9-A3A61A6FDDDD","type":"f","value":1,"nodeType":"Float"},{"uuid":"D11F3F92-6F11-4EF7-97CB-6CAE93970B90","type":"f","value":0,"nodeType":"Float"},{"uuid":"6D23A188-7D3F-4DA7-8164-F04F36EBE573","type":"v3","x":-76,"y":-40,"z":-50,"nodeType":"Vector3"},{"uuid":"5F7F198C-D50C-4F95-BC15-4DC74F456DFA","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"F369DEC4-AD9E-4769-A026-CABD58D91478","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"7FE8F585-7F8E-4CBD-91D3-61F1203749DC","type":"f","value":1,"nodeType":"Float"},{"uuid":"073536A9-555A-425F-9F7E-BFA674AF4443","type":"i","value":2,"nodeType":"Int"},{"uuid":"2765E471-A42A-4060-8362-34301ECA4A5F","type":"c","r":0.1607843137254902,"g":0.3137254901960784,"b":0.8156862745098039,"value":2707664,"nodeType":"Color"},{"uuid":"0CB42569-449D-4994-8891-7D79429405CC","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"4DF47492-8810-4B1A-900F-1500C860567E","type":"f","value":1,"nodeType":"Float"},{"uuid":"D1F8A716-1F10-4767-A7A1-99A554DBC968","type":"f","value":2,"nodeType":"Float"},{"uuid":"B64E2E96-1497-4074-83EF-4F43588C8C1B","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"A3E9C48A-E567-4E63-80E5-6D49D80F70C6","type":"f","value":1,"nodeType":"Float"},{"uuid":"F5E27EF4-E53A-4B40-8736-BA90DBB0A6BD","type":"i","value":2,"nodeType":"Int"},{"uuid":"EC5958E6-6D9E-4A34-AA59-F64751B0D15A","type":"f","value":1,"nodeType":"Float"},{"uuid":"9797CCD6-3EF2-4F93-AE15-18922F7FAE99","type":"i","value":0,"nodeType":"Int"},{"uuid":"C696EC60-9463-42FA-A631-A1693E60078C","type":"f","value":30,"nodeType":"Float"},{"uuid":"25777677-2FA4-47E3-81B6-61B55D3134F9","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"40420D6C-C8DC-4CF1-A69E-68CE3AC0B922","type":"f","value":10,"nodeType":"Float"},{"uuid":"A1C20BE9-AAC1-489E-9435-DCBD1842042F","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"806668D2-DFAF-4F12-89B9-4F448484FE14","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"64581A62-E63A-4D05-9F36-652826A52BBE","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"4218C3B7-A9CA-405C-A3D2-00F954828C8F","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"5143D9DF-FDE7-40AF-B250-2B4940C23FC6","project":false,"nodeType":"Texture"},{"uuid":"5143D9DF-FDE7-40AF-B250-2B4940C23FC6","type":"v2","index":0,"nodeType":"UV"},{"uuid":"98456443-6F02-4EBD-BA1D-9B6326B9754D","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"A2B6807F-CDF4-4D54-B165-52D3A5639F55","project":false,"nodeType":"Texture"},{"uuid":"A2B6807F-CDF4-4D54-B165-52D3A5639F55","type":"v2","index":0,"nodeType":"UV"},{"uuid":"E1E3E577-03E3-4FA0-9803-185BA3A9862A","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"81C42831-F8E4-4067-A898-A662BE2C385A","type":"f","value":1,"nodeType":"Float"},{"uuid":"B35BCFCB-26F3-45ED-A509-529497848A32","type":"i","value":0,"nodeType":"Int"},{"uuid":"FB2D4319-DAFB-41E2-B547-9201D098298B","type":"f","value":50,"nodeType":"Float"},{"uuid":"4FA681DC-17B4-4167-ACEA-76AD97D6E086","type":"f","value":395,"nodeType":"Float"},{"uuid":"17AC2720-E8CD-4952-99AB-83DF8CC65ECB","type":"f","value":1,"nodeType":"Float"},{"uuid":"9408ED5E-F919-4E68-A668-1C256DA0407B","type":"f","value":0,"nodeType":"Float"},{"uuid":"9AB87A13-E568-431A-A9CB-A09C7D5443B9","type":"v3","x":-103,"y":-40,"z":202,"nodeType":"Vector3"},{"uuid":"D56E1A4F-817E-44B7-86A8-D7BB3B041411","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"BC1F8B74-D4ED-448F-B64B-582033119D35","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"F88D76E9-893E-4698-9C20-E47F0D96E5E0","type":"f","value":1,"nodeType":"Float"},{"uuid":"1571B315-0EED-4272-93E1-A6AE6625C26F","type":"i","value":2,"nodeType":"Int"},{"uuid":"FF043C84-8324-4296-86BF-E9D1D84B86AB","type":"c","r":0.28627450980392155,"g":0.45098039215686275,"b":1,"value":4813823,"nodeType":"Color"},{"uuid":"7835C5C6-D9ED-4B81-BB52-C71A7260DDA2","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"32854021-F981-4C8C-8430-03EF232C6372","type":"f","value":1,"nodeType":"Float"},{"uuid":"1BFBF410-6821-4FD6-8EB3-8101CC445CB1","type":"f","value":2,"nodeType":"Float"},{"uuid":"B41047EA-6F2A-4E6C-9BB7-514B252982B4","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"1A93B872-7891-4D7A-89D1-0CCDAB18DAE1","type":"f","value":1,"nodeType":"Float"},{"uuid":"55559687-A382-4137-927B-4839E301C3FC","type":"i","value":2,"nodeType":"Int"},{"uuid":"A78E61A6-3485-47DC-A241-F2EB6E30B300","type":"phong","color":"0A51F1D9-0C90-4533-BDD5-6735288B4192","specular":"25777677-2FA4-47E3-81B6-61B55D3134F9","shininess":"C696EC60-9463-42FA-A631-A1693E60078C","shadingAlpha":"EC5958E6-6D9E-4A34-AA59-F64751B0D15A","shadingBlend":"9797CCD6-3EF2-4F93-AE15-18922F7FAE99","afterColor":"80F6CF09-0F6F-410B-8D1C-1E44FEEBCEB0","alpha":"21B6F8AC-C3E5-47AA-A726-851521ABFB2F","nodeType":"Phong"},{"uuid":"0A51F1D9-0C90-4533-BDD5-6735288B4192","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"80F6CF09-0F6F-410B-8D1C-1E44FEEBCEB0","type":"v3","a":"A18249BF-2267-4924-AF1C-8ECCDBE26A85","b":"EB3064B0-A31A-4F1D-85C2-B8AF0CD9A934","alpha":"8DA828DC-4D4B-404E-BD24-FF8CEF275235","mode":"55559687-A382-4137-927B-4839E301C3FC","nodeType":"Blend"},{"uuid":"A18249BF-2267-4924-AF1C-8ECCDBE26A85","type":"v3","a":"53AA3A6F-05A1-41C6-99DC-2FE450DE570A","b":"615981B6-E495-4918-A52C-7DBD2569CE36","alpha":"6DBE6DF6-3405-4D03-9B01-E25B07AA545C","mode":"1571B315-0EED-4272-93E1-A6AE6625C26F","nodeType":"Blend"},{"uuid":"53AA3A6F-05A1-41C6-99DC-2FE450DE570A","type":"v3","a":"C4145967-F311-4AEA-82EB-B96C594D4A2A","b":"1ECFE8B7-E9E0-4D98-9E02-1200E1133368","alpha":"A6AD8EBB-895A-4897-9037-BFA40C9975B5","mode":"B35BCFCB-26F3-45ED-A509-529497848A32","nodeType":"Blend"},{"uuid":"C4145967-F311-4AEA-82EB-B96C594D4A2A","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"1ECFE8B7-E9E0-4D98-9E02-1200E1133368","type":"v3","thickness":"40420D6C-C8DC-4CF1-A69E-68CE3AC0B922","ior":"A1C20BE9-AAC1-489E-9435-DCBD1842042F","roughness":"806668D2-DFAF-4F12-89B9-4F448484FE14","alpha":"81C42831-F8E4-4067-A898-A662BE2C385A","calpha":"g1ECFE8B7E9E04D989E021200E1133368_calpha","nodeType":"Transmission"},{"uuid":"A6AD8EBB-895A-4897-9037-BFA40C9975B5","type":"f","src":"g1ECFE8B7E9E04D989E021200E1133368_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"615981B6-E495-4918-A52C-7DBD2569CE36","type":"v3","near":"FB2D4319-DAFB-41E2-B547-9201D098298B","far":"4FA681DC-17B4-4167-ACEA-76AD97D6E086","isVector":"17AC2720-E8CD-4952-99AB-83DF8CC65ECB","isWorldSpace":"9408ED5E-F919-4E68-A668-1C256DA0407B","origin":"9AB87A13-E568-431A-A9CB-A09C7D5443B9","colorA":"D56E1A4F-817E-44B7-86A8-D7BB3B041411","colorB":"BC1F8B74-D4ED-448F-B64B-582033119D35","alpha":"F88D76E9-893E-4698-9C20-E47F0D96E5E0","nodeType":"Depth"},{"uuid":"6DBE6DF6-3405-4D03-9B01-E25B07AA545C","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"F88D76E9-893E-4698-9C20-E47F0D96E5E0"},"nodeType":"Expression"},{"uuid":"EB3064B0-A31A-4F1D-85C2-B8AF0CD9A934","type":"v3","color":"FF043C84-8324-4296-86BF-E9D1D84B86AB","bias":"7835C5C6-D9ED-4B81-BB52-C71A7260DDA2","scale":"32854021-F981-4C8C-8430-03EF232C6372","intensity":"1BFBF410-6821-4FD6-8EB3-8101CC445CB1","factor":"B41047EA-6F2A-4E6C-9BB7-514B252982B4","alpha":"1A93B872-7891-4D7A-89D1-0CCDAB18DAE1","mode":"55559687-A382-4137-927B-4839E301C3FC","calpha":"gEB3064B0A31A4F1D85C2B8AF0CD9A934_calpha","nodeType":"Fresnel"},{"uuid":"8DA828DC-4D4B-404E-BD24-FF8CEF275235","type":"f","src":"gEB3064B0A31A4F1D85C2B8AF0CD9A934_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"21B6F8AC-C3E5-47AA-A726-851521ABFB2F","type":"f","value":1,"nodeType":"Float"},{"uuid":"E397B9A8-7218-4E7D-BB06-B3E851361CBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"7C4915EA-AB08-4E03-9FF3-1A4643980C64","type":"i","value":0,"nodeType":"Int"},{"uuid":"55F00D93-EE69-4150-A0BE-83B39131092B","type":"f","value":30,"nodeType":"Float"},{"uuid":"5F7B7637-9FDB-46CC-A0F4-9FEB2E2175B0","type":"c","r":0.5686274509803921,"g":0.5686274509803921,"b":0.5686274509803921,"value":9539985,"nodeType":"Color"},{"uuid":"265D96C8-EDA1-4F8F-80FE-0B27F065BA50","type":"f","value":10,"nodeType":"Float"},{"uuid":"591C4D5B-C51C-4869-AA6F-37A76419517C","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"747BC561-705E-4125-80B9-86E4ACF22A97","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"F19EB058-A12B-41AB-BD31-5E2D09845783","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"C4D697CC-AFE1-4C98-9B61-679942ADAEA0","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"ED91D8CE-C09C-4C0E-98F9-910CE51DECF1","project":false,"nodeType":"Texture"},{"uuid":"ED91D8CE-C09C-4C0E-98F9-910CE51DECF1","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5ACBF950-D91F-464D-A29E-0E0C2B640454","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"E25D96A9-A2C8-42AC-9528-E74ED41BEB08","project":false,"nodeType":"Texture"},{"uuid":"E25D96A9-A2C8-42AC-9528-E74ED41BEB08","type":"v2","index":0,"nodeType":"UV"},{"uuid":"3857E7DA-9D35-4F1C-A1D9-BB36BD5CA774","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"85613281-9B5F-4538-8BB8-4CDFDFFE1C97","type":"f","value":1,"nodeType":"Float"},{"uuid":"26878463-19E4-4DF0-9235-BB5A7728FD96","type":"i","value":0,"nodeType":"Int"},{"uuid":"F33F5641-D75E-4CF2-AE61-D424135438DC","type":"f","value":50,"nodeType":"Float"},{"uuid":"0F849EF0-9C01-4BE2-AE99-4CC52C626031","type":"f","value":361,"nodeType":"Float"},{"uuid":"79578348-97F1-47B5-93D7-B5747604A4FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"9A0AFD39-3916-4046-B7AA-EB04EA9E5D37","type":"f","value":0,"nodeType":"Float"},{"uuid":"1CA6FA3D-274B-429E-926F-7D0A48AB8630","type":"v3","x":0,"y":-173,"z":-50,"nodeType":"Vector3"},{"uuid":"7D007604-317E-4E2C-A12D-41B98D522AD2","type":"c","r":0,"g":0,"b":0,"value":0,"nodeType":"Color"},{"uuid":"53C722C1-7D99-41AC-9FFF-998217E720A5","type":"c","r":0,"g":0.26666666666666666,"b":0.9490196078431372,"value":17650,"nodeType":"Color"},{"uuid":"3719BABB-8CA5-4CD8-B7D5-14FFE5A8E354","type":"f","value":1,"nodeType":"Float"},{"uuid":"AA423DFE-1EB1-4D25-9A93-19365B9CA33D","type":"i","value":2,"nodeType":"Int"},{"uuid":"3408E833-4CED-43B1-8F78-58EAA8DEA70F","type":"c","r":0.28627450980392155,"g":0.4549019607843137,"b":1,"value":4814079,"nodeType":"Color"},{"uuid":"23749EF7-25B5-4D6B-B568-ABC724D84EBE","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"C7F0311A-4FDD-4503-8CD7-C0BFFCDE36C2","type":"f","value":1,"nodeType":"Float"},{"uuid":"AE4E882A-06DF-486B-86F0-E20296669322","type":"f","value":2,"nodeType":"Float"},{"uuid":"E229B714-B25C-4B16-9414-2F2879A61602","type":"f","value":0.85,"nodeType":"Float"},{"uuid":"636ED21B-2F4E-4C0E-9640-CE7EFC37CE8E","type":"f","value":1,"nodeType":"Float"},{"uuid":"97A024BC-3FBB-4E92-A067-079EA7743C5F","type":"i","value":2,"nodeType":"Int"},{"uuid":"C1D2394B-BE61-4204-AD84-A4197E18D522","type":"phong","color":"07B58498-6B5E-4608-B7F9-3E6B1A42F36E","specular":"5F7B7637-9FDB-46CC-A0F4-9FEB2E2175B0","shininess":"55F00D93-EE69-4150-A0BE-83B39131092B","shadingAlpha":"E397B9A8-7218-4E7D-BB06-B3E851361CBC","shadingBlend":"7C4915EA-AB08-4E03-9FF3-1A4643980C64","afterColor":"F2C80A99-2ABE-49D7-9219-B2A7305705E8","alpha":"E83A8318-4297-46CD-B966-05E81D0BA5AA","nodeType":"Phong"},{"uuid":"07B58498-6B5E-4608-B7F9-3E6B1A42F36E","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"F2C80A99-2ABE-49D7-9219-B2A7305705E8","type":"v3","a":"E059342F-D280-4469-BBA9-4FBB1175D15B","b":"E4EB1D33-A235-47BD-8D72-CBC957EAB95F","alpha":"8A6FE753-DA3C-4961-9B61-C69CA4EA75AF","mode":"97A024BC-3FBB-4E92-A067-079EA7743C5F","nodeType":"Blend"},{"uuid":"E059342F-D280-4469-BBA9-4FBB1175D15B","type":"v3","a":"FA89086F-33C2-44D1-9CB2-FFF01C10EC2F","b":"A79C941C-F4B3-4E84-A05D-27687B0B3551","alpha":"6B96513E-2662-4610-8696-802DBF8ADD62","mode":"AA423DFE-1EB1-4D25-9A93-19365B9CA33D","nodeType":"Blend"},{"uuid":"FA89086F-33C2-44D1-9CB2-FFF01C10EC2F","type":"v3","a":"B4B8967A-48EB-4E97-B669-2B360AD26CA4","b":"F785B9B3-6D0E-4E12-A34D-3430433B3680","alpha":"D1C71B59-CAED-4E3C-967E-0F6E9877C19E","mode":"26878463-19E4-4DF0-9235-BB5A7728FD96","nodeType":"Blend"},{"uuid":"B4B8967A-48EB-4E97-B669-2B360AD26CA4","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"F785B9B3-6D0E-4E12-A34D-3430433B3680","type":"v3","thickness":"265D96C8-EDA1-4F8F-80FE-0B27F065BA50","ior":"591C4D5B-C51C-4869-AA6F-37A76419517C","roughness":"747BC561-705E-4125-80B9-86E4ACF22A97","alpha":"85613281-9B5F-4538-8BB8-4CDFDFFE1C97","calpha":"gF785B9B36D0E4E12A34D3430433B3680_calpha","nodeType":"Transmission"},{"uuid":"D1C71B59-CAED-4E3C-967E-0F6E9877C19E","type":"f","src":"gF785B9B36D0E4E12A34D3430433B3680_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A79C941C-F4B3-4E84-A05D-27687B0B3551","type":"v3","near":"F33F5641-D75E-4CF2-AE61-D424135438DC","far":"0F849EF0-9C01-4BE2-AE99-4CC52C626031","isVector":"79578348-97F1-47B5-93D7-B5747604A4FA","isWorldSpace":"9A0AFD39-3916-4046-B7AA-EB04EA9E5D37","origin":"1CA6FA3D-274B-429E-926F-7D0A48AB8630","colorA":"7D007604-317E-4E2C-A12D-41B98D522AD2","colorB":"53C722C1-7D99-41AC-9FFF-998217E720A5","alpha":"3719BABB-8CA5-4CD8-B7D5-14FFE5A8E354","nodeType":"Depth"},{"uuid":"6B96513E-2662-4610-8696-802DBF8ADD62","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"3719BABB-8CA5-4CD8-B7D5-14FFE5A8E354"},"nodeType":"Expression"},{"uuid":"E4EB1D33-A235-47BD-8D72-CBC957EAB95F","type":"v3","color":"3408E833-4CED-43B1-8F78-58EAA8DEA70F","bias":"23749EF7-25B5-4D6B-B568-ABC724D84EBE","scale":"C7F0311A-4FDD-4503-8CD7-C0BFFCDE36C2","intensity":"AE4E882A-06DF-486B-86F0-E20296669322","factor":"E229B714-B25C-4B16-9414-2F2879A61602","alpha":"636ED21B-2F4E-4C0E-9640-CE7EFC37CE8E","mode":"97A024BC-3FBB-4E92-A067-079EA7743C5F","calpha":"gE4EB1D33A23547BD8D72CBC957EAB95F_calpha","nodeType":"Fresnel"},{"uuid":"8A6FE753-DA3C-4961-9B61-C69CA4EA75AF","type":"f","src":"gE4EB1D33A23547BD8D72CBC957EAB95F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"E83A8318-4297-46CD-B966-05E81D0BA5AA","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[2560,1297],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":36,"g":36,"b":36,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/spline/design/value_light/index.html b/site/spline/design/value_light/index.html deleted file mode 100644 index 19a8a91aa..000000000 --- a/site/spline/design/value_light/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Untitled - - - - - - -
    - -
    - - - diff --git a/site/spline/design/value_light/runtime.js b/site/spline/design/value_light/runtime.js deleted file mode 100644 index 5cf2c0ba5..000000000 --- a/site/spline/design/value_light/runtime.js +++ /dev/null @@ -1,4395 +0,0 @@ -var oA=Object.create;var Pl=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,uA=Object.getOwnPropertyNames,Ag=Object.getOwnPropertySymbols,hA=Object.getPrototypeOf,_g=Object.prototype.hasOwnProperty,dA=Object.prototype.propertyIsEnumerable;var Tg=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ue=(r,e)=>{for(var t in e||(e={}))_g.call(e,t)&&Tg(r,t,e[t]);if(Ag)for(var t of Ag(e))dA.call(e,t)&&Tg(r,t,e[t]);return r},tt=(r,e)=>aA(r,cA(e)),Eg=r=>Pl(r,"__esModule",{value:!0});var Ng=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fA=(r,e)=>{Eg(r);for(var t in e)Pl(r,t,{get:e[t],enumerable:!0})},pA=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uA(e))!_g.call(r,n)&&n!=="default"&&Pl(r,n,{get:()=>e[n],enumerable:!(t=lA(e,n))||t.enumerable});return r},Cg=r=>pA(Eg(Pl(r!=null?oA(hA(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var Y0=Ng($h=>{"use strict";$h.byteLength=Z2;$h.toByteArray=eI;$h.fromByteArray=iI;var yr=[],Li=[],Q2=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Po=0,X0=Om.length;Po0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function Z2(r){var e=q0(r),t=e[0],n=e[1];return(t+n)*3/4-n}function $2(r,e,t){return(e+t)*3/4-t}function eI(r){var e,t=q0(r),n=t[0],i=t[1],s=new Q2($2(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[r.charCodeAt(l)]<<2|Li[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Li[r.charCodeAt(l)]<<10|Li[r.charCodeAt(l+1)]<<4|Li[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function tI(r){return yr[r>>18&63]+yr[r>>12&63]+yr[r>>6&63]+yr[r&63]}function nI(r,e,t){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=r[t-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}});var tA=Ng((Xd,eA)=>{(function(r,e){typeof Xd=="object"&&typeof eA!="undefined"?e(Xd):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis!="undefined"?globalThis:r||self).SVDJS={})})(Xd,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,c,u,h,d,f,p,m,v,g,y=e[0].length,x=e.length;if(x>8&255]+Cn[r>>16&255]+Cn[r>>24&255]+"-"+Cn[e&255]+Cn[e>>8&255]+"-"+Cn[e>>16&15|64]+Cn[e>>24&255]+"-"+Cn[t&63|128]+Cn[t>>8&255]+"-"+Cn[t>>16&255]+Cn[t>>24&255]+Cn[n&255]+Cn[n>>8&255]+Cn[n>>16&255]+Cn[n>>24&255]).toUpperCase()}function Ln(r,e,t){return Math.max(e,Math.min(t,r))}function nf(r,e){return(r%e+e)%e}function k_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function V_(r,e,t){return r!==e?(t-r)/(e-r):0}function Fl(r,e,t){return(1-t)*r+t*e}function H_(r,e,t,n){return Fl(r,e,1-Math.exp(-t*n))}function j_(r,e=1){return e-Math.abs(nf(r,e*2)-e)}function W_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function J_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function X_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function q_(r,e){return r+Math.random()*(e-r)}function Y_(r){return r*(.5-Math.random())}function K_(r){return r!==void 0&&(Eu=r%2147483647),Eu=Eu*16807%2147483647,(Eu-1)/2147483646}function Q_(r){return r*Qo}function Z_(r){return r*Ol}function rf(r){return(r&r-1)==0&&r!==0}function $g(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function ey(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $_(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),d=o((e-n)/2),f=s((n-e)/2),p=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*d,a*c);break;case"YZY":r.set(l*d,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*d,a*u,a*c);break;case"XZX":r.set(a*u,l*p,l*f,a*c);break;case"YXY":r.set(l*f,a*u,l*p,a*c);break;case"ZYZ":r.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}var Ee=Object.freeze({__proto__:null,DEG2RAD:Qo,RAD2DEG:Ol,generateUUID:fi,clamp:Ln,euclideanModulo:nf,mapLinear:k_,inverseLerp:V_,lerp:Fl,damp:H_,pingpong:j_,smoothstep:W_,smootherstep:J_,randInt:X_,randFloat:q_,randFloatSpread:Y_,seededRandom:K_,degToRad:Q_,radToDeg:Z_,isPowerOfTwo:rf,ceilPowerOfTwo:$g,floorPowerOfTwo:ey,setQuaternionFromProperEuler:$_}),O=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}};O.prototype.isVector2=!0;var Dt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],m=i[0],v=i[3],g=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return s[0]=o*m+a*y+l*w,s[3]=o*v+a*x+l*_,s[6]=o*g+a*b+l*S,s[1]=c*m+u*y+h*w,s[4]=c*v+u*x+h*_,s[7]=c*g+u*b+h*S,s[2]=d*m+f*y+p*w,s[5]=d*v+f*x+p*_,s[8]=d*g+f*b+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,p=t*h+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=h*m,e[1]=(i*c-u*n)*m,e[2]=(a*n-i*o)*m,e[3]=d*m,e[4]=(u*t-i*l)*m,e[5]=(i*s-a*t)*m,e[6]=f*m,e[7]=(n*l-c*t)*m,e[8]=(o*t-n*s)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],o=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=t*s+n*l,i[3]=t*o+n*c,i[6]=t*a+n*u,i[1]=-n*s+t*l,i[4]=-n*o+t*c,i[7]=-n*a+t*u,this}translate(e,t){let n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Dt.prototype.isMatrix3=!0;var Zo,Zs=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Zo===void 0&&(Zo=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Zo.width=e.width,Zo.height=e.height;let n=Zo.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Zo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}},e1=0,xt=class extends cn{constructor(e=xt.DEFAULT_IMAGE,t=xt.DEFAULT_MAPPING,n=Zt,i=Zt,s=$e,o=Ai,a=zt,l=At,c=1,u=ln){super();Object.defineProperty(this,"id",{value:e1++}),this.uuid=fi(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new O(0,0),this.repeat=new O(1,1),this.center=new O(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){let i=this.image;if(i.uuid===void 0&&(i.uuid=fi()),!t&&e.images[i.uuid]===void 0){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o1)switch(this.wrapS){case di:e.x=e.x-Math.floor(e.x);break;case Zt:e.x=e.x<0?0:1;break;case qr:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case di:e.y=e.y-Math.floor(e.y);break;case Zt:e.y=e.y<0?0:1;break;case qr:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};xt.DEFAULT_IMAGE=void 0;xt.DEFAULT_MAPPING=Kd;xt.prototype.isTexture=!0;function sf(r){return typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap?Zs.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Qe=class{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s,o=.01,a=.1,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],m=l[2],v=l[6],g=l[10];if(Math.abs(u-d)b&&x>w?xw?b=0?1:-1,x=1-g*g;if(x>Number.EPSILON){let w=Math.sqrt(x),_=Math.atan2(w,g*y);v=Math.sin(v*_)/w,a=Math.sin(a*_)/w}let b=a*y;if(l=l*v+d*b,c=c*v+f*b,u=u*v+p*b,h=h*v+m*b,v===1-a){let w=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=w,c*=w,u*=w,h*=w}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],d=s[o+1],f=s[o+2],p=s[o+3];return e[t]=a*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-a*f,e[t+2]=c*p+u*f+a*d-l*h,e[t+3]=u*p-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),d=l(n/2),f=l(i/2),p=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+a+h;if(d>0){let f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-i)*f}else if(n>a&&n>h){let f=2*Math.sqrt(1+n-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(s+c)/f}else if(a>h){let f=2*Math.sqrt(1+a-n-h);this._w=(s-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{let f=2*Math.sqrt(1+h-n-a);this._w=(o-i)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let f=1-t;return this._w=f*o+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){this.copy(e).slerp(t,n)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var M=class{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ny.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ny.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,d=-s*t-o*n-a*i;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return of.copy(this).projectOnVector(e),this.sub(of)}reflect(e){return this.sub(of.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ln(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return n!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}};M.prototype.isVector3=!0;var of=new M,ny=new Tt,tn=class{constructor(e=new M(1/0,1/0,1/0),t=new M(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,n,i),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,zl),zl.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Gl),Nu.subVectors(this.max,Gl),$o.subVectors(e.a,Gl),ea.subVectors(e.b,Gl),ta.subVectors(e.c,Gl),$r.subVectors(ea,$o),es.subVectors(ta,ea),$s.subVectors($o,ta);let t=[0,-$r.z,$r.y,0,-es.z,es.y,0,-$s.z,$s.y,$r.z,0,-$r.x,es.z,0,-es.x,$s.z,0,-$s.x,-$r.y,$r.x,0,-es.y,es.x,0,-$s.y,$s.x,0];return!lf(t,$o,ea,ta,Nu)||(t=[1,0,0,0,1,0,0,0,1],!lf(t,$o,ea,ta,Nu))?!1:(Cu.crossVectors($r,es),t=[Cu.x,Cu.y,Cu.z],lf(t,$o,ea,ta,Nu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return zl.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(zl).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};tn.prototype.isBox3=!0;var Nr=[new M,new M,new M,new M,new M,new M,new M,new M],zl=new M,af=new tn,$o=new M,ea=new M,ta=new M,$r=new M,es=new M,$s=new M,Gl=new M,Nu=new M,Cu=new M,eo=new M;function lf(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){eo.fromArray(r,s);let a=i.x*Math.abs(eo.x)+i.y*Math.abs(eo.y)+i.z*Math.abs(eo.z),l=e.dot(eo),c=t.dot(eo),u=n.dot(eo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var t1=new tn,iy=new M,cf=new M,uf=new M,ti=class{constructor(e=new M,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):t1.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){uf.subVectors(e,this.center);let t=uf.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.add(uf.multiplyScalar(i/n)),this.radius+=i}return this}union(e){return cf.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(iy.copy(e.center).add(cf)),this.expandByPoint(iy.copy(e.center).sub(cf)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Cr=new M,hf=new M,Lu=new M,ts=new M,df=new M,Iu=new M,ff=new M,or=class{constructor(e=new M,t=new M(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Cr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cr.copy(this.direction).multiplyScalar(t).add(this.origin),Cr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){hf.copy(e).add(t).multiplyScalar(.5),Lu.copy(t).sub(e).normalize(),ts.copy(this.origin).sub(hf);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Lu),a=ts.dot(this.direction),l=-ts.dot(Lu),c=ts.lengthSq(),u=Math.abs(1-o*o),h,d,f,p;if(u>0)if(h=o*l-a,d=o*a-l,p=s*u,h>=0)if(d>=-p)if(d<=p){let m=1/u;h*=m,d*=m,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Lu).multiplyScalar(d).add(hf),f}intersectSphere(e,t){Cr.subVectors(e.center,this.origin);let n=Cr.dot(this.direction),i=Cr.dot(Cr)-n*n,s=e.radius*e.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),n>o||s>i||((s>n||n!==n)&&(n=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Cr)!==null}intersectTriangle(e,t,n,i,s){df.subVectors(t,e),Iu.subVectors(n,e),ff.crossVectors(df,Iu);let o=this.direction.dot(ff),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ts.subVectors(this.origin,e);let l=a*this.direction.dot(Iu.crossVectors(ts,Iu));if(l<0)return null;let c=a*this.direction.dot(df.cross(ts));if(c<0||l+c>o)return null;let u=-a*ts.dot(ff);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},me=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,o,a,l,c,u,h,d,f,p,m,v){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new me().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,i=1/na.setFromMatrixColumn(e,0).length(),s=1/na.setFromMatrixColumn(e,1).length(),o=1/na.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-m*c,t[9]=-a*l,t[2]=m-d*c,t[6]=p+f*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d+m*a,t[4]=p*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-p,t[6]=m+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,f=l*h,p=c*u,m=c*h;t[0]=d-m*a,t[4]=-o*h,t[8]=p+f*a,t[1]=f+p*a,t[5]=o*u,t[9]=m-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,f=o*h,p=a*u,m=a*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+m,t[1]=l*h,t[5]=m*c+d,t[9]=f*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=m-d*h,t[8]=p*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-m*h}else if(e.order==="XZY"){let d=o*l,f=o*c,p=a*l,m=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+m,t[5]=o*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=a*u,t[10]=m*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(n1,e,i1)}lookAt(e,t,n){let i=this.elements;return pi.subVectors(e,t),pi.lengthSq()===0&&(pi.z=1),pi.normalize(),ns.crossVectors(n,pi),ns.lengthSq()===0&&(Math.abs(n.z)===1?pi.x+=1e-4:pi.z+=1e-4,pi.normalize(),ns.crossVectors(n,pi)),ns.normalize(),Pu.crossVectors(pi,ns),i[0]=ns.x,i[4]=Pu.x,i[8]=pi.x,i[1]=ns.y,i[5]=Pu.y,i[9]=pi.y,i[2]=ns.z,i[6]=Pu.z,i[10]=pi.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],m=n[6],v=n[10],g=n[14],y=n[3],x=n[7],b=n[11],w=n[15],_=i[0],S=i[4],A=i[8],T=i[12],L=i[1],C=i[5],U=i[9],P=i[13],R=i[2],G=i[6],B=i[10],j=i[14],ne=i[3],le=i[7],W=i[11],z=i[15];return s[0]=o*_+a*L+l*R+c*ne,s[4]=o*S+a*C+l*G+c*le,s[8]=o*A+a*U+l*B+c*W,s[12]=o*T+a*P+l*j+c*z,s[1]=u*_+h*L+d*R+f*ne,s[5]=u*S+h*C+d*G+f*le,s[9]=u*A+h*U+d*B+f*W,s[13]=u*T+h*P+d*j+f*z,s[2]=p*_+m*L+v*R+g*ne,s[6]=p*S+m*C+v*G+g*le,s[10]=p*A+m*U+v*B+g*W,s[14]=p*T+m*P+v*j+g*z,s[3]=y*_+x*L+b*R+w*ne,s[7]=y*S+x*C+b*G+w*le,s[11]=y*A+x*U+b*B+w*W,s[15]=y*T+x*P+b*j+w*z,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],m=e[7],v=e[11],g=e[15];return p*(+s*l*h-i*c*h-s*a*d+n*c*d+i*a*f-n*l*f)+m*(+t*l*f-t*c*d+s*o*d-i*o*f+i*c*u-s*l*u)+v*(+t*c*h-t*a*f-s*o*h+n*o*f+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*d+i*o*h-n*o*d+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=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[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,p=s*h,m=o*u,v=o*h,g=a*h,y=l*c,x=l*u,b=l*h,w=n.x,_=n.y,S=n.z;return i[0]=(1-(m+g))*w,i[1]=(f+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(f-b)*_,i[5]=(1-(d+g))*_,i[6]=(v+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(v-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements,s=na.set(i[0],i[1],i[2]).length(),o=na.set(i[4],i[5],i[6]).length(),a=na.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],zi.copy(this);let c=1/s,u=1/o,h=1/a;return zi.elements[0]*=c,zi.elements[1]*=c,zi.elements[2]*=c,zi.elements[4]*=u,zi.elements[5]*=u,zi.elements[6]*=u,zi.elements[8]*=h,zi.elements[9]*=h,zi.elements[10]*=h,t.setFromRotationMatrix(zi),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(n-i),u=(t+e)/(t-e),h=(n+i)/(n-i),d=-(o+s)/(o-s),f=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,o){let a=this.elements,l=1/(t-e),c=1/(n-i),u=1/(o-s),h=(t+e)*l,d=(n+i)*c,f=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};me.prototype.isMatrix4=!0;var na=new M,zi=new me,n1=new M(0,0,0),i1=new M(1,1,1),ns=new M,Pu=new M,pi=new M,ry=new me,sy=new Tt,On=class{constructor(e=0,t=0,n=0,i=On.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sy.setFromEuler(this),this.setFromQuaternion(sy,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};On.prototype.isEuler=!0;On.DefaultOrder="XYZ";On.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var pf=class{constructor(){this.mask=1|0}set(e){this.mask=1<1){for(let t=0;t1){for(let n=0;n0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f)}return n.object=i,n;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Gi.subVectors(i,t),Ir.subVectors(n,t),mf.subVectors(e,t);let o=Gi.dot(Gi),a=Gi.dot(Ir),l=Gi.dot(mf),c=Ir.dot(Ir),u=Ir.dot(mf),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,f=(c*l-a*u)*d,p=(o*u-a*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Pr),Pr.x>=0&&Pr.y>=0&&Pr.x+Pr.y<=1}static getUV(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,Pr),l.set(0,0),l.addScaledVector(s,Pr.x),l.addScaledVector(o,Pr.y),l.addScaledVector(a,Pr.z),l}static isFrontFacing(e,t,n,i){return Gi.subVectors(n,t),Ir.subVectors(e,t),Gi.cross(Ir).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Gi.subVectors(this.c,this.b),Ir.subVectors(this.a,this.b),Gi.cross(Ir).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return qt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return qt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return qt.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return qt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return qt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,i=this.b,s=this.c,o,a;ra.subVectors(i,n),sa.subVectors(s,n),gf.subVectors(e,n);let l=ra.dot(gf),c=sa.dot(gf);if(l<=0&&c<=0)return t.copy(n);yf.subVectors(e,i);let u=ra.dot(yf),h=sa.dot(yf);if(u>=0&&h<=u)return t.copy(i);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(ra,o);vf.subVectors(e,s);let f=ra.dot(vf),p=sa.dot(vf);if(p>=0&&f<=p)return t.copy(s);let m=f*c-l*p;if(m<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(n).addScaledVector(sa,a);let v=u*p-f*h;if(v<=0&&h-u>=0&&f-p>=0)return hy.subVectors(s,i),a=(h-u)/(h-u+(f-p)),t.copy(i).addScaledVector(hy,a);let g=1/(v+m+d);return o=m*g,a=d*g,t.copy(n).addScaledVector(ra,o).addScaledVector(sa,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},l1=0,nn=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:l1++}),this.uuid=fi(),this.name="",this.type="Material",this.fog=!0,this.blending=Vs,this.side=Oi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Gg,this.blendDst=Ug,this.blendEquation=Vo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=U_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tf,this.stencilZFail=tf,this.stencilZPass=tf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===Dg;continue}let i=this[t];if(i===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(n.specularTint=this.specularTint.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(n.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationTint!==void 0&&(n.attenuationTint=this.attenuationTint.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Vs&&(n.blending=this.blending),this.side!==Oi&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};nn.prototype.isMaterial=!0;var dy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ui={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function xf(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function bf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wf(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var fe=class{constructor(e,t,n){return t===void 0&&n===void 0?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=nf(e,1),t=Ln(t,0,1),n=Ln(n,0,1),t===0)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=xf(s,i,e+1/3),this.g=xf(s,i,e),this.b=xf(s,i,e-1/3)}return this}setStyle(e){function t(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let i,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(i[1])/360,l=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return t(i[4]),this.setHSL(a,l,c)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],s=i.length;if(s===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dy[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=bf(e.r),this.g=bf(e.g),this.b=bf(e.b),this}copyLinearToSRGB(e){return this.r=wf(e.r),this.g=wf(e.g),this.b=wf(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,n=this.g,i=this.b,s=Math.max(t,n,i),o=Math.min(t,n,i),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(n-i)/u+(ne&&(e=r[t]);return e}var c1={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(r,e){return new c1[r](e)}var u1=0,_i=new me,Af=new Ke,aa=new M,mi=new tn,kl=new tn,Mn=new M,we=class extends cn{constructor(){super();Object.defineProperty(this,"id",{value:u1++}),this.uuid=fi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(py(e)>65535?is:Mf)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new Dt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _i.makeRotationFromQuaternion(e),this.applyMatrix4(_i),this}rotateX(e){return _i.makeRotationX(e),this.applyMatrix4(_i),this}rotateY(e){return _i.makeRotationY(e),this.applyMatrix4(_i),this}rotateZ(e){return _i.makeRotationZ(e),this.applyMatrix4(_i),this}translate(e,t,n){return _i.makeTranslation(e,t,n),this.applyMatrix4(_i),this}scale(e,t,n){return _i.makeScale(e,t,n),this.applyMatrix4(_i),this}lookAt(e){return Af.lookAt(e),Af.updateMatrix(),this.applyMatrix4(Af.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(aa).negate(),this.translate(aa.x,aa.y,aa.z),this}setFromPoints(e){let t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let l in n){let c=n[l];e.data.attributes[l]=c.toJSON(e.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new we().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone(t));let i=e.attributes;for(let c in i){let u=i[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,f=h.length;d0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let n=this.geometry,i=this.material,s=this.matrixWorld;if(i===void 0||(n.boundingSphere===null&&n.computeBoundingSphere(),_f.copy(n.boundingSphere),_f.applyMatrix4(s),e.ray.intersectsSphere(_f)===!1)||(my.copy(s).invert(),la.copy(e.ray).applyMatrix4(my),n.boundingBox!==null&&la.intersectsBox(n.boundingBox)===!1))return;let o;if(n.isBufferGeometry){let a=n.index,l=n.attributes.position,c=n.morphAttributes.position,u=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,f=n.groups,p=n.drawRange;if(a!==null)if(Array.isArray(i))for(let m=0,v=f.length;mt.far?null:{distance:c,point:Vu.clone(),object:r}}function Hu(r,e,t,n,i,s,o,a,l,c,u,h){rs.fromBufferAttribute(i,c),ss.fromBufferAttribute(i,u),os.fromBufferAttribute(i,h);let d=r.morphTargetInfluences;if(s&&d){Ou.set(0,0,0),Fu.set(0,0,0),zu.set(0,0,0);for(let p=0,m=s.length;p0?1:-1,u.push(le.x,le.y,le.z),h.push(D/S),h.push(1-W/A),j+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}};_t.prototype.isShaderMaterial=!0;var Dr=class extends Ke{constructor(){super();this.type="Camera",this.matrixWorldInverse=new me,this.projectionMatrix=new me,this.projectionMatrixInverse=new me}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Dr.prototype.isCamera=!0;var Vt=class extends Dr{constructor(e=50,t=1,n=.1,i=2e3){super();this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Ol*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Qo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ol*2*Math.atan(Math.tan(Qo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Qo*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Vt.prototype.isPerspectiveCamera=!0;var ua=90,ha=1,ju=class extends Ke{constructor(e,t,n){super();if(this.type="CubeCamera",n.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=n;let i=new Vt(ua,ha,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new M(1,0,0)),this.add(i);let s=new Vt(ua,ha,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new M(-1,0,0)),this.add(s);let o=new Vt(ua,ha,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new M(0,1,0)),this.add(o);let a=new Vt(ua,ha,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new M(0,-1,0)),this.add(a);let l=new Vt(ua,ha,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new M(0,0,1)),this.add(l);let c=new Vt(ua,ha,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new M(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let n=this.renderTarget,[i,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u}},as=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:js,a=a!==void 0?a:Nt;super(e,t,n,i,s,o,a,l,c,u);this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};as.prototype.isCubeTexture=!0;var Lf=class extends bt{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n);super(e,e,t);t=t||{},this.texture=new as(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:$e,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=zt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new jn(5,5,5),s=new _t({name:"CubemapFromEquirect",uniforms:ca(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:kt,blending:It});s.uniforms.tEquirect.value=t;let o=new gt(i,s),a=t.minFilter;return t.minFilter===Ai&&(t.minFilter=$e),new ju(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}};Lf.prototype.isWebGLCubeRenderTarget=!0;var If=new M,p1=new M,m1=new Dt,ni=class{constructor(e=new M(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let i=If.subVectors(n,t).cross(p1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let n=e.delta(If),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||m1.getNormalMatrix(e),i=this.coplanarPoint(If).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};ni.prototype.isPlane=!0;var da=new ti,Wu=new M,Vl=class{constructor(e=new ni,t=new ni,n=new ni,i=new ni,s=new ni,o=new ni){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){let t=this.planes,n=e.elements,i=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15];return t[0].setComponents(a-i,h-l,m-d,x-v).normalize(),t[1].setComponents(a+i,h+l,m+d,x+v).normalize(),t[2].setComponents(a+s,h+c,m+f,x+g).normalize(),t[3].setComponents(a-s,h-c,m-f,x-g).normalize(),t[4].setComponents(a-o,h-u,m-p,x-y).normalize(),t[5].setComponents(a+o,h+u,m+p,x+y).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),da.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSprite(e){return da.center.set(0,0,0),da.radius=.7071067811865476,da.applyMatrix4(e.matrixWorld),this.intersectsSphere(da)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function gy(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function g1(r,e){let t=e.isWebGL2,n=new WeakMap;function i(c,u){let h=c.array,d=c.usage,f=r.createBuffer();r.bindBuffer(u,f),r.bufferData(u,h,d),c.onUploadCallback();let p=5126;return h instanceof Float32Array?p=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?p=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):p=5123:h instanceof Int16Array?p=5122:h instanceof Uint32Array?p=5125:h instanceof Int32Array?p=5124:h instanceof Int8Array?p=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(p=5121),{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,f=u.updateRange;r.bindBuffer(h,c),f.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d,f.offset,f.count):r.bufferSubData(h,f.offset*d.BYTES_PER_ELEMENT,d.subarray(f.offset,f.offset+f.count)),f.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=n.get(c);(!d||d.version 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -#else - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; -#endif -} -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in vec3 f90, const in float dotVH ) { - float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); - return ( f90 - f0 ) * fresnel + f0; -} -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - return Fr * fresnel + F0; -} -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - return 1.0 / ( gl * gv ); -} -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in vec3 f90, const in float roughness ) { - float alpha = pow2( roughness ); - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotLH ); - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( G * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - return specularColor * brdf.x + brdf.y; -} -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -float G_BlinnPhong_Implicit( ) { - return 0.25; -} -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); -} -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - vec3 F = F_Schlick( specularColor, vec3( 1.0 ), dotLH ); - float G = G_BlinnPhong_Implicit( ); - float D = D_BlinnPhong( shininess, dotNH ); - return F * ( G * D ); -} -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} -#if defined( USE_SHEEN ) -float D_Charlie(float roughness, float NoH) { - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} -float V_Neubelt(float NoV, float NoL) { - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); -} -#endif`,_1=`#ifdef USE_BUMPMAP - uniform sampler2D bumpMap; - uniform float bumpScale; - vec2 dHdxy_fwd() { - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - return vec2( dBx, dBy ); - } - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - float fDet = dot( vSigmaX, R1 ) * faceDirection; - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - } -#endif`,T1=`#if NUM_CLIPPING_PLANES > 0 - vec4 plane; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif -#endif`,E1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,N1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,C1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,L1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,I1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,P1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,D1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,R1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement(a) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - float distance = dot( planeNormal, point - pointOnPlane ); - return - distance * planeNormal + point; -} -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - return sign( dot( point - pointOnPlane, planeNormal ) ); -} -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float linearToRelativeLuminance( const in vec3 color ) { - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - return dot( weights, color.rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -}`,B1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_maxMipLevel 8.0 - #define cubeUV_minMipLevel 4.0 - #define cubeUV_maxTileSize 256.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); - vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); - vec2 f = fract( uv ); - uv += 0.5 - f; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if ( mipInt < cubeUV_maxMipLevel ) { - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); - uv *= texelSize; - vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x += texelSize; - vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.y += texelSize; - vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - uv.x -= texelSize; - vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - return mix( tm, bm, f.y ); - } - #define r0 1.0 - #define v0 0.339 - #define m0 - 2.0 - #define r1 0.8 - #define v1 0.276 - #define m1 - 1.0 - #define r4 0.4 - #define v4 0.046 - #define m4 2.0 - #define r5 0.305 - #define v5 0.016 - #define m5 3.0 - #define r6 0.21 - #define v6 0.0038 - #define m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= r1 ) { - mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; - } else if ( roughness >= r4 ) { - mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; - } else if ( roughness >= r5 ) { - mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; - } else if ( roughness >= r6 ) { - mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,O1=`vec3 transformedNormal = objectNormal; -#ifdef USE_INSTANCING - mat3 m = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); - transformedNormal = m * transformedNormal; -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,F1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,z1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,G1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,k1="gl_FragColor = linearToOutputTexel( gl_FragColor );",V1=` -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -} -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -}`,H1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifndef ENVMAP_TYPE_CUBE_UV - envColor = envMapTexelToLinear( envColor ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,j1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,W1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,J1=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,X1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,q1=`#ifdef USE_FOG - fogDepth = - mvPosition.z; -#endif`,Y1=`#ifdef USE_FOG - varying float fogDepth; -#endif`,K1=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Q1=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float fogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Z1=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return texture2D( gradientMap, coord ).rgb; - #else - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - #endif -}`,$1=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; -#endif`,eT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,tT=`vec3 diffuse = vec3( 1.0 ); -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; -vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); -vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); -#ifdef DOUBLE_SIDED - vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); - vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); -#endif -#if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end -#endif -#if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end -#endif`,nT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - if ( angleCos > spotLight.coneCos ) { - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - } else { - directLight.color = vec3( 0.0 ); - directLight.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - return irradiance; - } -#endif`,iT=`#if defined( USE_ENVMAP ) - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - #else - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - #else - vec4 envMapColor = vec4( 0.0 ); - #endif - return PI * envMapColor.rgb * envMapIntensity; - } - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - float maxMIPLevelScalar = float( maxMIPLevel ); - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - } - vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( -viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - #else - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - #endif - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - #ifdef ENVMAP_TYPE_CUBE - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - #ifdef TEXTURE_LOD_EXT - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - #else - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - #endif - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - #endif - return envMapColor.rgb * envMapIntensity; - } -#endif`,rT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,oT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aT=`varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,lT=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; -material.specularRoughness = min( material.specularRoughness, 1.0 ); -#ifdef REFLECTIVITY - #ifdef SPECULAR - vec3 specularIntensityFactor = vec3( specularIntensity ); - vec3 specularTintFactor = specularTint; - #ifdef USE_SPECULARINTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; - #endif - #ifdef USE_SPECULARTINTMAP - specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb; - #endif - material.specularColorF90 = mix( specularIntensityFactor, vec3( 1.0 ), metalnessFactor ); - #else - vec3 specularIntensityFactor = vec3( 1.0 ); - vec3 specularTintFactor = vec3( 1.0 ); - material.specularColorF90 = vec3( 1.0 ); - #endif - material.specularColor = mix( min( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - material.specularColorF90 = vec3( 1.0 ); -#endif -#ifdef CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_SHEEN - material.sheenColor = sheen; -#endif`,cT=`struct PhysicalMaterial { - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - vec3 specularColorF90; -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif -}; -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - #ifdef CLEARCOAT - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = ccDotNL * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - ccIrradiance *= PI; - #endif - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), vec3( 1.0 ), material.clearcoatRoughness ); - #else - float clearcoatDHR = 0.0; - #endif - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularColorF90, material.specularRoughness); - #endif - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef CLEARCOAT - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - #else - float clearcoatDHR = 0.0; - #endif - float clearcoatInv = 1.0 - clearcoatDHR; - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,uT=` -GeometricContext geometry; -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -#ifdef CLEARCOAT - geometry.clearcoatNormal = clearcoatNormal; -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hT=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #ifndef PHYSICALLY_CORRECT_LIGHTS - lightMapIrradiance *= PI; - #endif - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - #ifdef CLEARCOAT - clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - #endif -#endif`,dT=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,fT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,pT=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,mT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,gT=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,yT=`#ifdef USE_MAP - vec4 texelColor = texture2D( map, vUv ); - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; -#endif`,vT=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,xT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; -#endif -#ifdef USE_MAP - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bT=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,wT=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - metalnessFactor *= texelMetalness.b; -#endif`,ST=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,MT=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; -#endif`,AT=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif -#endif`,_T=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif -#endif`,TT=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - #ifdef USE_TANGENT - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - #ifdef DOUBLE_SIDED - tangent = tangent * faceDirection; - bitangent = bitangent * faceDirection; - #endif - #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) - mat3 vTBN = mat3( tangent, bitangent, normal ); - #endif - #endif -#endif -vec3 geometryNormal = normal;`,ET=`#ifdef OBJECTSPACE_NORMALMAP - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( TANGENTSPACE_NORMALMAP ) - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - #ifdef USE_TANGENT - normal = normalize( vTBN * mapN ); - #else - normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); - #endif -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,NT=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef OBJECTSPACE_NORMALMAP - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - } -#endif`,CT=`#ifdef CLEARCOAT - vec3 clearcoatNormal = geometryNormal; -#endif`,LT=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - #ifdef USE_TANGENT - clearcoatNormal = normalize( vTBN * clearcoatMapN ); - #else - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); - #endif -#endif`,IT=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif`,PT=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,DT=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,RT=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BT=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,OT=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,FT=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zT=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,GT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - bool frustumTest = all( frustumTestVec ); - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,UT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,kT=`#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; - #endif - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif`,VT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,HT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,jT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - #ifdef BONE_TEXTURE - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - mat4 getBoneMatrix( const in float i ) { - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - y = dy * ( y + 0.5 ); - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - mat4 bone = mat4( v1, v2, v3, v4 ); - return bone; - } - #else - uniform mat4 boneMatrices[ MAX_BONES ]; - mat4 getBoneMatrix( const in float i ) { - mat4 bone = boneMatrices[ int(i) ]; - return bone; - } - #endif -#endif`,WT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,JT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,XT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,YT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,KT=`#ifndef saturate -#define saturate(a) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return toneMappingExposure * color; -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,QT=`#ifdef USE_TRANSMISSION - float transmissionFactor = transmission; - float thicknessFactor = thickness; - #ifdef USE_TRANSMISSIONMAP - transmissionFactor *= texture2D( transmissionMap, vUv ).r; - #endif - #ifdef USE_THICKNESSMAP - thicknessFactor *= texture2D( thicknessMap, vUv ).g; - #endif - vec3 pos = vWorldPosition.xyz / vWorldPosition.w; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); - vec3 transmission = transmissionFactor * getIBLVolumeRefraction( - n, v, roughnessFactor, material.diffuseColor, material.specularColor, - pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, - attenuationTint, attenuationDistance ); - totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); -#endif`,ZT=`#ifdef USE_TRANSMISSION - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec4 vWorldPosition; - vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { - vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); - vec3 modelScale; - modelScale.x = length(vec3(modelMatrix[0].xyz)); - modelScale.y = length(vec3(modelMatrix[1].xyz)); - modelScale.z = length(vec3(modelMatrix[2].xyz)); - return normalize(refractionVector) * thickness * modelScale; - } - float applyIorToRoughness(float roughness, float ior) { - return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); - } - vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { - float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); - return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; - } - vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { - if (attenuationDistance == 0.0) { - return radiance; - } else { - vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; - vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; - } - } - vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, - vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, - vec3 attenuationColor, float attenuationDistance) { - vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); - vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); - return (1.0 - specularColor) * attenuatedColor * baseColor; - } -#endif`,$T=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif`,eE=`#ifdef USE_UV - #ifdef UVS_VERTEX_ONLY - vec2 vUv; - #else - varying vec2 vUv; - #endif - uniform mat3 uvTransform; -#endif`,tE=`#ifdef USE_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,nE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; -#endif`,iE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; -#endif`,rE=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,sE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,oE=`uniform sampler2D t2D; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,aE=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lE=`#include -uniform float opacity; -varying vec3 vWorldDirection; -#include -void main() { - vec3 vReflect = vWorldDirection; - #include - gl_FragColor = envColor; - gl_FragColor.a *= opacity; - #include - #include -}`,cE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,uE=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - vec4 diffuseColor = vec4( 1.0 ); - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,hE=`#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,dE=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main () { - #include - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,fE=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,pE=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - vec4 texColor = texture2D( tEquirect, sampleUV ); - gl_FragColor = mapTexelToLinear( texColor ); - #include - #include -}`,mE=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,gE=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -void main() { - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,yE=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include -}`,vE=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - - vec4 lightMapTexel= texture2D( lightMap, vUv2 ); - reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,xE=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bE=`uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #ifdef DOUBLE_SIDED - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - #else - reflectedLight.indirectDiffuse += vIndirectFront; - #endif - #include - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - #ifdef DOUBLE_SIDED - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - #else - reflectedLight.directDiffuse = vLightFront; - #endif - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,wE=`#define LAMBERT -varying vec3 vLightFront; -varying vec3 vIndirectFront; -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,SE=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - #else - vec4 matcapColor = vec4( 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,ME=`#define MATCAP -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif - #endif - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,AE=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,_E=`#define TOON -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,TE=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,EE=`#define PHONG -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,NE=`#define STANDARD -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationTint; -#endif -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif -#ifdef SPECULAR - uniform float specularIntensity; - uniform vec3 specularTint; - #ifdef USE_SPECULARINTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif - #ifdef USE_SPECULARTINTMAP - uniform sampler2D specularTintMap; - #endif -#endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include - #include -}`,CE=`#define STANDARD -varying vec3 vViewPosition; -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#ifdef USE_TRANSMISSION - varying vec4 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition; -#endif -}`,LE=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); -}`,IE=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - varying vec3 vViewPosition; -#endif -#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include -#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - vViewPosition = - mvPosition.xyz; -#endif -}`,PE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include - #include -}`,DE=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,RE=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,BE=`#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,OE=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - #include - #include - #include -}`,FE=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,at={alphamap_fragment:y1,alphamap_pars_fragment:v1,alphatest_fragment:x1,aomap_fragment:b1,aomap_pars_fragment:w1,begin_vertex:S1,beginnormal_vertex:M1,bsdfs:A1,bumpmap_pars_fragment:_1,clipping_planes_fragment:T1,clipping_planes_pars_fragment:E1,clipping_planes_pars_vertex:N1,clipping_planes_vertex:C1,color_fragment:L1,color_pars_fragment:I1,color_pars_vertex:P1,color_vertex:D1,common:R1,cube_uv_reflection_fragment:B1,defaultnormal_vertex:O1,displacementmap_pars_vertex:F1,displacementmap_vertex:z1,emissivemap_fragment:G1,emissivemap_pars_fragment:U1,encodings_fragment:k1,encodings_pars_fragment:V1,envmap_fragment:H1,envmap_common_pars_fragment:j1,envmap_pars_fragment:W1,envmap_pars_vertex:J1,envmap_physical_pars_fragment:iT,envmap_vertex:X1,fog_vertex:q1,fog_pars_vertex:Y1,fog_fragment:K1,fog_pars_fragment:Q1,gradientmap_pars_fragment:Z1,lightmap_fragment:$1,lightmap_pars_fragment:eT,lights_lambert_vertex:tT,lights_pars_begin:nT,lights_toon_fragment:rT,lights_toon_pars_fragment:sT,lights_phong_fragment:oT,lights_phong_pars_fragment:aT,lights_physical_fragment:lT,lights_physical_pars_fragment:cT,lights_fragment_begin:uT,lights_fragment_maps:hT,lights_fragment_end:dT,logdepthbuf_fragment:fT,logdepthbuf_pars_fragment:pT,logdepthbuf_pars_vertex:mT,logdepthbuf_vertex:gT,map_fragment:yT,map_pars_fragment:vT,map_particle_fragment:xT,map_particle_pars_fragment:bT,metalnessmap_fragment:wT,metalnessmap_pars_fragment:ST,morphnormal_vertex:MT,morphtarget_pars_vertex:AT,morphtarget_vertex:_T,normal_fragment_begin:TT,normal_fragment_maps:ET,normalmap_pars_fragment:NT,clearcoat_normal_fragment_begin:CT,clearcoat_normal_fragment_maps:LT,clearcoat_pars_fragment:IT,packing:PT,premultiplied_alpha_fragment:DT,project_vertex:RT,dithering_fragment:BT,dithering_pars_fragment:OT,roughnessmap_fragment:FT,roughnessmap_pars_fragment:zT,shadowmap_pars_fragment:GT,shadowmap_pars_vertex:UT,shadowmap_vertex:kT,shadowmask_pars_fragment:VT,skinbase_vertex:HT,skinning_pars_vertex:jT,skinning_vertex:WT,skinnormal_vertex:JT,specularmap_fragment:XT,specularmap_pars_fragment:qT,tonemapping_fragment:YT,tonemapping_pars_fragment:KT,transmission_fragment:QT,transmission_pars_fragment:ZT,uv_pars_fragment:$T,uv_pars_vertex:eE,uv_vertex:tE,uv2_pars_fragment:nE,uv2_pars_vertex:iE,uv2_vertex:rE,worldpos_vertex:sE,background_frag:oE,background_vert:aE,cube_frag:lE,cube_vert:cE,depth_frag:uE,depth_vert:hE,distanceRGBA_frag:dE,distanceRGBA_vert:fE,equirect_frag:pE,equirect_vert:mE,linedashed_frag:gE,linedashed_vert:yE,meshbasic_frag:vE,meshbasic_vert:xE,meshlambert_frag:bE,meshlambert_vert:wE,meshmatcap_frag:SE,meshmatcap_vert:ME,meshtoon_frag:AE,meshtoon_vert:_E,meshphong_frag:TE,meshphong_vert:EE,meshphysical_frag:NE,meshphysical_vert:CE,normal_frag:LE,normal_vert:IE,points_frag:PE,points_vert:DE,shadow_frag:RE,shadow_vert:BE,sprite_frag:OE,sprite_vert:FE},be={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Dt},uv2Transform:{value:new Dt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new O(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new O(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Dt}}},ar={basic:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:at.meshbasic_vert,fragmentShader:at.meshbasic_frag},lambert:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshlambert_vert,fragmentShader:at.meshlambert_frag},phong:{uniforms:Fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:at.meshphong_vert,fragmentShader:at.meshphong_frag},standard:{uniforms:Fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag},toon:{uniforms:Fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new fe(0)}}]),vertexShader:at.meshtoon_vert,fragmentShader:at.meshtoon_frag},matcap:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:at.meshmatcap_vert,fragmentShader:at.meshmatcap_frag},points:{uniforms:Fn([be.points,be.fog]),vertexShader:at.points_vert,fragmentShader:at.points_frag},dashed:{uniforms:Fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:at.linedashed_vert,fragmentShader:at.linedashed_frag},depth:{uniforms:Fn([be.common,be.displacementmap]),vertexShader:at.depth_vert,fragmentShader:at.depth_frag},normal:{uniforms:Fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:at.normal_vert,fragmentShader:at.normal_frag},sprite:{uniforms:Fn([be.sprite,be.fog]),vertexShader:at.sprite_vert,fragmentShader:at.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null}},vertexShader:at.background_vert,fragmentShader:at.background_frag},cube:{uniforms:Fn([be.envmap,{opacity:{value:1}}]),vertexShader:at.cube_vert,fragmentShader:at.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:at.equirect_vert,fragmentShader:at.equirect_frag},distanceRGBA:{uniforms:Fn([be.common,be.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:at.distanceRGBA_vert,fragmentShader:at.distanceRGBA_frag},shadow:{uniforms:Fn([be.lights,be.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:at.shadow_vert,fragmentShader:at.shadow_frag}};ar.physical={uniforms:Fn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new O(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new fe(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new O},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new fe(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new fe(1,1,1)},specularTintMap:{value:null}}]),vertexShader:at.meshphysical_vert,fragmentShader:at.meshphysical_frag};function zE(r,e,t,n,i){let s=new fe(0),o=0,a,l,c=null,u=0,h=null;function d(p,m){let v=!1,g=m.isScene===!0?m.background:null;g&&g.isTexture&&(g=e.get(g));let y=r.xr,x=y.getSession&&y.getSession();x&&x.environmentBlendMode==="additive"&&(g=null),g===null?f(s,o):g&&g.isColor&&(f(g,1),v=!0),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),g&&(g.isCubeTexture||g.mapping===Js)?(l===void 0&&(l=new gt(new jn(1,1,1),new _t({name:"BackgroundCubeMaterial",uniforms:ca(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:kt,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(b,w,_){this.matrixWorld.copyPosition(_.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(l)),l.material.uniforms.envMap.value=g,l.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g.isRenderTargetTexture===!1?-1:1,(c!==g||u!==g.version||h!==r.toneMapping)&&(l.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(l,l.geometry,l.material,0,0,null)):g&&g.isTexture&&(a===void 0&&(a=new gt(new ls(2,2),new _t({name:"BackgroundMaterial",uniforms:ca(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,g.matrixAutoUpdate===!0&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),(c!==g||u!==g.version||h!==r.toneMapping)&&(a.material.needsUpdate=!0,c=g,u=g.version,h=r.toneMapping),p.unshift(a,a.geometry,a.material,0,0,null))}function f(p,m){t.buffers.color.setClear(p.r,p.g,p.b,m,i)}return{getClearColor:function(){return s},setClearColor:function(p,m=1){s.set(p),o=m,f(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(p){o=p,f(s,o)},render:d}}function GE(r,e,t,n){let i=r.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=m(null),c=l;function u(P,R,G,B,j){let ne=!1;if(o){let le=p(B,G,R);c!==le&&(c=le,d(c.object)),ne=v(B,j),ne&&g(B,j)}else{let le=R.wireframe===!0;(c.geometry!==B.id||c.program!==G.id||c.wireframe!==le)&&(c.geometry=B.id,c.program=G.id,c.wireframe=le,ne=!0)}P.isInstancedMesh===!0&&(ne=!0),j!==null&&t.update(j,34963),ne&&(S(P,R,G,B),j!==null&&r.bindBuffer(34963,t.get(j).buffer))}function h(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(P){return n.isWebGL2?r.bindVertexArray(P):s.bindVertexArrayOES(P)}function f(P){return n.isWebGL2?r.deleteVertexArray(P):s.deleteVertexArrayOES(P)}function p(P,R,G){let B=G.wireframe===!0,j=a[P.id];j===void 0&&(j={},a[P.id]=j);let ne=j[R.id];ne===void 0&&(ne={},j[R.id]=ne);let le=ne[B];return le===void 0&&(le=m(h()),ne[B]=le),le}function m(P){let R=[],G=[],B=[];for(let j=0;j=0){let D=j[W];if(D!==void 0){let K=D.normalized,q=D.itemSize,ee=t.get(D);if(ee===void 0)continue;let V=ee.buffer,de=ee.type,ae=ee.bytesPerElement;if(D.isInterleavedBufferAttribute){let te=D.data,X=te.stride,se=D.offset;te&&te.isInstancedInterleavedBuffer?(b(z,te.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=te.meshPerAttribute*te.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,X*ae,se*ae)}else D.isInstancedBufferAttribute?(b(z,D.meshPerAttribute),B._maxInstanceCount===void 0&&(B._maxInstanceCount=D.meshPerAttribute*D.count)):x(z),r.bindBuffer(34962,V),_(z,q,de,K,0,0)}else if(W==="instanceMatrix"){let K=t.get(P.instanceMatrix);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z+0,1),b(z+1,1),b(z+2,1),b(z+3,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z+0,4,ee,!1,64,0),r.vertexAttribPointer(z+1,4,ee,!1,64,16),r.vertexAttribPointer(z+2,4,ee,!1,64,32),r.vertexAttribPointer(z+3,4,ee,!1,64,48)}else if(W==="instanceColor"){let K=t.get(P.instanceColor);if(K===void 0)continue;let q=K.buffer,ee=K.type;b(z,1),r.bindBuffer(34962,q),r.vertexAttribPointer(z,3,ee,!1,12,0)}else if(le!==void 0){let K=le[W];if(K!==void 0)switch(K.length){case 2:r.vertexAttrib2fv(z,K);break;case 3:r.vertexAttrib3fv(z,K);break;case 4:r.vertexAttrib4fv(z,K);break;default:r.vertexAttrib1fv(z,K)}}}}w()}function A(){C();for(let P in a){let R=a[P];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P]}}function T(P){if(a[P.id]===void 0)return;let R=a[P.id];for(let G in R){let B=R[G];for(let j in B)f(B[j].object),delete B[j];delete R[G]}delete a[P.id]}function L(P){for(let R in a){let G=a[R];if(G[P.id]===void 0)continue;let B=G[P.id];for(let j in B)f(B[j].object),delete B[j];delete G[P.id]}}function C(){U(),c!==l&&(c=l,d(c.object))}function U(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:u,reset:C,resetDefaultState:U,dispose:A,releaseStatesOfGeometry:T,releaseStatesOfProgram:L,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function UE(r,e,t,n){let i=n.isWebGL2,s;function o(c){s=c}function a(c,u){r.drawArrays(s,c,u),t.update(u,s,1)}function l(c,u,h){if(h===0)return;let d,f;if(i)d=r,f="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[f](s,c,u,h),t.update(u,s,h)}this.setMode=o,this.render=a,this.renderInstances=l}function kE(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){let S=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(S){if(S==="highp"){if(r.getShaderPrecisionFormat(35633,36338).precision>0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext!="undefined"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext!="undefined"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),f=r.getParameter(3379),p=r.getParameter(34076),m=r.getParameter(34921),v=r.getParameter(36347),g=r.getParameter(36348),y=r.getParameter(36349),x=d>0,b=o||e.has("OES_texture_float"),w=x&&b,_=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:f,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function VE(r){let e=this,t=null,n=0,i=!1,s=!1,o=new ni,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,f){let p=h.length!==0||d||n!==0||i;return i=d,t=u(h,f,0),n=h.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,f){let p=h.clippingPlanes,m=h.clipIntersection,v=h.clipShadows,g=r.get(h);if(!i||p===null||p.length===0||s&&!v)s?u(null):c();else{let y=s?0:n,x=y*4,b=g.clippingState||null;l.value=b,b=u(p,d,x,f);for(let w=0;w!==x;++w)b[w]=t[w];g.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){let m=h!==null?h.length:0,v=null;if(m!==0){if(v=l.value,p!==!0||v===null){let g=f+m*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(v===null||v.length0){let c=r.getRenderTarget(),u=new Lf(l.height/2);return u.fromEquirectangularTexture(r,o),e.set(o,u),r.setRenderTarget(c),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}var Rr=class extends Dr{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super();this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Rr.prototype.isOrthographicCamera=!0;var fa=class extends _t{constructor(e){super(e);this.type="RawShaderMaterial"}};fa.prototype.isRawShaderMaterial=!0;var pa=4,cs=8,lr=Math.pow(2,cs),yy=[.125,.215,.35,.446,.526,.582],vy=cs-pa+1+yy.length,ma=20,cr={[ln]:0,[Fi]:1,[Rl]:2,[Mu]:3,[Au]:4,[_u]:5,[Qs]:6},to=new dn({side:kt,depthWrite:!1,depthTest:!1}),jE=new gt(new jn,to),Pf=new Rr,{_lodPlanes:Hl,_sizeLods:xy,_sigmas:Ju}=JE(),by=new fe,Df=null,no=(1+Math.sqrt(5))/2,ga=1/no,wy=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,no,ga),new M(0,no,-ga),new M(ga,0,no),new M(-ga,0,no),new M(no,ga,0),new M(-no,ga,0)];function Sy(r){let e=Math.max(r.r,r.g,r.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return r.multiplyScalar(Math.pow(2,-t)),(t+128)/255}var My=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=XE(ma),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Df=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Ty(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=_y(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?lr:0,lr,lr),u.setRenderTarget(i),p&&u.render(jE,a),u.render(e,a)}u.toneMapping=f,u.outputEncoding=d,u.autoClear=h}_textureToCubeUV(e,t){let n=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Ty()):this._equirectShader==null&&(this._equirectShader=_y());let i=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new gt(Hl[0],i),o=i.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=cr[e.encoding],o.outputEncoding.value=cr[t.texture.encoding],Xu(t,0,0,3*lr,2*lr),n.setRenderTarget(t),n.render(s,Pf)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ima&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${ma}`);let g=[],y=0;for(let _=0;_cs-pa?i-cs+pa:0);Xu(t,b,w,3*x,2*x),l.setRenderTarget(t),l.render(h,Pf)}};function WE(r){return r===void 0||r.type!==At?!1:r.encoding===ln||r.encoding===Fi||r.encoding===Qs}function JE(){let r=[],e=[],t=[],n=cs;for(let i=0;ics-pa?o=yy[i-cs+pa-1]:i==0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,v=new Float32Array(f*d*h),g=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let b=0;b2?0:-1,S=[w,_,0,w+2/3,_,0,w+2/3,_+1,0,w,_,0,w+2/3,_+1,0,w,_+1,0];v.set(S,f*d*b),g.set(u,p*d*b);let A=[b,b,b,b,b,b];y.set(A,m*d*b)}let x=new we;x.setAttribute("position",new Re(v,f)),x.setAttribute("uv",new Re(g,p)),x.setAttribute("faceIndex",new Re(y,m)),r.push(x),n>pa&&n--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function Ay(r){let e=new bt(3*lr,3*lr,r);return e.texture.mapping=Js,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Xu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function XE(r){let e=new Float32Array(r),t=new M(0,1,0);return new fa({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - ${Bf()} - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function _y(){let r=new O(1,1);return new fa({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform vec2 texelSize; - - ${Bf()} - - #include - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - vec2 f = fract( uv / texelSize - 0.5 ); - uv -= f * texelSize; - vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x += texelSize.x; - vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.y += texelSize.y; - vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - uv.x -= texelSize.x; - vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; - - vec3 tm = mix( tl, tr, f.x ); - vec3 bm = mix( bl, br, f.x ); - gl_FragColor.rgb = mix( tm, bm, f.y ); - - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Ty(){return new fa({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:cr[ln]},outputEncoding:{value:cr[ln]}},vertexShader:Rf(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - ${Bf()} - - void main() { - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; - gl_FragColor = linearToOutputTexel( gl_FragColor ); - - } - `,blending:It,depthTest:!1,depthWrite:!1})}function Rf(){return` - - precision mediump float; - precision mediump int; - - attribute vec3 position; - attribute vec2 uv; - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Bf(){return` - - uniform int inputEncoding; - uniform int outputEncoding; - - #include - - vec4 inputTexelToLinear( vec4 value ) { - - if ( inputEncoding == 0 ) { - - return value; - - } else if ( inputEncoding == 1 ) { - - return sRGBToLinear( value ); - - } else if ( inputEncoding == 2 ) { - - return RGBEToLinear( value ); - - } else if ( inputEncoding == 3 ) { - - return RGBMToLinear( value, 7.0 ); - - } else if ( inputEncoding == 4 ) { - - return RGBMToLinear( value, 16.0 ); - - } else if ( inputEncoding == 5 ) { - - return RGBDToLinear( value, 256.0 ); - - } else { - - return GammaToLinear( value, 2.2 ); - - } - - } - - vec4 linearToOutputTexel( vec4 value ) { - - if ( outputEncoding == 0 ) { - - return value; - - } else if ( outputEncoding == 1 ) { - - return LinearTosRGB( value ); - - } else if ( outputEncoding == 2 ) { - - return LinearToRGBE( value ); - - } else if ( outputEncoding == 3 ) { - - return LinearToRGBM( value, 7.0 ); - - } else if ( outputEncoding == 4 ) { - - return LinearToRGBM( value, 16.0 ); - - } else if ( outputEncoding == 5 ) { - - return LinearToRGBD( value, 256.0 ); - - } else { - - return LinearToGamma( value, 2.2 ); - - } - - } - - vec4 envMapTexelToLinear( vec4 color ) { - - return inputTexelToLinear( color ); - - } - `}function qE(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){let l=a.mapping,c=l===vu||l===xu,u=l===js||l===Ws;if(c||u){if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){let d=r.getRenderTarget();t===null&&(t=new My(r));let f=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),r.setRenderTarget(d),a.addEventListener("dispose",s),f.texture}else return null}}}return a}function i(a){let l=0,c=6;for(let u=0;u65535?is:Mf)(d,1);v.version=m;let g=s.get(h);g&&e.remove(g),s.set(h,v)}function u(h){let d=s.get(h);if(d){let f=h.index;f!==null&&d.version0)return r;let i=e*t,s=Cy[i];if(s===void 0&&(s=new Float32Array(i),Cy[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t0)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(jl).join(` -`)}function KN(r){let e=[];for(let t in r){let n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function QN(r,e){let t={},n=r.getProgramParameter(e,35721);for(let i=0;i/gm;function zf(r){return r.replace(ZN,$N)}function $N(r,e){let t=at[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return zf(t)}var eC=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,tC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Hy(r){return r.replace(tC,jy).replace(eC,nC)}function nC(r,e,t,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),jy(r,e,t,n)}function jy(r,e,t,n){let i="";for(let s=parseInt(e);s0?r.gammaFactor:1,f=t.isWebGL2?"":YN(t),p=KN(s),m=i.createProgram(),v,g,y=t.glslVersion?"#version "+t.glslVersion+` -`:"";t.isRawShaderMaterial?(v=[p].filter(jl).join(` -`),v.length>0&&(v+=` -`),g=[f,p].filter(jl).join(` -`),g.length>0&&(g+=` -`)):(v=[Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(jl).join(` -`),g=[f,Wy(t),"#define SHADER_NAME "+t.shaderName,p,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularTintMap?"#define USE_SPECULARTINTMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.sheen?"#define USE_SHEEN":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Hs?"#define TONE_MAPPING":"",t.toneMapping!==Hs?at.tonemapping_pars_fragment:"",t.toneMapping!==Hs?qN("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",at.encodings_pars_fragment,t.map?va("mapTexelToLinear",t.mapEncoding):"",t.matcap?va("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?va("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?va("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.specularTintMap?va("specularTintMapTexelToLinear",t.specularTintMapEncoding):"",t.lightMap?va("lightMapTexelToLinear",t.lightMapEncoding):"",XN("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(jl).join(` -`)),o=zf(o),o=ky(o,t),o=Vy(o,t),a=zf(a),a=ky(a,t),a=Vy(a,t),o=Hy(o),a=Hy(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,v=["#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+v,g=["#define varying in",t.glslVersion===Zg?"":"out highp vec4 pc_fragColor;",t.glslVersion===Zg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+g);let x=y+v+o,b=y+g+a,w=zy(i,35633,x),_=zy(i,35632,b);if(i.attachShader(m,w),i.attachShader(m,_),t.index0AttributeName!==void 0?i.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),r.debug.checkShaderErrors){let T=i.getProgramInfoLog(m).trim(),L=i.getShaderInfoLog(w).trim(),C=i.getShaderInfoLog(_).trim(),U=!0,P=!0;if(i.getProgramParameter(m,35714)===!1){U=!1;let R=Uy(i,w,"vertex"),G=Uy(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",T,R,G)}else T!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",T):(L===""||C==="")&&(P=!1);P&&(this.diagnostics={runnable:U,programLog:T,vertexShader:{log:L,prefix:v},fragmentShader:{log:C,prefix:g}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new us(i,m)),S};let A;return this.getAttributes=function(){return A===void 0&&(A=QN(i,m)),A},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=WN++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}function lC(r,e,t,n,i,s,o){let a=[],l=i.isWebGL2,c=i.logarithmicDepthBuffer,u=i.floatVertexTextures,h=i.maxVertexUniforms,d=i.vertexTextures,f=i.precision,p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},m=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmission","transmissionMap","thicknessMap"];function v(S){let T=S.skeleton.bones;if(u)return 1024;{let C=Math.floor((h-20)/4),U=Math.min(C,T.length);return U0,maxBones:B,useVertexTexture:u,morphTargets:!!C.geometry&&!!C.geometry.morphAttributes.position,morphNormals:!!C.geometry&&!!C.geometry.morphAttributes.normal,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:r.shadowMap.enabled&&T.length>0,shadowMapType:r.shadowMap.type,toneMapping:S.toneMapped?r.toneMapping:Hs,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,alphaTest:S.alphaTest,doubleSided:S.side===Xt,flipSided:S.side===kt,depthPacking:S.depthPacking!==void 0?S.depthPacking:!1,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function x(S){let A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.fragmentShader),A.push(S.vertexShader)),S.defines!==void 0)for(let T in S.defines)A.push(T),A.push(S.defines[T]);if(S.isRawShaderMaterial===!1){for(let T=0;T0?i.push(x):m.transparent===!0?s.push(x):n.push(x)}function u(f,p,m,v,g,y){let x=l(f,p,m,v,g,y);m.transmission>0?i.unshift(x):m.transparent===!0?s.unshift(x):n.unshift(x)}function h(f,p){n.length>1&&n.sort(f||uC),i.length>1&&i.sort(p||Jy),s.length>1&&s.sort(p||Jy)}function d(){for(let f=t,p=e.length;f=e.get(i).length?(o=new Xy(r),e.get(i).push(o)):o=e.get(i)[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}function dC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new M,color:new fe};break;case"SpotLight":t={position:new M,direction:new M,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new M,color:new fe,distance:0,decay:0};break;case"HemisphereLight":t={direction:new M,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":t={color:new fe,position:new M,halfWidth:new M,halfHeight:new M};break}return r[e.id]=t,t}}}function fC(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new O,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var pC=0;function mC(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function gC(r,e){let t=new dC,n=fC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)i.probe.push(new M);let s=new M,o=new me,a=new me;function l(u){let h=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let p=0,m=0,v=0,g=0,y=0,x=0,b=0,w=0;u.sort(mC);for(let S=0,A=u.length;S0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=be.LTC_FLOAT_1,i.rectAreaLTC2=be.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=be.LTC_HALF_1,i.rectAreaLTC2=be.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=f;let _=i.hash;(_.directionalLength!==p||_.pointLength!==m||_.spotLength!==v||_.rectAreaLength!==g||_.hemiLength!==y||_.numDirectionalShadows!==x||_.numPointShadows!==b||_.numSpotShadows!==w)&&(i.directional.length=p,i.spot.length=v,i.rectArea.length=g,i.point.length=m,i.hemi.length=y,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=b,i.spotShadowMatrix.length=w,_.directionalLength=p,_.pointLength=m,_.spotLength=v,_.rectAreaLength=g,_.hemiLength=y,_.numDirectionalShadows=x,_.numPointShadows=b,_.numSpotShadows=w,i.version=pC++)}function c(u,h){let d=0,f=0,p=0,m=0,v=0,g=h.matrixWorldInverse;for(let y=0,x=u.length;y=t.get(s).length?(a=new qy(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function i(){t=new WeakMap}return{get:n,dispose:i}}var Yu=class extends nn{constructor(e){super();this.type="MeshDepthMaterial",this.depthPacking=Kr,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Yu.prototype.isMeshDepthMaterial=!0;var Ku=class extends nn{constructor(e){super();this.type="MeshDistanceMaterial",this.referencePosition=new M,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Ku.prototype.isMeshDistanceMaterial=!0;var vC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - float mean = 0.0; - float squared_mean = 0.0; - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`,xC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`;function Yy(r,e,t){let n=new Vl,i=new O,s=new O,o=new Qe,a=new Yu({depthPacking:z_}),l=new Ku,c={},u=t.maxTextureSize,h={0:kt,1:Oi,2:Xt},d=new _t({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new O},radius:{value:4}},vertexShader:xC,fragmentShader:vC}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new we;p.setAttribute("position",new Re(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new gt(p,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Pg,this.render=function(b,w,_){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||b.length===0)return;let S=r.getRenderTarget(),A=r.getActiveCubeFace(),T=r.getActiveMipmapLevel(),L=r.state;L.setBlending(It),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);for(let C=0,U=b.length;Cu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/G.x),i.x=s.x*G.x,R.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/G.y),i.y=s.y*G.y,R.mapSize.y=s.y)),R.map===null&&!R.isPointLightShadow&&this.type===Dl){let j={minFilter:$e,magFilter:$e,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.mapPass=new bt(i.x,i.y,j),R.camera.updateProjectionMatrix()}if(R.map===null){let j={minFilter:Pt,magFilter:Pt,format:zt};R.map=new bt(i.x,i.y,j),R.map.texture.name=P.name+".shadowMap",R.camera.updateProjectionMatrix()}r.setRenderTarget(R.map),r.clear();let B=R.getViewportCount();for(let j=0;j=1):G.indexOf("OpenGL ES")!==-1&&(R=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),P=R>=2);let B=null,j={},ne=r.getParameter(3088),le=r.getParameter(2978),W=new Qe().fromArray(ne),z=new Qe().fromArray(le);function D(J,xe,he){let Ne=new Uint8Array(4),Be=r.createTexture();r.bindTexture(J,Be),r.texParameteri(J,10241,9728),r.texParameteri(J,10240,9728);for(let ke=0;kere||N.height>re)&&(ye=re/Math.max(N.width,N.height)),ye<1||E===!0)if(typeof HTMLImageElement!="undefined"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&N instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&N instanceof ImageBitmap){let pe=E?ey:Math.floor,Ie=pe(ye*N.width),ve=pe(ye*N.height);f===void 0&&(f=m(Ie,ve));let Fe=Y?m(Ie,ve):f;return Fe.width=Ie,Fe.height=ve,Fe.getContext("2d").drawImage(N,0,0,Ie,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+Ie+"x"+ve+")."),Fe}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function g(N){return rf(N.width)&&rf(N.height)}function y(N){return a?!1:N.wrapS!==Zt||N.wrapT!==Zt||N.minFilter!==Pt&&N.minFilter!==$e}function x(N,E){return N.generateMipmaps&&E&&N.minFilter!==Pt&&N.minFilter!==$e}function b(N,E,Y,re,ye=1){r.generateMipmap(N);let pe=n.get(E);pe.__maxMipLevel=Math.log2(Math.max(Y,re,ye))}function w(N,E,Y){if(a===!1)return E;if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let re=E;return E===6403&&(Y===5126&&(re=33326),Y===5131&&(re=33325),Y===5121&&(re=33321)),E===6407&&(Y===5126&&(re=34837),Y===5131&&(re=34843),Y===5121&&(re=32849)),E===6408&&(Y===5126&&(re=34836),Y===5131&&(re=34842),Y===5121&&(re=32856)),(re===33325||re===33326||re===34842||re===34836)&&e.get("EXT_color_buffer_float"),re}function _(N){return N===Pt||N===Xs||N===qs?9728:9729}function S(N){let E=N.target;E.removeEventListener("dispose",S),T(E),E.isVideoTexture&&d.delete(E),o.memory.textures--}function A(N){let E=N.target;E.removeEventListener("dispose",A),L(E)}function T(N){let E=n.get(N);E.__webglInit!==void 0&&(r.deleteTexture(E.__webglTexture),n.remove(N))}function L(N){let E=N.texture,Y=n.get(N),re=n.get(E);if(!!N){if(re.__webglTexture!==void 0&&(r.deleteTexture(re.__webglTexture),o.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)r.deleteFramebuffer(Y.__webglFramebuffer[ye]),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer[ye]);else r.deleteFramebuffer(Y.__webglFramebuffer),Y.__webglDepthbuffer&&r.deleteRenderbuffer(Y.__webglDepthbuffer),Y.__webglMultisampledFramebuffer&&r.deleteFramebuffer(Y.__webglMultisampledFramebuffer),Y.__webglColorRenderbuffer&&r.deleteRenderbuffer(Y.__webglColorRenderbuffer),Y.__webglDepthRenderbuffer&&r.deleteRenderbuffer(Y.__webglDepthRenderbuffer);if(N.isWebGLMultipleRenderTargets)for(let ye=0,pe=E.length;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),C+=1,N}function R(N,E){let Y=n.get(N);if(N.isVideoTexture&&$(N),N.version>0&&Y.__version!==N.version){let re=N.image;if(re===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(re.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{D(Y,N,E);return}}t.activeTexture(33984+E),t.bindTexture(3553,Y.__webglTexture)}function G(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(35866,Y.__webglTexture)}function B(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){D(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(32879,Y.__webglTexture)}function j(N,E){let Y=n.get(N);if(N.version>0&&Y.__version!==N.version){K(Y,N,E);return}t.activeTexture(33984+E),t.bindTexture(34067,Y.__webglTexture)}let ne={[di]:10497,[Zt]:33071,[qr]:33648},le={[Pt]:9728,[Xs]:9984,[qs]:9986,[$e]:9729,[jo]:9985,[Ai]:9987};function W(N,E,Y){if(Y?(r.texParameteri(N,10242,ne[E.wrapS]),r.texParameteri(N,10243,ne[E.wrapT]),(N===32879||N===35866)&&r.texParameteri(N,32882,ne[E.wrapR]),r.texParameteri(N,10240,le[E.magFilter]),r.texParameteri(N,10241,le[E.minFilter])):(r.texParameteri(N,10242,33071),r.texParameteri(N,10243,33071),(N===32879||N===35866)&&r.texParameteri(N,32882,33071),(E.wrapS!==Zt||E.wrapT!==Zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(N,10240,_(E.magFilter)),r.texParameteri(N,10241,_(E.minFilter)),E.minFilter!==Pt&&E.minFilter!==$e&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let re=e.get("EXT_texture_filter_anisotropic");if(E.type===Tr&&e.has("OES_texture_float_linear")===!1||a===!1&&E.type===Jo&&e.has("OES_texture_half_float_linear")===!1)return;(E.anisotropy>1||n.get(E).__currentAnisotropy)&&(r.texParameterf(N,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,i.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy)}}function z(N,E){N.__webglInit===void 0&&(N.__webglInit=!0,E.addEventListener("dispose",S),N.__webglTexture=r.createTexture(),o.memory.textures++)}function D(N,E,Y){let re=3553;E.isDataTexture2DArray&&(re=35866),E.isDataTexture3D&&(re=32879),z(N,E),t.activeTexture(33984+Y),t.bindTexture(re,N.__webglTexture),r.pixelStorei(37440,E.flipY),r.pixelStorei(37441,E.premultiplyAlpha),r.pixelStorei(3317,E.unpackAlignment),r.pixelStorei(37443,0);let ye=y(E)&&g(E.image)===!1,pe=v(E.image,ye,!1,u),Ie=g(pe)||a,ve=s.convert(E.format),Fe=s.convert(E.type),Ce=w(E.internalFormat,ve,Fe);W(re,E,Ie);let J,xe=E.mipmaps;if(E.isDepthTexture)Ce=6402,a?E.type===Tr?Ce=36012:E.type===Wo?Ce=33190:E.type===Ys?Ce=35056:Ce=33189:E.type===Tr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),E.format===Xo&&Ce===6402&&E.type!==bu&&E.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),E.type=bu,Fe=s.convert(E.type)),E.format===Ks&&Ce===6402&&(Ce=34041,E.type!==Ys&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),E.type=Ys,Fe=s.convert(E.type))),t.texImage2D(3553,0,Ce,pe.width,pe.height,0,ve,Fe,null);else if(E.isDataTexture)if(xe.length>0&&Ie){for(let he=0,Ne=xe.length;he0&&Ie){for(let he=0,Ne=xe.length;hef+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ky=class extends cn{constructor(e,t){super();let n=this,i=e.state,s=null,o=1,a=null,l="local-floor",c=null,u=null,h=null,d=null,f=null,p=[],m=new Map,v=new Vt;v.layers.enable(1),v.viewport=new Qe;let g=new Vt;g.layers.enable(2),g.viewport=new Qe;let y=[v,g],x=new Gf;x.layers.enable(1),x.layers.enable(2);let b=null,w=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getTargetRaySpace()},this.getControllerGrip=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getGripSpace()},this.getHand=function(B){let j=p[B];return j===void 0&&(j=new Qu,p[B]=j),j.getHandSpace()};function _(B){let j=m.get(B.inputSource);j&&j.dispatchEvent({type:B.type,data:B.inputSource})}function S(){m.forEach(function(B,j){B.disconnect(j)}),m.clear(),b=null,w=null,i.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),G.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){o=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){l=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return s},this.setSession=async function(B){if(s=B,s!==null){s.addEventListener("select",_),s.addEventListener("selectstart",_),s.addEventListener("selectend",_),s.addEventListener("squeeze",_),s.addEventListener("squeezestart",_),s.addEventListener("squeezeend",_),s.addEventListener("end",S),s.addEventListener("inputsourceschange",A);let j=t.getContextAttributes();if(j.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){let ne={antialias:j.antialias,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,ne),s.updateRenderState({baseLayer:f})}else{let ne=0;if(j.antialias){let le={antialias:!0,alpha:j.alpha,depth:j.depth,stencil:j.stencil,framebufferScaleFactor:o};f=new XRWebGLLayer(s,t,le),s.updateRenderState({layers:[f]})}else{j.depth&&(ne=j.stencil?34041:6402);let le={colorFormat:j.alpha?6408:6407,depthFormat:ne,scaleFactor:o};u=new XRWebGLBinding(s,t),d=u.createProjectionLayer(le),h=t.createFramebuffer(),s.updateRenderState({layers:[d]})}}a=await s.requestReferenceSpace(l),G.setContext(s),G.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function A(B){let j=s.inputSources;for(let ne=0;ne0&&(g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height)),g.thickness.value=y.thickness,y.thicknessMap&&(g.thicknessMap.value=y.thicknessMap),g.attenuationDistance.value=y.attenuationDistance,g.attenuationTint.value.copy(y.attenuationTint),g.specularIntensity.value=y.specularIntensity,g.specularTint.value.copy(y.specularTint),y.specularIntensityMap&&(g.specularIntensityMap.value=y.specularIntensityMap),y.specularTintMap&&(g.specularTintMap.value=y.specularTintMap)}function f(g,y){y.matcap&&(g.matcap.value=y.matcap),y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function p(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}function m(g,y){y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias),g.referencePosition.value.copy(y.referencePosition),g.nearDistance.value=y.nearDistance,g.farDistance.value=y.farDistance}function v(g,y){y.bumpMap&&(g.bumpMap.value=y.bumpMap,g.bumpScale.value=y.bumpScale,y.side===kt&&(g.bumpScale.value*=-1)),y.normalMap&&(g.normalMap.value=y.normalMap,g.normalScale.value.copy(y.normalScale),y.side===kt&&g.normalScale.value.negate()),y.displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function _C(){let r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.style.display="block",r}function wt(r={}){let e=r.canvas!==void 0?r.canvas:_C(),t=r.context!==void 0?r.context:null,n=r.alpha!==void 0?r.alpha:!1,i=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,f=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=ln,this.physicallyCorrectLights=!1,this.toneMapping=Hs,this.toneMappingExposure=1;let m=this,v=!1,g=0,y=0,x=null,b=-1,w=null,_=new Qe,S=new Qe,A=null,T=e.width,L=e.height,C=1,U=null,P=null,R=new Qe(0,0,T,L),G=new Qe(0,0,T,L),B=!1,j=[],ne=new Vl,le=!1,W=!1,z=null,D=new me,K=new M,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ee(){return x===null?C:1}let V=t;function de(I,oe){for(let k=0;k0&&Nn(Z,I,oe),ue.length>0&&Ft(Z,ue,I,oe),Me.length>0&&Nn(Me,I,oe),x!==null&&(H.updateMultisampleRenderTarget(x),H.updateRenderTargetMipmap(x)),I.isScene===!0&&I.onAfterRender(m,I,oe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),Ne.resetDefaultState(),b=-1,w=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,f.pop(),f.length>0?h=f[f.length-1]:h=null};function et(I,oe,k,Z){if(I.visible===!1)return;if(I.layers.test(oe.layers)){if(I.isGroup)k=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(oe);else if(I.isLight)d.pushLight(I),I.castShadow&&d.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||ne.intersectsSprite(I)){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;Se.visible&&h.push(I,_e,Se,k,K.z,null)}}else if(I.isImmediateRenderObject)Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D),h.push(I,null,I.material,k,K.z,null);else if((I.isMesh||I.isLine||I.isPoints)&&(I.isSkinnedMesh&&I.skeleton.frame!==se.render.frame&&(I.skeleton.update(),I.skeleton.frame=se.render.frame),!I.frustumCulled||ne.intersectsObject(I))){Z&&K.setFromMatrixPosition(I.matrixWorld).applyMatrix4(D);let _e=E.update(I),Se=I.material;if(Array.isArray(Se)){let De=_e.groups;for(let Ve=0,Oe=De.length;Ve=0&&oe<=I.width-Z&&k>=0&&k<=I.height-ue&&V.readPixels(oe,k,Z,ue,he.convert(Ve),he.convert(Oe),Me):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let De=x!==null?$.get(x).__webglFramebuffer:null;X.bindFramebuffer(36160,De)}}},this.copyFramebufferToTexture=function(I,oe,k=0){let Z=Math.pow(2,-k),ue=Math.floor(oe.image.width*Z),Me=Math.floor(oe.image.height*Z),_e=he.convert(oe.format);te.isWebGL2&&(_e===6407&&(_e=32849),_e===6408&&(_e=32856)),H.setTexture2D(oe,0),V.copyTexImage2D(3553,k,_e,I.x,I.y,ue,Me,0),X.unbindTexture()},this.copyTextureToTexture=function(I,oe,k,Z=0){let ue=oe.image.width,Me=oe.image.height,_e=he.convert(k.format),Se=he.convert(k.type);H.setTexture2D(k,0),V.pixelStorei(37440,k.flipY),V.pixelStorei(37441,k.premultiplyAlpha),V.pixelStorei(3317,k.unpackAlignment),oe.isDataTexture?V.texSubImage2D(3553,Z,I.x,I.y,ue,Me,_e,Se,oe.image.data):oe.isCompressedTexture?V.compressedTexSubImage2D(3553,Z,I.x,I.y,oe.mipmaps[0].width,oe.mipmaps[0].height,_e,oe.mipmaps[0].data):V.texSubImage2D(3553,Z,I.x,I.y,_e,Se,oe.image),Z===0&&k.generateMipmaps&&V.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(I,oe,k,Z,ue=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Me=I.max.x-I.min.x+1,_e=I.max.y-I.min.y+1,Se=I.max.z-I.min.z+1,De=he.convert(Z.format),Ve=he.convert(Z.type),Oe;if(Z.isDataTexture3D)H.setTexture3D(Z,0),Oe=32879;else if(Z.isDataTexture2DArray)H.setTexture2DArray(Z,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(37440,Z.flipY),V.pixelStorei(37441,Z.premultiplyAlpha),V.pixelStorei(3317,Z.unpackAlignment);let He=V.getParameter(3314),Ge=V.getParameter(32878),Kt=V.getParameter(3316),vt=V.getParameter(3315),bn=V.getParameter(32877),wn=k.isCompressedTexture?k.mipmaps[0]:k.image;V.pixelStorei(3314,wn.width),V.pixelStorei(32878,wn.height),V.pixelStorei(3316,I.min.x),V.pixelStorei(3315,I.min.y),V.pixelStorei(32877,I.min.z),k.isDataTexture||k.isDataTexture3D?V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,wn.data)):V.texSubImage3D(Oe,ue,oe.x,oe.y,oe.z,Me,_e,Se,De,Ve,wn),V.pixelStorei(3314,He),V.pixelStorei(32878,Ge),V.pixelStorei(3316,Kt),V.pixelStorei(3315,vt),V.pixelStorei(32877,bn),ue===0&&Z.generateMipmaps&&V.generateMipmap(Oe),X.unbindTexture()},this.initTexture=function(I){H.setTexture2D(I,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,x=null,X.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var Qy=class extends wt{};Qy.prototype.isWebGL1Renderer=!0;var io=class{constructor(e,t=25e-5){this.name="",this.color=new fe(e),this.density=t}clone(){return new io(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};io.prototype.isFogExp2=!0;var hs=class{constructor(e,t=1,n=1e3){this.name="",this.color=new fe(e),this.near=t,this.far=n}clone(){return new hs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hs.prototype.isFog=!0;var An=class extends Ke{constructor(){super();this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};An.prototype.isScene=!0;var Vi=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Bl,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Wl.clone(),uv:qt.getUV(Wl,$u,Xl,eh,$y,Uf,ev,new O),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};kf.prototype.isSprite=!0;function th(r,e,t,n,i,s){Sa.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Jl.x=s*Sa.x-i*Sa.y,Jl.y=i*Sa.x+s*Sa.y):Jl.copy(Sa),r.copy(e),r.x+=Jl.x,r.y+=Jl.y,r.applyMatrix4(Zy)}var nh=new M,tv=new M,nv=class extends Ke{constructor(){super();this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){nh.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){nh.setFromMatrixPosition(e.matrixWorld),tv.setFromMatrixPosition(this.matrixWorld);let n=nh.distanceTo(tv)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);let A=e.ray.origin.distanceTo(d);Ae.far||t.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),y=Math.min(v.count,o.start+o.count);for(let x=g,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);let _=e.ray.origin.distanceTo(d);_e.far||t.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,n=Object.keys(t);if(n.length>0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Hi.prototype.isLine=!0;var fv=new M,pv=new M,ji=class extends Hi{constructor(e,t){super(e,t);this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,n=[];for(let i=0,s=t.count;i0){let i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Kl.prototype.isPoints=!0;function gv(r,e,t,n,i,s,o){let a=jf.distanceSqToPoint(r);if(ai.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var ah=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.format=a!==void 0?a:Nt,this.minFilter=o!==void 0?o:$e,this.magFilter=s!==void 0?s:$e,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};ah.prototype.isVideoTexture=!0;var yv=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,i,s,h,d);this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};yv.prototype.isCompressedTexture=!0;var vv=class extends xt{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c);this.needsUpdate=!0}};vv.prototype.isCanvasTexture=!0;var so=class extends xt{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:Xo,u!==Xo&&u!==Ks)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Xo&&(n=bu),n===void 0&&u===Ks&&(n=Ys);super(null,i,s,o,a,l,u,n,c);this.image={width:e,height:t},this.magFilter=a!==void 0?a:Pt,this.minFilter=l!==void 0?l:Pt,this.flipY=!1,this.generateMipmaps=!1}};so.prototype.isDepthTexture=!0;var Ql=class extends we{constructor(e=1,t=8,n=0,i=Math.PI*2){super();this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);let s=[],o=[],a=[],l=[],c=new M,u=new O;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){let f=n+h/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),u.x=(o[d]/e+1)/2,u.y=(o[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new ge(o,3)),this.setAttribute("normal",new ge(a,3)),this.setAttribute("uv",new ge(l,2))}static fromJSON(e){return new Ql(e.radius,e.segments,e.thetaStart,e.thetaLength)}},ds=class extends we{constructor(e=1,t=1,n=1,i=8,s=1,o=!1,a=0,l=Math.PI*2){super();this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};let c=this;i=Math.floor(i),s=Math.floor(s);let u=[],h=[],d=[],f=[],p=0,m=[],v=n/2,g=0;y(),o===!1&&(e>0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function y(){let b=new M,w=new M,_=0,S=(t-e)/n;for(let A=0;A<=s;A++){let T=[],L=A/s,C=L*(t-e)+e;for(let U=0;U<=i;U++){let P=U/i,R=P*l+a,G=Math.sin(R),B=Math.cos(R);w.x=C*G,w.y=-L*n+v,w.z=C*B,h.push(w.x,w.y,w.z),b.set(G,S,B).normalize(),d.push(b.x,b.y,b.z),f.push(P,1-L),T.push(p++)}m.push(T)}for(let A=0;A.9&&S<.1&&(x<.2&&(o[y+0]+=1),b<.2&&(o[y+2]+=1),w<.2&&(o[y+4]+=1))}}function d(y){s.push(y.x,y.y,y.z)}function f(y,x){let b=y*3;x.x=e[b+0],x.y=e[b+1],x.z=e[b+2]}function p(){let y=new M,x=new M,b=new M,w=new M,_=new O,S=new O,A=new O;for(let T=0,L=0;T0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);let u=n[i],d=n[i+1]-u,f=(o-u)/d;return(i+f)/(s-1)}getTangent(e,t){let n=1e-4,i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new O:new M);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new M,i=[],s=[],o=[],a=new M,l=new me;for(let f=0;f<=e;f++){let p=f/e;i[f]=this.getTangentAt(p,new M),i[f].normalize()}s[0]=new M,o[0]=new M;let c=Number.MAX_VALUE,u=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();let p=Math.acos(Ln(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,p))}o[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(Ln(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(i[p],f*p)),o[p].crossVectors(i[p],s[p])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},lo=class extends gi{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super();this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let n=t||new O,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(hh.subVectors(i[0],i[1]).add(i[0]),c=hh);let h=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(bv(a,l.x,c.x,u.x,h.x),bv(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t80*t){a=c=r[0],l=u=r[1];for(let p=t;pc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?1/f:0}return ec(s,o,t,a,l,f),o}};function wv(r,e,t,n,i){let s,o;if(i===QC(r,e,t,n)>0)for(s=e;s=e;s-=n)o=Av(s,r[s],r[s+1],o);return o&&fh(o,o.next)&&(nc(o),o=o.next),o}function fs(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(fh(t,t.next)||Yt(t.prev,t,t.next)===0)){if(nc(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function ec(r,e,t,n,i,s,o){if(!r)return;!o&&s&&WC(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?FC(r,n,i,s):OC(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),nc(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=zC(fs(r),e,t),ec(r,e,t,n,i,s,2)):o===2&&GC(r,e,t,n,i,s):ec(fs(r),e,t,n,i,s,1);break}}}function OC(r){let e=r.prev,t=r,n=r.next;if(Yt(e,t,n)>=0)return!1;let i=r.next.next;for(;i!==r.prev;){if(Na(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Yt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FC(r,e,t,n){let i=r.prev,s=r,o=r.next;if(Yt(i,s,o)>=0)return!1;let a=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,u=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,h=tp(a,l,e,t,n),d=tp(c,u,e,t,n),f=r.prevZ,p=r.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0||(f=f.prevZ,p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==r.prev&&f!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Yt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==r.prev&&p!==r.next&&Na(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function zC(r,e,t){let n=r;do{let i=n.prev,s=n.next.next;!fh(i,s)&&Sv(i,n,n.next,s)&&tc(i,s)&&tc(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),nc(n),nc(n.next),n=r=s),n=n.next}while(n!==r);return fs(n)}function GC(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&qC(o,a)){let l=Mv(o,a);o=fs(o,o.next),l=fs(l,l.next),ec(o,e,t,n,i,s),ec(l,e,t,n,i,s);return}a=a.next}o=o.next}while(o!==r)}function UC(r,e,t,n){let i=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&n!==t.x&&Na(io.x||t.x===o.x&&jC(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function jC(r,e){return Yt(r.prev,r,e.prev)<0&&Yt(e.next,r,r.next)<0}function WC(r,e,t,n){let i=r;do i.z===null&&(i.z=tp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,JC(i)}function JC(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function tp(r,e,t,n,i){return r=32767*(r-t)*i,e=32767*(e-n)*i,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function XC(r){let e=r,t=r;do(e.x=0&&(r-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(i-o)*(n-a)>=0}function qC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!YC(r,e)&&(tc(r,e)&&tc(e,r)&&KC(r,e)&&(Yt(r.prev,r,e.prev)||Yt(r,e.prev,e))||fh(r,e)&&Yt(r.prev,r,r.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function fh(r,e){return r.x===e.x&&r.y===e.y}function Sv(r,e,t,n){let i=mh(Yt(r,e,t)),s=mh(Yt(r,e,n)),o=mh(Yt(t,n,r)),a=mh(Yt(t,n,e));return!!(i!==s&&o!==a||i===0&&ph(r,t,e)||s===0&&ph(r,n,e)||o===0&&ph(t,r,n)||a===0&&ph(t,e,n))}function ph(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function mh(r){return r>0?1:r<0?-1:0}function YC(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Sv(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function tc(r,e){return Yt(r.prev,r,r.next)<0?Yt(r,e,r.next)>=0&&Yt(r,r.prev,e)>=0:Yt(r,e,r.prev)<0||Yt(r,r.next,e)<0}function KC(r,e){let t=r,n=!1,i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function Mv(r,e){let t=new np(r.i,r.x,r.y),n=new np(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function Av(r,e,t,n){let i=new np(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function nc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function np(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function QC(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function Tv(r,e){for(let t=0;tNumber.EPSILON){let ve=Math.sqrt(pe),Fe=Math.sqrt(re*re+ye*ye),Ce=H.x-Y/ve,J=H.y+E/ve,xe=Q.x-ye/Fe,he=Q.y+re/Fe,Ne=((xe-Ce)*ye-(he-J)*re)/(E*ye-Y*re);ce=Ce+E*Ne-$.x,ie=J+Y*Ne-$.y;let Be=ce*ce+ie*ie;if(Be<=2)return new O(ce,ie);N=Math.sqrt(Be/2)}else{let ve=!1;E>Number.EPSILON?re>Number.EPSILON&&(ve=!0):E<-Number.EPSILON?re<-Number.EPSILON&&(ve=!0):Math.sign(Y)===Math.sign(ye)&&(ve=!0),ve?(ce=-Y,ie=E,N=Math.sqrt(pe)):(ce=E,ie=Y,N=Math.sqrt(pe/2))}return new O(ce/N,ie/N)}let le=[];for(let $=0,H=R.length,Q=H-1,ce=$+1;$=0;$--){let H=$/v,Q=f*Math.cos(H*Math.PI/2),ce=p*Math.sin(H*Math.PI/2)+m;for(let ie=0,N=R.length;ie=0;){let ce=Q,ie=Q-1;ie<0&&(ie=$.length-1);for(let N=0,E=u+v*2;N=0?(e(y-l,v,h),d.subVectors(u,h)):(e(y+l,v,h),d.subVectors(h,u)),v-l>=0?(e(y,v-l,h),f.subVectors(u,h)):(e(y,v+l,h),f.subVectors(h,u)),c.crossVectors(d,f).normalize(),o.push(c.x,c.y,c.z),a.push(y,v)}}for(let m=0;m0)&&f.push(x,b,_),(g!==n-1||l=n)){h.push(c.times[f]);for(let m=0;ms.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[p]){let g=p*h+u,y=g+h-u;m=Ht.arraySlice(a.values,g,y)}else{let g=a.createInterpolant(),y=u,x=h-u;g.evaluate(s),m=Ht.arraySlice(g.resultBuffer,y,x)}l==="quaternion"&&new Tt().fromArray(m).normalize().conjugate().toArray(m);let v=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=Ht.arraySlice(n,s,o),this.values=Ht.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Ht.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=Ht.arraySlice(this.times),t=Ht.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Zd,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=Ht.arraySlice(e,0,o),this.values=Ht.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){let e=Ht.arraySlice(this.times,0),t=Ht.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};Yi.prototype.TimeBufferType=Float32Array;Yi.prototype.ValueBufferType=Float32Array;Yi.prototype.DefaultInterpolation=Er;var fo=class extends Yi{};fo.prototype.ValueTypeName="bool";fo.prototype.ValueBufferType=Array;fo.prototype.DefaultInterpolation=Yr;fo.prototype.InterpolantFactoryMethodLinear=void 0;fo.prototype.InterpolantFactoryMethodSmooth=void 0;var fp=class extends Yi{};fp.prototype.ValueTypeName="color";var po=class extends Yi{};po.prototype.ValueTypeName="number";var Pv=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},ms=class extends Yi{InterpolantFactoryMethodLinear(e){return new Pv(this.times,this.values,this.getValueSize(),e)}};ms.prototype.ValueTypeName="quaternion";ms.prototype.DefaultInterpolation=Er;ms.prototype.InterpolantFactoryMethodSmooth=void 0;var mo=class extends Yi{};mo.prototype.ValueTypeName="string";mo.prototype.ValueBufferType=Array;mo.prototype.DefaultInterpolation=Yr;mo.prototype.InterpolantFactoryMethodLinear=void 0;mo.prototype.InterpolantFactoryMethodSmooth=void 0;var go=class extends Yi{};go.prototype.ValueTypeName="vector";var Ca=class{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(iL(n[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Yi.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=i[h];d||(i[h]=d=[]),d.push(c)}}let o=[];for(let a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(h,d,f,p,m){if(f.length!==0){let v=[],g=[];Ht.flattenJSON(f,v,g,p),v.length!==0&&m.push(new h(d,v,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h0||e.search(/^data\:image\/jpeg/)===0;s.format=l?Nt:zt,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}},Rv=class extends gi{constructor(){super();this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ri(t,e))}getPoint(e){let t=e*this.getLength(),n=this.getCurveLengths(),i=0;for(;i=t){let s=n[i]-t,o=this.curves[i],a=o.getLength(),l=a===0?0:1-s/a;return o.getPointAt(l)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},yi=class extends cc{constructor(e){super(e);this.uuid=fi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new fe().setHex(o.value);break;case"v2":i.uniforms[s].value=new O().fromArray(o.value);break;case"v3":i.uniforms[s].value=new M().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Qe().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new me().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new O().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularTintMap!==void 0&&(i.specularTintMap=n(e.specularTintMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new O().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),i}setTextures(e){return this.textures=e,this}},Ei=class{static decodeText(e){if(typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){let l=new yo(t);s=new lc(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new lc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;oNumber.EPSILON){if(C<0&&(A=x[S],L=-L,T=x[_],C=-C),y.yT.y)continue;if(y.y===A.y){if(y.x===A.x)return!0}else{let U=C*(y.x-A.x)-L*(y.y-A.y);if(U===0)return!0;if(U<0)continue;w=!w}}else{if(y.y!==A.y)continue;if(T.x<=y.x&&y.x<=A.x||A.x<=y.x&&y.x<=T.x)return!0}}return w}let s=ur.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c,u=[];if(o.length===1)return l=o[0],c=new yi,c.curves=l.curves,u.push(c),u;let h=!s(o[0].getPoints());h=e?!h:h;let d=[],f=[],p=[],m=0,v;f[m]=void 0,p[m]=[];for(let y=0,x=o.length;y1){let y=!1,x=[];for(let b=0,w=f.length;b0&&(y||(p=d))}let g;for(let y=0,x=f.length;y0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Tt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,n),Tt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){let o=1-i;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[n+o]*i}}},Np="\\[\\]\\.:\\/",lL=new RegExp("["+Np+"]","g"),Cp="[^"+Np+"]",cL="[^"+Np.replace("\\.","")+"]",uL=/((?:WC+[\/:])*)/.source.replace("WC",Cp),hL=/(WCOD+)?/.source.replace("WCOD",cL),dL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cp),fL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cp),pL=new RegExp("^"+uL+hL+dL+fL+"$"),mL=["material","materials","bones"],Kv=class{constructor(e,t,n){let i=n||nt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},nt=class{constructor(e,t,n){this.path=t,this.parsedPath=n||nt.parseTrackName(t),this.node=nt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new nt.Composite(e,t,n):new nt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(lL,"")}static parseTrackName(e){let t=pL.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);mL.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=i;f!==p;++f){let m=n[f],v=m[h],g=m[u];m[u]=v,m[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,m=i;p!==m;++p){let v=n[p];v[h]=v[d],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let n=this._bindingsIndicesByPath,i=n[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){let p=l[d];h[d]=new nt(p,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}};Qv.prototype.isAnimationObjectGroup=!0;var Zv=class{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:qo,endingEnd:qo};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){let i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let i=this._mixer,s=i.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qg:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;n!==null&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,i=this.time+e,s=this._loopCount,o=n===O_;if(e===0)return s===-1?i:o&&(s&1)==1?t-i:i;if(n===R_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)==1)return t-i}return i}_setEndings(e,t,n){let i=this._interpolantSettings;n?(i.endingStart=Yo,i.endingEnd=Yo):(e?i.endingStart=this.zeroSlopeAtStart?Yo:qo:i.endingStart=wu,t?i.endingEnd=this.zeroSlopeAtEnd?Yo:qo:i.endingEnd=wu)}_scheduleFading(e,t,n){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}},$v=class extends cn{constructor(e){super();this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=i[h],f=d.name,p=u[f];if(p!==void 0)o[h]=p;else{if(p=o[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}let m=t&&t._propertyBindings[h].binding.parsedPath;p=new Yv(nt.create(n,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),o[h]=p}a[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];s.useCount++==0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){let s=t[n];--s.useCount==0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ix.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Pa.prototype.isBox2=!0;var rx=new M,wh=new M,qn=class{constructor(e=new M,t=new M){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){rx.subVectors(e,this.start),wh.subVectors(this.end,this.start);let n=wh.dot(wh),s=wh.dot(rx)/n;return t&&(s=Ln(s,0,1)),s}closestPointToPoint(e,t,n){let i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},sx=class extends Ke{constructor(e){super();this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}};sx.prototype.isImmediateRenderObject=!0;var ox=new M,Pp=class extends Ke{constructor(e,t){super();this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let n=new we,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o=0,fc=new M,fx=new M,vL=new O,px=new M,mx=new Tt,pc=2*Math.PI,Gp=class extends cn{constructor(e,t){super();t===void 0&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.enabled=!0,this.useKeyEvents=!0,this.target=new M,this.object.getTarget(this.target),this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0+1*Ee.DEG2RAD,this.maxPolarAngle=Math.PI-1*Ee.DEG2RAD,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.125,this.enableZoom=!0,this.zoomSpeed=2,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.autoRotateClockwise=!0,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Us.ROTATE,MIDDLE:Us.DOLLY,RIGHT:Us.PAN},this.touches={ONE:ks.ROTATE,TWO:ks.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,n=0,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.update=function(){let F=l.object.position;fc.copy(F).sub(l.target),f.setFromVector3(fc),l.object.isUpVectorFlipped&&(f.phi*=-1,f.theta-=Math.PI),l.autoRotate&&u===c.NONE&&(l.autoRotateClockwise===!0?R(U()):G(U())),l.rotationLimitsMode!==l.rotationLimitsOptions.HORIZONTAL&&(f.phi+=p.phi),(l.rotationLimitsMode!==l.rotationLimitsOptions.VERTICAL||l.autoRotate===!0)&&(f.theta+=p.theta),(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(f.phi=Math.max(i,Math.min(s,f.phi))),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(n+=p.theta,n>l.rotationHorizontalOffset.max?(f.theta=a,n=l.rotationHorizontalOffset.max):n<-l.rotationHorizontalOffset.min&&(f.theta=o,n=-l.rotationHorizontalOffset.min));let Pe=l.minAzimuthAngle,et=l.maxAzimuthAngle;isFinite(Pe)&&isFinite(et)&&(Pe<-Math.PI?Pe+=pc:Pe>Math.PI&&(Pe-=pc),et<-Math.PI?et+=pc:et>Math.PI&&(et-=pc),Pe<=et?f.theta=Math.max(Pe,Math.min(et,f.theta)):f.theta=f.theta>(Pe+et)/2?Math.max(Pe,f.theta):Math.min(et,f.theta)),f.radius*=m,f.radius=Math.max(l.minDistance,Math.min(l.maxDistance,f.radius)),l.target.add(v),fc.setFromSpherical(f),F.copy(l.target).add(fc);let Ft=f.phi%pc;return fx.copy(fc).normalize(),l.object.up.copy(Ke.DefaultUp).applyAxisAngle(fx,l.object.angleOffsetFromUp),Ft>0&&Ft>Math.PI||Ft<0&&Ft>-Math.PI?(l.object.up.negate(),l.object.lookAt(l.target),l.object.isUpVectorFlipped=!0):(l.object.lookAt(l.target),l.object.isUpVectorFlipped=!1),l.enableDamping===!0?(p.theta*=1-l.dampingFactor,p.phi*=1-l.dampingFactor):p.set(0,0,0),v.set(0,0,0),m=1,g||px.distanceToSquared(l.object.position)>d||8*(1-mx.dot(l.object.quaternion))>h?(l.dispatchEvent(Fp),g&&l.dispatchEvent(yL),px.copy(l.object.position),mx.copy(l.object.quaternion),g=!1,!0):(p.set(0,0,0),!1)},this.dispose=function(){l.domElement.removeEventListener("contextmenu",xn),l.domElement.removeEventListener("pointerdown",xe),l.domElement.removeEventListener("wheel",Bn),l.domElement.removeEventListener("touchstart",En),l.domElement.removeEventListener("touchend",_r),l.domElement.removeEventListener("touchmove",Di),l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne),l.domElement.removeEventListener("gesturestart",X),l.domElement.removeEventListener("gesturechange",X),l.domElement.removeEventListener("gestureend",X),window.removeEventListener("keydown",Mt,!1),window.removeEventListener("keyup",Tn,!1)},this.zoomOut=function(){W(P())},this.zoomIn=function(){z(P())},this.setEnableDampingSpeed=function(F){this.enableDamping=F,this.rotateSpeed=F===!0?.2:1},this.resetTo=function(F,Pe,et){l.target.copy(F),l.object.position.copy(Pe),l.object.zoom=et,l.object.updateProjectionMatrix(),l.dispatchEvent(Fp),l.update(),u=c.NONE},this.stopDamping=function(){p.theta=0,p.phi=0};let n,i,s,o,a;this.rotationVerticalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationHorizontalOffset={min:Math.PI*.5,max:Math.PI*.5},this.rotationLimitsOptions={DEFAULT:0,VERTICAL:1,HORIZONTAL:2,BOTH:3},this.rotationLimitsMode=this.rotationLimitsOptions.DEFAULT,this.updateRotationOffetLimits=function(){n=0,i=Th(f.phi-l.rotationVerticalOffset.min),s=Th(f.phi+l.rotationVerticalOffset.max),i<0&&(i=l.minPolarAngle),s<0&&(s=l.maxPolarAngle),o=Th(f.theta-l.rotationHorizontalOffset.min),a=Th(f.theta+l.rotationHorizontalOffset.max)},this.toJSON=function(){let F={};return l.useKeyEvents&&(F.useKeyEvents=!0),l.enableDamping&&(F.enableDamping=!0),l.enablePan&&(F.enablePan=!0),l.enableZoom&&(F.enableZoom=!0),l.enableRotate&&(F.enableRotate=!0),F.rotationLimitsMode=l.rotationLimitsMode,(l.rotationLimitsMode===l.rotationLimitsOptions.VERTICAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationVerticalOffset={min:l.rotationVerticalOffset.min,max:l.rotationVerticalOffset.max}),(l.rotationLimitsMode===l.rotationLimitsOptions.HORIZONTAL||l.rotationLimitsMode===l.rotationLimitsOptions.BOTH)&&(F.rotationHorizontalOffset={min:l.rotationHorizontalOffset.min,max:l.rotationHorizontalOffset.max}),l.autoRotate&&(F.autoRotate=!0,F.autoRotateSpeed=l.autoRotateSpeed,l.autoRotateClockwise&&(F.autoRotateClockwise=!0)),F},this.fromJSON=function(F){l.useKeyEvents=F.useKeyEvents===!0,l.setEnableDampingSpeed(F.enableDamping===!0),l.enablePan=F.enablePan===!0,l.enableZoom=F.enableZoom===!0,l.enableRotate=F.enableRotate===!0,F.rotationLimitsMode!==void 0&&(l.rotationLimitsMode=F.rotationLimitsMode),F.rotationVerticalOffset&&(l.rotationVerticalOffset={min:F.rotationVerticalOffset.min,max:F.rotationVerticalOffset.max}),F.rotationHorizontalOffset&&(l.rotationHorizontalOffset={min:F.rotationHorizontalOffset.min,max:F.rotationHorizontalOffset.max}),l.autoRotate=F.autoRotate===!0,F.autoRotateSpeed&&(l.autoRotateSpeed=F.autoRotateSpeed),l.autoRotateClockwise=F.autoRotateClockwise===!0,l.updateRotationOffetLimits()};let l=this,c={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=c.NONE,h=1e-8,d=.01,f=new bh,p=new bh,m=1,v=new M,g=!1,y=new O,x=new O,b=new O,w=new O,_=new O,S=new O,A=new O,T=new O,L=new O,C={};function U(){return 2*Math.PI/60/60*l.autoRotateSpeed}function P(){return Math.pow(.95,l.zoomSpeed)}function R(F){p.theta-=F*(l.object.isUpVectorFlipped?-1:1)}function G(F){p.theta+=F}function B(F){p.phi-=F}let j=function(){let F=new M;return function(et,Ft){F.setFromMatrixColumn(Ft,0),F.multiplyScalar(-et),v.add(F)}}(),ne=function(){let F=new M;return function(et,Ft){l.screenSpacePanning===!0?F.setFromMatrixColumn(Ft,1):(F.setFromMatrixColumn(Ft,0),F.crossVectors(l.object.up,F)),F.multiplyScalar(et),v.add(F)}}(),le=function(){let F=new M;return function(et,Ft){let Nn=l.domElement;if(l.object.isPerspectiveCamera){let Gs=l.object.position;F.copy(Gs).sub(l.target);let sr=F.length();sr*=Math.tan(l.object.fov/2*Math.PI/180),j(2*et*sr/Nn.clientHeight,l.object.matrix),ne(2*Ft*sr/Nn.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(j(et*(l.object.right-l.object.left)/l.object.zoom/Nn.clientWidth,l.object.matrix),ne(Ft*(l.object.top-l.object.bottom)/l.object.zoom/Nn.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function W(F){l.object.isPerspectiveCamera?m/=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(F){l.object.isPerspectiveCamera?m*=F:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/F)),l.object.updateProjectionMatrix(),g=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(F){y.set(F.clientX,F.clientY)}function K(F){A.set(F.clientX,F.clientY)}function q(F){w.set(F.clientX,F.clientY)}function ee(F){x.set(F.clientX,F.clientY),b.subVectors(x,y).multiplyScalar(l.rotateSpeed).rotateAround(vL,-l.object.angleOffsetFromUp);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x),l.update()}function V(F){T.set(F.clientX,F.clientY),L.subVectors(T,A),L.y>0?W(P()):L.y<0&&z(P()),A.copy(T),l.update()}function de(F){_.set(F.clientX,F.clientY),S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_),l.update()}function ae(){}let te=0;function X(F){if(F.preventDefault(),F.type==="gesturechange"){if(l.enableZoom===!1)return;F.scale>te?z(P()):F.scale0&&W(P())}else{if(l.enablePan===!1)return;S.set(-F.deltaX,-F.deltaY).multiplyScalar(l.panSpeed),F.altKey?le(0,S.y):F.shiftKey?le(S.x,0):le(S.x,S.y)}l.update()}$&&window.clearTimeout($),$=window.setTimeout(()=>{se=!1,H=void 0},200)}function ie(F){let Pe=!1;switch(F.code){case l.keys.UP:le(0,l.keyPanSpeed),Pe=!0;break;case l.keys.BOTTOM:le(0,-l.keyPanSpeed),Pe=!0;break;case l.keys.LEFT:le(l.keyPanSpeed,0),Pe=!0;break;case l.keys.RIGHT:le(-l.keyPanSpeed,0),Pe=!0;break;default:break}Pe&&(F.preventDefault(),l.update())}function N(F){if(F.touches.length===1)y.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);y.set(Pe,et)}}function E(F){if(F.touches.length===1)w.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);w.set(Pe,et)}}function Y(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);A.set(0,Ft)}function re(F){l.enableZoom&&Y(F),l.enablePan&&E(F)}function ye(F){l.enableZoom&&Y(F),l.enableRotate&&N(F)}function pe(F){if(F.touches.length===1)x.set(F.touches[0].pageX,F.touches[0].pageY);else{let et=.5*(F.touches[0].pageX+F.touches[1].pageX),Ft=.5*(F.touches[0].pageY+F.touches[1].pageY);x.set(et,Ft)}b.subVectors(x,y).multiplyScalar(l.rotateSpeed);let Pe=l.domElement;R(2*Math.PI*b.x/Pe.clientHeight),B(2*Math.PI*b.y/Pe.clientHeight),y.copy(x)}function Ie(F){if(F.touches.length===1)_.set(F.touches[0].pageX,F.touches[0].pageY);else{let Pe=.5*(F.touches[0].pageX+F.touches[1].pageX),et=.5*(F.touches[0].pageY+F.touches[1].pageY);_.set(Pe,et)}S.subVectors(_,w).multiplyScalar(l.panSpeed),le(S.x,S.y),w.copy(_)}function ve(F){let Pe=F.touches[0].pageX-F.touches[1].pageX,et=F.touches[0].pageY-F.touches[1].pageY,Ft=Math.sqrt(Pe*Pe+et*et);T.set(0,Ft),L.set(0,Math.pow(T.y/A.y,l.zoomSpeed)),W(L.y),A.copy(T)}function Fe(F){l.enableZoom&&ve(F),l.enablePan&&Ie(F)}function Ce(F){l.enableZoom&&ve(F),l.enableRotate&&pe(F)}function J(){}function xe(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":l.useKeyEvents===!1?Be(F):ke(F);break;default:break}}function he(F){if(l.enabled!==!1)switch(F.pointerType){case"mouse":case"pen":ht(F);break;default:break}}function Ne(F){switch(F.pointerType){case"mouse":case"pen":ft(F);break;default:break}l.domElement.ownerDocument.removeEventListener("pointermove",he),l.domElement.ownerDocument.removeEventListener("pointerup",Ne)}function Be(F){F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus();let Pe;switch(F.button){case 0:Pe=l.mouseButtons.LEFT;break;case 1:Pe=l.mouseButtons.MIDDLE;break;case 2:Pe=l.mouseButtons.RIGHT;break;default:Pe=-1}switch(Pe){case Us.DOLLY:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case Us.ROTATE:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enablePan===!1)return;q(F),u=c.PAN}else{if(l.enableRotate===!1)return;D(F),u=c.ROTATE}break;case Us.PAN:if(F.ctrlKey||F.metaKey||F.shiftKey){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else{if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}function ke(F){if(l.enabled!==!1){switch(F.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),F.button){case l.mouseButtons.MIDDLE:if(l.enablePan===!1)return;q(F),u=c.PAN;break;case l.mouseButtons.LEFT:if(F.altKey===!0&&!F.shiftKey&&!(dx?F.metaKey:F.ctrlKey)){if(l.enableRotate===!1)return;D(F),u=c.ROTATE}else if(C.code==="Space"){if(l.enablePan===!1)return;q(F),u=c.PAN}break;default:u=c.NONE}u!==c.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",he),l.domElement.ownerDocument.addEventListener("pointerup",Ne),l.dispatchEvent(_h))}}function ht(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.ROTATE:if(l.enableRotate===!1)return;ee(F);break;case c.DOLLY:if(l.enableZoom===!1)return;V(F);break;case c.PAN:if(l.enablePan===!1)return;de(F);break;default:break}}function ft(F){l.enabled!==!1&&(ae(F),l.dispatchEvent(zp),u=c.NONE)}function Bn(F){l.enabled===!1||l.enableZoom===!1||u!==c.NONE&&u!==c.ROTATE||(F.preventDefault(),l.dispatchEvent(_h),ce(F),l.dispatchEvent(zp))}function Mt(F){l.enabled!==!1&&(C=F)}function Tn(){l.enabled!==!1&&(C={},u!==c.NONE&&ft(new PointerEvent("pointerover")))}function En(F){if(l.enabled!==!1){switch(F.preventDefault(),F.touches.length){case 1:switch(l.touches.ONE){case ks.ROTATE:if(l.enableRotate===!1)return;N(F),u=c.TOUCH_ROTATE;break;case ks.PAN:if(l.enablePan===!1)return;E(F),u=c.TOUCH_PAN;break;default:u=c.NONE}break;case 2:switch(l.touches.TWO){case ks.DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;re(F),u=c.TOUCH_DOLLY_PAN;break;case ks.DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;ye(F),u=c.TOUCH_DOLLY_ROTATE;break;default:u=c.NONE}break;default:u=c.NONE}u!==c.NONE&&l.dispatchEvent(_h)}}function Di(F){if(l.enabled!==!1)switch(F.preventDefault(),u){case c.TOUCH_ROTATE:if(l.enableRotate===!1)return;pe(F),l.update();break;case c.TOUCH_PAN:if(l.enablePan===!1)return;Ie(F),l.update();break;case c.TOUCH_DOLLY_PAN:if(l.enableZoom===!1&&l.enablePan===!1)return;Fe(F),l.update();break;case c.TOUCH_DOLLY_ROTATE:if(l.enableZoom===!1&&l.enableRotate===!1)return;Ce(F),l.update();break;default:u=c.NONE}}function _r(F){l.enabled!==!1&&(J(F),l.dispatchEvent(zp),u=c.NONE)}function xn(F){l.enabled!==!1&&F.preventDefault()}l.domElement.addEventListener("contextmenu",xn),l.domElement.addEventListener("pointerdown",xe),l.domElement.addEventListener("wheel",Bn,{passive:!1}),l.domElement.addEventListener("touchstart",En,{passive:!1}),l.domElement.addEventListener("touchend",_r),l.domElement.addEventListener("touchmove",Di,{passive:!1}),l.domElement.addEventListener("gesturestart",X),l.domElement.addEventListener("gesturechange",X),l.domElement.addEventListener("gestureend",X),window.addEventListener("keydown",Mt,!1),window.addEventListener("keyup",Tn,!1),this.update(),this.updateRotationOffetLimits(),this.setEnableDampingSpeed(!0)}};function Th(r){let e=Math.PI*2;for(;r<=-Math.PI;)r+=e;for(;r>Math.PI;)r-=e;return r}var xL=3,Up=class extends Lp{constructor(){super();this.layers.enable(xL)}setFromCamera(e,t){t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):t.isPerspectiveCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(e,t=!0,n=[]){return e.forEach(i=>{i.visible&&this.intersectObject(i,t,n)}),n}createRaycastLineHelper(){let e=new Gn({color:65280,linewidth:10}),t=new M(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),n=new M(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),i=this.camera.far-this.camera.near,s=new M().addVectors(t,n.multiplyScalar(i)),o=new we;return o.setFromPoints([t,s]),new Hi(o,e)}};var gx=r=>class{constructor(t=pp){this.manager=t;this.loader=new r(t)}};var ze=class{constructor(e){this.hashProperties=void 0;this.isNode=!0;this.shortcuts={};this.uuid=Ee.generateUUID(),this.type=e,this.name="",this.userData={}}analyze(e,t){t=t!=null?t:{},e.analyzing=!0,this.build(e.addFlow(t.slot,t.cache,t.context),"v4"),e.clearVertexNodeCode(),e.clearFragmentNodeCode(),e.removeFlow(),e.analyzing=!1}analyzeAndFlow(e,t,n){return n=n!=null?n:{},this.analyze(e,n),this.flow(e,t,n)}flow(e,t,n){n=n!=null?n:{},e.addFlow(n.slot,n.cache,n.context);let i={result:this.build(e,t),code:e.clearNodeCode(),extra:e.context.extra};return e.removeFlow(),i}build(e,t,n){t=t!=null?t:this.getType(e,t);let i=e.getNodeData(n!=null?n:this);return e.analyzing&&this.appendDepsNode(e,i,t),e.nodes.indexOf(this)===-1&&e.nodes.push(this),this.updateFrame!==void 0&&e.updaters.indexOf(this)===-1&&e.updaters.push(this),this.generate(e,t,n)}updateFrame(e){}generateReadonly(e,t,n,i,s,o){return""}generate(e,t,n,i,s){return""}parse(e,t,n,i){}appendDepsNode(e,t,n){t.deps=(t.deps||0)+1;let i=e.getTypeLength(n);(i>(t.outputMax||0)||this.getType(e,n))&&(t.outputMax=i,t.output=n)}setName(e){this.name=e}getName(){return this.name}getType(e,t){return t==="sampler2D"||t==="samplerCube"?t:this.type}getJSONNode(e){if((e==null?void 0:e.materials)&&(e==null?void 0:e.materials[this.uuid])!==void 0)return e.materials[this.uuid]}getHash(){let e="{",t,n;for(t in this)n=this[t],n instanceof ze&&(e+='"'+t+'":'+n.getHash()+",");if(this.hashProperties)for(let i=0;it)),this.userData=JSON.parse(JSON.stringify(e.userData)),this.shortcuts=JSON.parse(JSON.stringify(e.shortcuts)),this}clone(){return new this.constructor().copy(this)}createJSONNode(e){let t=e===void 0||typeof e=="string";if(typeof this.type!="string")throw new Error("Node does not allow serialization.");let n={};return n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),JSON.stringify(this.userData)!=="{}"&&(n.userData=this.userData),!t&&e&&(e.nodes[this.uuid]=n),n}toJSON(e){var t;return(t=this.getJSONNode(e))!=null?t:this.createJSONNode(e)}fromJSON(e,t){return this.uuid=e.uuid,this.type=e.type,e.name&&(this.name=e.name),e.userData&&(this.userData=e.userData),this}};var je=class extends ze{constructor(e,t){super(e);this.scope="";t=t!=null?t:{},this.shared=t.shared!==void 0?t.shared:!0,this.unique=t.unique!==void 0?t.unique:!1}build(e,t,n,i){if(t=t!=null?t:this.getType(e),this.getShared(e,t)){let s=this.getUnique(e,t);s&&this.uuid===void 0&&(this.uuid=Ee.generateUUID()),n=e.getUUID(n!=null?n:this.getUUID(),!s);let o=e.getNodeData(n),a=o.output||this.getType(e);if(e.analyzing)return(o.deps||0)>0||this.getLabel()?(this.appendDepsNode(e,o,t),this.generate(e,t,n)):super.build(e,t,n);if(s)return o.name=o.name||super.build(e,t,n),o.name;if(!this.getLabel()&&(!this.getShared(e,a)||e.context.ignoreCache||o.deps===1))return super.build(e,t,n);n=this.getUUID(!1);let l=this.getTemp(e,n);if(l)return e.format(l,a,t);{l=super.generate(e,t,n,o.output,i);let c=this.generate(e,a,n);return e.addNodeCode(l+" = "+c+";"),e.format(l,a,t)}}return super.build(e,t,n)}getShared(e,t){return t!=="sampler2D"&&t!=="samplerCube"&&this.shared}getUnique(e,t){return this.unique}setLabel(e){return this.label=e,this}getLabel(){return this.label}getUUID(e){let t=this.uuid;return typeof this.scope=="string"&&(t=this.scope+"-"+t),t}getTemp(e,t){t=t||this.uuid;let n=e.getVars()[t];return n?n.name:void 0}generate(e,t,n,i,s){return this.getShared(e,t)||console.error("TempNode is not shared"),n=n!=null?n:this.uuid,e.getTempVar(n,i!=null?i:this.getType(e),s,this.getLabel()).name}};var Ct=class extends je{constructor(e,t){t=t!=null?t:{},t.shared=t.shared!==void 0?t.shared:!1;super(e,t);this.readonly=!1}setReadonly(e){return this.readonly=e,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}createJSONNode(e){let t=super.createJSONNode(e);return this.readonly===!0&&(t.readonly=this.readonly),t}fromJSON(e,t){return super.fromJSON(e,t),e.readonly!==void 0&&this.setReadonly(e.readonly),this}generate(e,t,n,i,s,o){n=e.getUUID(n!=null?n:this.getUUID()),i=i!=null?i:this.getType(e);let a=e.getNodeData(n);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(e,t,n,i,s,o):e.isShader("vertex")?(a.vertex||(a.vertex=e.createVertexUniform(i,this,s,o,this.getLabel())),e.format(a.vertex.name,i,t)):(a.fragment||(a.fragment=e.createFragmentUniform(i,this,s,o,this.getLabel())),e.format(a.fragment.name,i,t))}copy(e){return super.copy(e),this.readonly=e.readonly,this}};var Un=class extends Ct{constructor(e=0,t,n){super("v3");this.nodeType="Vector3";this.value=e instanceof M?e:new M(e,t,n)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}generateReadonly(e,t,n,i,s,o){return e.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),this}};var In=class extends Ct{constructor(e=0,t){super("v2");this.nodeType="Vector2";this.value=e instanceof O?e:new O(e,t)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}generateReadonly(e,t,n,i,s,o){return e.format("vec2("+this.value.x+", "+this.value.y+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),this}};var it=class extends Ct{constructor(e){super("i");this.nodeType="Int";this.value=Math.floor(e!=null?e:0)}generateReadonly(e,t,n,i,s,o){return e.format(this.value.toString(),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var Te=class extends Ct{constructor(e){super("f");this.nodeType="Float";this.value=e!=null?e:0}generateReadonly(e,t,n,i,s,o){return e.format(this.value+(this.value%1?"":".0"),i,t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var lt;(function(m){m.POSITION="position",m.LIGHTING="light",m.COLOR="color",m.GRADIENT="gradient",m.NORMAL="normal",m.DEPTH="depth",m.TEXTURE="texture",m.NOISE="noise",m.FRESNEL="fresnel",m.RAINBOW="rainbow",m.TRANSMISSION="transmission",m.POINTS="points",m.MATCAP="matcap",m.LINES="lines",m.DISPLACE="displace"})(lt||(lt={}));var Gt;(function(n){n.POSITION="position",n.LIGHTING="light",n.COLOR="color"})(Gt||(Gt={}));var jt=class{constructor(e,t,n){this.next=void 0;this.uniforms={};this.textures={};this.defines={};this.backLayer=void 0;this.isBack=!1;if(this.id=e,t){this.type=t.type;for(let i in t)i!=="type"&&i!=="calpha"&&(this.uniforms[`f${this.id}_${i}`]=t[i]);for(let i in n)this.defines[i]=n[i]}}copy(e){this.id=e.id,this.type=e.type,this.defines=Ue({},e.defines);for(let t in e.uniforms)this.getName(t)==="transmissionSamplerMap"||this.getName(t)==="transmissionDepthMap"||(this.uniforms[t]?this.uniforms[t].copy(e.uniforms[t]):this.uniforms[t]=e.uniforms[t].clone());return this}clone(){return new jt(this.id).copy(this)}fromJSON(e,t){this.id=e.id,this.defines=Ue({},e.defines);for(let n in e.uniforms)this.uniforms[n]=t.getNode(e.uniforms[n]);if(e.type===lt.TEXTURE){if(!(`f${this.id}_textureSize`in this.uniforms)){let n=this.uniforms[`f${this.id}_texture`].value.image;this.uniforms[`f${e.id}_textureSize`]=new Un(n.width,n.height)}`f${this.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new In(200,200)),`f${e.id}_axis`in this.uniforms||(this.uniforms[`f${e.id}_axis`]=new it(0)),`f${e.id}_projection`in this.uniforms||(this.uniforms[`f${e.id}_projection`]=new it(0))}else e.type===lt.NOISE?(`f${e.id}_noiseType`in this.uniforms||(this.uniforms[`f${e.id}_noiseType`]=new it(0)),`f${e.id}_size`in this.uniforms||(this.uniforms[`f${e.id}_size`]=new Un(-1,-1,-1))):e.type===lt.DEPTH&&(`f${e.id}_isWorldSpace`in this.uniforms||(this.uniforms[`f${e.id}_isWorldSpace`]=new Te(1)));return this}toJSON(e){let t={};for(let i in this.uniforms)t[i]=this.uniforms[i].toJSON(e).uuid;return{id:this.id,type:this.type,defines:JSON.parse(JSON.stringify(this.defines)),uniforms:t,next:this.next==null?void 0:this.next.toJSON(e)}}copyUniforms(e){for(let t in this.uniforms){let n=this.getName(t);n!==void 0&&e.uniforms[`f${e.id}_${n}`]&&n!=="transmissionDepthMap"&&n!=="transmissionSamplerMap"&&this.uniforms[t].copy(e.uniforms[`f${e.id}_${n}`])}return this}hasValueByKey(e){return this.uniforms[e]!==void 0}hasValue(e){return this.hasValueByKey(`f${this.id}_${e}`)}setValue(e,t){let n=`f${this.id}_${e}`;this.hasValueByKey(n)&&t!==void 0&&(this.uniforms[n].value=t)}getValue(e){let t=`f${this.id}_${e}`;if(this.hasValueByKey(t))return this.uniforms[t].value}getValues(){let e={type:this.type};for(let t in this.uniforms){let n=this.getName(t);if(n===void 0)continue;let s=this.uniforms[`f${this.id}_${n}`].value;s!==void 0&&(Array.isArray(s)?e[n]=s.map(o=>o.clone?o.clone():o):e[n]=s.clone?s.clone():s)}return e}getName(e){let n=/f\d+_(.*)/.exec(e);if(n&&n.length>1)return n[1];console.log(`Layer.getName: error ${e}`)}getNames(){let e=[];for(let t in this.uniforms){let n=this.getName(t);n&&e.push(n)}return e}isEqual(e){for(let t in e.uniforms){let n=e.getName(t);if(!n)return!1;let i=this.getValue(n),s=e.uniforms[t].value;if(s.value instanceof xt){if(i.image!==s.image)return!1}else if(Array.isArray(s)){let o=i;for(let a=0,l=o.length;at.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.map(n=>({x:n.x,y:n.y,z:n.z,w:n.w}))),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value.map(n=>new Qe(n.x,n.y,n.z,n.w)),this.size=this.value.length),this}};var Ba=class extends Ct{constructor(e=1,t){super("f[]");this.nodeType="FloatArray";this.size=e,this.value=Array.isArray(t)?t:typeof t=="number"?new Array(e).fill(t):new Array(e).fill(0)}copy(e){return super.copy(e),this.size=e.size,this.value=[...e.value],this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.size=this.size,t.value=[...this.value]),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=[...e.value]),e.size?this.size=e.size:e.value&&(this.size=this.value.length),this}};var yx=class{constructor(){this.nodes={};this.keywords={}}add(e){this.nodes[e.name]=e}addKeyword(e,t,n){n=n!==void 0?n:!0,this.keywords[e]={callback:t,cache:n}}remove(e){delete this.nodes[e.name]}removeKeyword(e){delete this.keywords[e]}get(e){return this.nodes[e]}getKeyword(e,t){return this.keywords[e].callback(t)}getKeywordData(e){return this.keywords[e]}contains(e){return this.nodes[e]!==void 0}containsKeyword(e){return this.keywords[e]!==void 0}},pn=new yx;var bo=class extends je{constructor(e){super("v2",{shared:!1});this.nodeType="UV";this.index=e!=null?e:0}generate(e,t){e.requires.uv[this.index]=!0;let n=this.index>0?this.index+1:"",i=e.isShader("vertex")?"uv"+n:"vUv"+n;return e.format(i,this.getType(e),t)}copy(e){return super.copy(e),this.index=e.index,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.index=this.index),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.index&&(this.index=e.index),this}};pn.addKeyword("uv",function(){return new bo});pn.addKeyword("uv2",function(){return new bo(1)});var bL=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,vx=/[a-z_0-9]+/gi,Le=class extends je{constructor(e,t,n,i,s){super(s);this.src="";this.nodeType="Function";this.useKeywords=!0;this.includes=[];this.extensions={};this.keywords={};this.isMethod=s===void 0,this.isInterface=!1,this.parse(e,t,n,i)}getShared(e,t){return!this.isMethod}getType(e){return e.getTypeByFormat(this.type)}getInputByName(e){if(this.inputs){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}}getIncludeByName(e){if(this.includes){let t=this.includes.length;for(;t--;)if(this.includes[t].name===e)return this.includes[t]}}generate(e,t,n,i,s){let o,a=0,l=this.src;if(this.includes)for(let u=0;ut.getNode(n))),this}};var wL=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,Vp=class extends je{constructor(e="",t){super();this.src="";this.useDefine=!1;this.nodeType="Const";this.parse(e||Vp.PI,void 0,void 0,void 0,t)}getType(e){return e.getTypeByFormat(this.type)}parse(e,t,n,i,s){this.src=e||"";let o,a,l="",c=wL.exec(e);this.useDefine=s!=null?s:this.src.charAt(0)==="#",c&&c.length>1?(a=c[1],o=c[2],l=c[3]):(o=this.src,a="f"),this.name=o,this.type=a,this.value=l}build(e,t){if(t==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return e.include(this),e.format(this.name,this.getType(e),t)}generate(e,t,n,i,s){return e.format(this.name,this.getType(e),t)}copy(e){return super.copy(e),this.parse(e.src,void 0,void 0,void 0,e.useDefine),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src,t.useDefine=this.useDefine,t.value=this.value,t.name=this.name),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src),e.value&&(this.value=e.value),e.name&&(this.name=e.name),e.useDefine!==void 0&&(this.useDefine=e.useDefine),this}},rt=Vp;rt.PI="PI",rt.PI2="PI2",rt.RECIPROCAL_PI="RECIPROCAL_PI",rt.RECIPROCAL_PI2="RECIPROCAL_PI2",rt.LOG2="LOG2",rt.EPSILON="EPSILON";var yt=class extends Le{constructor(e="",t,n,i,s){super(e,s,i,n,t);this.nodeType="Expression"}};var wo=class extends je{constructor(e=new ze,t){super("v4");this.nodeType="ColorSpace";this.factor=new ze;this.input=e,this.method=t!=null?t:wo.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(e){switch(e){case ln:return["Linear"];case Fi:return["sRGB"];case Rl:return["RGBE"];case Mu:return["RGBM",new Te(7).setReadonly(!0)];case Au:return["RGBM",new Te(16).setReadonly(!0)];case _u:return["RGBD",new Te(256).setReadonly(!0)];case Qs:return["Gamma",new yt("float( GAMMA_FACTOR )","f")];default:return[]}}generate(e,t){let n=this.input.build(e,"v4"),i=this.getType(e),s=wo.Nodes[this.method],o=e.include(s);if(o===wo.LINEAR_TO_LINEAR)return e.format(n,i,t);if(s.inputs.length===2){let a=this.factor.build(e,"f");return e.format(o+"( "+n+", "+a+" )",i,t)}else return e.format(o+"( "+n+" )",i,t)}fromEncoding(e){let t=wo.getEncodingComponents(e);this.method="LinearTo"+t[0],this.factor=t[1]}fromDecoding(e){let t=wo.getEncodingComponents(e);this.method=t[0]+"ToLinear",this.factor=t[1]}copy(e){return super.copy(e),this.input.copy(e.input),this.method=e.method,this.factor.copy(e.factor),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.input=this.input.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.input&&(this.input=t.getNode(e.input)),e.factor&&(this.factor=t.getNode(e.factor)),e.method&&(this.method=e.method),this}},Bt=wo;Bt.Nodes={LinearToLinear:new Le(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` -`)),GammaToLinear:new Le(["vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );","}"].join(` -`)),LinearToGamma:new Le(["vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {"," return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );","}"].join(` -`)),sRGBToLinear:new Le(["vec4 sRGBToLinear( in vec4 value ) {"," return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );","}"].join(` -`)),LinearTosRGB:new Le(["vec4 LinearTosRGB( in vec4 value ) {"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );","}"].join(` -`)),RGBEToLinear:new Le(["vec4 RGBEToLinear( in vec4 value ) {"," return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );","}"].join(` -`)),LinearToRGBE:new Le(["vec4 LinearToRGBE( in vec4 value ) {"," float maxComponent = max( max( value.r, value.g ), value.b );"," float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );"," return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );","}"].join(` -`)),RGBMToLinear:new Le(["vec3 RGBMToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.xyz * value.w * maxRange, 1.0 );","}"].join(` -`)),LinearToRGBM:new Le(["vec3 LinearToRGBM( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float M = clamp( maxRGB / maxRange, 0.0, 1.0 );"," M = ceil( M * 255.0 ) / 255.0;"," return vec4( value.rgb / ( M * maxRange ), M );","}"].join(` -`)),RGBDToLinear:new Le(["vec3 RGBDToLinear( in vec4 value, in float maxRange ) {"," return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );","}"].join(` -`)),LinearToRGBD:new Le(["vec3 LinearToRGBD( in vec4 value, in float maxRange ) {"," float maxRGB = max( value.x, max( value.g, value.b ) );"," float D = max( maxRange / maxRGB, 1.0 );"," D = clamp( floor( D ) / 255.0, 0.0, 1.0 );"," return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );","}"].join(` -`)),cLogLuvM:new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );"),LinearToLogLuv:new Le(["vec4 LinearToLogLuv( in vec4 value ) {"," vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;"," Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));"," vec4 vResult;"," vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;"," float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;"," vResult.w = fract(Le);"," vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;"," return vResult;","}"].join(` -`),[new rt("const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );")]),cLogLuvInverseM:new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );"),LogLuvToLinear:new Le(["vec4 LogLuvToLinear( in vec4 value ) {"," float Le = value.z * 255.0 + value.w;"," vec3 Xp_Y_XYZp;"," Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);"," Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;"," Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;"," vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;"," return vec4( max(vRGB, 0.0), 1.0 );","}"].join(` -`),[new rt("const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );")])},Bt.LINEAR_TO_LINEAR="LinearToLinear",Bt.GAMMA_TO_LINEAR="GammaToLinear",Bt.LINEAR_TO_GAMMA="LinearToGamma",Bt.SRGB_TO_LINEAR="sRGBToLinear",Bt.LINEAR_TO_SRGB="LinearTosRGB",Bt.RGBE_TO_LINEAR="RGBEToLinear",Bt.LINEAR_TO_RGBE="LinearToRGBE",Bt.RGBM_TO_LINEAR="RGBMToLinear",Bt.LINEAR_TO_RGBM="LinearToRGBM",Bt.RGBD_TO_LINEAR="RGBDToLinear",Bt.LINEAR_TO_RGBD="LinearToRGBD",Bt.LINEAR_TO_LOG_LUV="LinearToLogLuv",Bt.LOG_LUV_TO_LINEAR="LogLuvToLinear";var bi=class extends xt{toJSON(e){let t=super.toJSON(e),n=e===void 0||typeof e=="string";if(this.image!==void 0&&!n){let i=this.image;if(Array.isArray(i)){e.images[i.uuid].url=[];for(let s=0;s 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);n=e.include(s);break;default:n=e.include(gc.Nodes.uv);break}if(this.projection.value===1&&this.firstTime){let s=`g${this.uuid.toString().replace(/-/g,"")}`;e.addVertexParsCode(`varying vec2 ${s}_vCustomUv;`),e.addFragmentParsCode(`varying vec2 ${s}_vCustomUv;`),e.addVertexFinalCode(` - vec3 ${s}_posN = transformed; -${this.axis.value===0?` - float ${s}_u = (1. + (${s}_posN.z)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - -${this.axis.value===1?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. - (${s}_posN.z)) / 2.; - `:""} - -${this.axis.value===2?` - float ${s}_u = (1. + (${s}_posN.x)) / 2.; - float ${s}_v = (1. + (${s}_posN.y)) / 2.; - `:""} - - ${s}_vCustomUv = vec2(${s}_u, ${s}_v); - `)}e.addFragmentVariable(this.calpha,"float");let i=[];return i.push(this.texture.getTexture(e,"t")),i.push(this.textureSize.build(e,"v2")),i.push(this.crop.build(e,"f")),i.push(this.mat.build(e,"mat3")),i.push(this.size.build(e,"v2")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),this.firstTime=!this.firstTime,e.format(n+"("+i.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.textureSize=this.textureSize.toJSON(e).uuid,t.crop=this.crop.toJSON(e).uuid,t.projection=this.projection.toJSON(e).uuid,t.axis=this.axis.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture),this.texture.value.updateMatrix(),this.mat=new zr(this.texture.value.matrix)),e.textureSize&&(this.textureSize=t.getNode(e.textureSize)),e.crop&&(this.crop=t.getNode(e.crop)),e.projection&&(this.projection=t.getNode(e.projection)),e.axis&&(this.axis=t.getNode(e.axis)),e.size&&(this.size=t.getNode(e.size)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.texture.copy(e.texture),this.textureSize=e.textureSize.clone(),this.crop=e.crop.clone(),this.projection=e.projection.clone(),this.axis=e.axis.clone(),this.size=e.size.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this}},za=gc;za.Nodes=function(){let e=new Le(` -vec3 cylindricalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(position); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float scaledHeight = position.y / (size.y * 0.5); - float v = (scaledHeight / 2.) + .5; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),t=new Le(` -vec3 sphericalTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - vec3 posN = normalize(vPosition); - float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); - float v = 0.5 + asin(posN.y) / 3.1415; - - vec2 calculatedUv = vec2(u,v); - vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - - vec2 df = fwidth(uvs); - if(df.x > 0.5) df.x = 0.; - #ifdef GL_EXT_shader_texture_lod - vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #else - vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); - #endif - - vec3 col = tmp.rgb; - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - } -`),n=new Le(`vec3 uvTexture(sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float alpha, int mode, out float calpha) { - - vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; - vec4 tmp = texture2D( tex, uvs ); - - vec3 col = tmp.rgb; - - float lalpha = alpha * tmp.a; - if ( crop > 0.5 ) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - lalpha = 0.0; - } - } - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return col; - }`);return{cylindrical:e,spherical:t,uv:n}}();var Hp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Fresnel";this.color=e,this.bias=t,this.scale=n,this.intensity=i,this.factor=s,this.alpha=o,this.mode=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.require("vWorldViewDir"),e.require("vWorldNormal"),e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Hp.Nodes.fresnel),i=[];return i.push(this.color.build(e,"c")),i.push(this.bias.build(e,"f")),i.push(this.scale.build(e,"f")),i.push(this.intensity.build(e,"f")),i.push(this.factor.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("FresnelNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.color=this.color.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,t.scale=this.scale.toJSON(e).uuid,t.intensity=this.intensity.toJSON(e).uuid,t.factor=this.factor.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.color&&(this.color=t.getNode(e.color)),e.bias&&(this.bias=t.getNode(e.bias)),e.scale&&(this.scale=t.getNode(e.scale)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.factor&&(this.factor=t.getNode(e.factor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.color=e.color.clone(),this.bias=e.bias.clone(),this.scale=e.scale.clone(),this.intensity=e.intensity.clone(),this.factor=e.factor.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}},Ga=Hp;Ga.Nodes=function(){return{fresnel:new Le(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, float alpha, int mode, out float calpha) { - float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWorldNormal ) ) ), intensity ); - - float lalpha = clamp( fresnel, 0.0, 1.0 ) * alpha; - calpha = lalpha / clamp(lalpha + accumAlpha, 0.001, 1.0); - accumAlpha += (1.0 - accumAlpha) * lalpha; - return color; - }`)}}();var Ua;(function(s){s.SIMPLEX="simplex3d",s.SIMPLEX_FRACTAL="simplex3dFractal",s.ASHIMA="simplexAshima",s.FBM="fbm",s.PERLIN="perlin"})(Ua||(Ua={}));var si=function(){let r=5,e=new Le(`vec3 random3(vec3 c) { - float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); - vec3 r; - r.z = fract(512.0*j); - j *= .125; - r.x = fract(512.0*j); - j *= .125; - r.y = fract(512.0*j); - return r-0.5; - }`),t=new Le(`float simplex3d(vec3 p) { - vec3 s = floor(p + dot(p, vec3(F3))); - vec3 x = p - s + dot(s, vec3(G3)); - - vec3 e = step(vec3(0.0), x - x.yzx); - vec3 i1 = e*(1.0 - e.zxy); - vec3 i2 = 1.0 - e.zxy*(1.0 - e); - - vec3 x1 = x - i1 + G3; - vec3 x2 = x - i2 + 2.0*G3; - vec3 x3 = x - 1.0 + 3.0*G3; - - vec4 w, d; - - w.x = dot(x, x); - w.y = dot(x1, x1); - w.z = dot(x2, x2); - w.w = dot(x3, x3); - - w = max(0.6 - w, 0.0); - - d.x = dot(random3(s), x); - d.y = dot(random3(s + i1), x1); - d.z = dot(random3(s + i2), x2); - d.w = dot(random3(s + 1.0), x3); - - w *= w; - w *= w; - d *= w; - - return dot(d, vec4(52.0)); - }`,[e]);t.keywords.F3=new rt("float F3 0.3333333"),t.keywords.G3=new rt("float G3 0.1666667");let n=new Le(`float simplex3dFractal(vec3 m) { - mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); - mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); - mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); - return 0.5333333 * simplex3d(m * rot1) - + 0.2666667 * simplex3d(2.0 * m * rot2) - + 0.1333333 * simplex3d(4.0 * m * rot3) - + 0.0666667 * simplex3d(8.0 * m); - }`,[t]),i=new Le("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),s=new Le("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),o=new Le(`float simplexAshima(vec3 v) { - const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; - const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); - vec3 i = floor(v + dot(v, C.yyy) ); - vec3 x0 = v - i + dot(i, C.xxx) ; - vec3 g = step(x0.yzx, x0.xyz); - vec3 l = 1.0 - g; - vec3 i1 = min( g.xyz, l.zxy ); - vec3 i2 = max( g.xyz, l.zxy ); - vec3 x1 = x0 - i1 + 1.0 * C.xxx; - vec3 x2 = x0 - i2 + 2.0 * C.xxx; - vec3 x3 = x0 - 1. + 3.0 * C.xxx; - i = mod(i, 289.0 ); - vec4 p = permute( permute( permute( - i.z + vec4(0.0, i1.z, i2.z, 1.0 )) - + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) - + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); - float n_ = 1.0/7.0; // N=7 - vec3 ns = n_ * D.wyz - D.xzx; - vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) - vec4 x_ = floor(j * ns.z); - vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) - vec4 x = x_ *ns.x + ns.yyyy; - vec4 y = y_ *ns.x + ns.yyyy; - vec4 h = 1.0 - abs(x) - abs(y); - vec4 b0 = vec4( x.xy, y.xy ); - vec4 b1 = vec4( x.zw, y.zw ); - vec4 s0 = floor(b0)*2.0 + 1.0; - vec4 s1 = floor(b1)*2.0 + 1.0; - vec4 sh = -step(h, vec4(0.0)); - vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; - vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; - vec3 p0 = vec3(a0.xy,h.x); - vec3 p1 = vec3(a0.zw,h.y); - vec3 p2 = vec3(a1.xy,h.z); - vec3 p3 = vec3(a1.zw,h.w); - vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); - m = m * m; - return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), - dot(p2,x2), dot(p3,x3) ) ); - }`,[i,s]),a=new Le("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new Le("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[a]),c=new Le(`float noise(vec3 p){ - vec3 a = floor(p); - vec3 d = p - a; - d = d * d * (3.0 - 2.0 * d); - vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); - vec4 k1 = perm(b.xyxy); - vec4 k2 = perm(k1.xyxy + b.zzww); - vec4 c = k2 + a.zzzz; - vec4 k3 = perm(c); - vec4 k4 = perm(c + 1.0); - vec4 o1 = fract(k3 * (1.0 / 41.0)); - vec4 o2 = fract(k4 * (1.0 / 41.0)); - vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); - vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); - return o4.y * d.y + o4.x * (1.0 - d.y); - }`,[l]),u=new Le(`float fbm(vec3 x) { - float v = 0.0; - float a = 0.5; - vec3 shift = vec3(100); - for (int i = 0; i < NUM_OCTAVES; ++i) { - v += a * noise(x); - x = x * 2.0 + shift; - a *= 0.5; - } - return v; - }`,[c]);u.keywords.NUM_OCTAVES=new rt(`int NUM_OCTAVES ${r}`);let h=new Le("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new Le(`float perlin(vec3 P){ - vec3 Pi0 = floor(P); - vec3 Pi1 = Pi0 + vec3(1.0); - Pi0 = mod(Pi0, 289.0); - Pi1 = mod(Pi1, 289.0); - vec3 Pf0 = fract(P); - vec3 Pf1 = Pf0 - vec3(1.0); - vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec4 iy = vec4(Pi0.yy, Pi1.yy); - vec4 iz0 = Pi0.zzzz; - vec4 iz1 = Pi1.zzzz; - vec4 ixy = permute(permute(ix) + iy); - vec4 ixy0 = permute(ixy + iz0); - vec4 ixy1 = permute(ixy + iz1); - vec4 gx0 = ixy0 / 7.0; - vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; - gx0 = fract(gx0); - vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); - vec4 sz0 = step(gz0, vec4(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - 0.5); - gy0 -= sz0 * (step(0.0, gy0) - 0.5); - vec4 gx1 = ixy1 / 7.0; - vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; - gx1 = fract(gx1); - vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); - vec4 sz1 = step(gz1, vec4(0.0)); - gx1 -= sz1 * (step(0.0, gx1) - 0.5); - gy1 -= sz1 * (step(0.0, gy1) - 0.5); - vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); - vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); - vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); - vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); - vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); - vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); - vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); - vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); - vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - float n000 = dot(g000, Pf0); - float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); - float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); - float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); - float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); - float n111 = dot(g111, Pf1); - vec3 fade_xyz = fade(Pf0); - vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); - vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; - }`,[i,s,h]);return{simplex:t,simplexFractal:n,simplexAshima:o,fbm:u,perlin:d}}();var jp=class extends je{constructor(e,t,n,i,s,o,a){super("v3");this.nodeType="Rainbow";this.filmThickness=e,this.movement=t,this.wavelengths=n,this.noiseStrength=i,this.noiseScale=s,this.offset=o,this.alpha=a,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.require("normal"),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(jp.Nodes.rainbow),i=[];return i.push(this.filmThickness.build(e,"f")),i.push(this.movement.build(e,"f")),i.push(this.wavelengths.build(e,"v3")),i.push(this.noiseStrength.build(e,"f")),i.push(this.noiseScale.build(e,"f")),i.push(this.offset.build(e,"v3")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("RainbowNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.filmThickness=this.filmThickness.toJSON(e).uuid,t.movement=this.movement.toJSON(e).uuid,t.wavelengths=this.wavelengths.toJSON(e).uuid,t.noiseStrength=this.noiseStrength.toJSON(e).uuid,t.noiseScale=this.noiseScale.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.filmThickness&&(this.filmThickness=t.getNode(e.filmThickness)),e.movement&&(this.movement=t.getNode(e.movement)),e.wavelengths&&(this.wavelengths=t.getNode(e.wavelengths)),e.noiseStrength&&(this.noiseStrength=t.getNode(e.noiseStrength)),e.noiseScale&&(this.noiseScale=t.getNode(e.noiseScale)),e.offset&&(this.offset=t.getNode(e.offset)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(e),this.filmThickness=e.filmThickness.clone(),this.movement=e.movement.clone(),this.wavelengths=e.wavelengths.clone(),this.noiseStrength=e.noiseStrength.clone(),this.noiseScale=e.noiseScale.clone(),this.offset=e.offset.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},ka=jp;ka.Nodes=function(){let e=new Le(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { - vec3 viewDir = normalize(-(cameraPosition + offset)); - vec3 st = position / noiseScale; - vec3 q = vec3(simplex3d(st), - simplex3d(st + vec3(1.0)), - simplex3d(st + vec3(1.0))); - - vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), - simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), - simplex3d(st * q)); - - float noise = simplex3d(st + r); - - return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vObjectNormal), viewDir)) + movement); - }`,[si.simplex]);return{rainbow:new Le(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, float alpha, out float calpha) { - vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); - - float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); - float lalpha = alpha * rainbowContribution; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return res; - }`,[e])}}();var Wp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Transmission";this.thickness=e,this.ior=t,this.roughness=n,this.transmissionSamplerSize=i,this.transmissionSamplerMap=s,this.transmissionDepthMap=o,this.aspectRatio=a,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.extensions.shaderTextureLOD=!0,e.extensions.derivatives=!0,e.isShader("fragment")){e.define("NUM_SAMPLES",30),e.require("worldPosition"),e.requires.worldNormal=!0,e.requires.modelMatrix=!0,e.requires.projectionMatrix=!0,e.addFragmentVariable(this.calpha,"float");let n=e.include(Wp.Nodes.transmission),i=[];return i.push(this.thickness.build(e,"f")),i.push(this.ior.build(e,"f")),i.push(this.roughness.build(e,"f")),i.push(this.transmissionSamplerSize.build(e,"v2")),i.push(this.transmissionSamplerMap.getTexture(e,"t")),i.push(this.transmissionDepthMap.getTexture(e,"t")),i.push(this.aspectRatio.build(e,"v2")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("TransmissionNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.thickness=this.thickness.toJSON(e).uuid,t.ior=this.ior.toJSON(e).uuid,t.roughness=this.roughness.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.thickness&&(this.thickness=t.getNode(e.thickness)),e.ior&&(this.ior=t.getNode(e.ior)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.calpha&&(this.calpha=e.calpha),this}copy(e){return super.copy(this),this.thickness=e.thickness.clone(),this.ior=e.ior.clone(),this.roughness=e.roughness.clone(),this.transmissionSamplerSize=e.transmissionSamplerSize.clone(),this.transmissionSamplerMap=e.transmissionSamplerMap,this.transmissionDepthMap=e.transmissionDepthMap,this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}},Va=Wp;Va.Nodes=function(){let e=new Le(` - float gaussian(vec2 i) { - const float sigma = float(NUM_SAMPLES) * .25; - return exp( -.5* dot(i/=sigma,i) ) / ( 6.28 * sigma*sigma ); - }`),t=new Le(` - vec4 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { - // Slightly modified version of this: - // https://www.shadertoy.com/view/ltScRG - - const int LOD = 2; - const int sLOD = 4; // tile size = 2^LOD - - vec4 O = vec4(0); - const int s = NUM_SAMPLES/sLOD; - for ( int i = 0; i < s*s; i++ ) { - int modulo = (i)-((i)/(s))*(s); - vec2 d = vec2(float(modulo), float(i/s))*float(sLOD) - float(NUM_SAMPLES)/2.; - vec2 uv = U + (scale * aspectRatio) * d; - // What is the depth of the opaque object we're trying to sample - float opaqueDepth = texture2D(dm, uv).r; - if (opaqueDepth < gl_FragCoord.z) { - uv = unrefractedU + ((scale * min(lod / 2., 1.)) * aspectRatio) * d; - lod = lod > 4.0 ? lod : lod / 2.0; - } - #ifdef TEXTURE_LOD_EXT - O += gaussian(d) * texture2DLodEXT( sp, uv, lod); - #else - O += gaussian(d) * textureLod( sp, uv, lod); - #endif - } - return O / O.a; - }`,[e]),n=new Le(` - vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { - // Direction of refracted light. - vec3 refractionVector = refract( -v, n, 1.0 / ior ); - // Compute rotation-independant scaling of the model matrix. - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - // The thickness is specified in local space. - return normalize( refractionVector ) * thickness * modelScale; - }`),i=new Le(` -float applyIorToRoughness( float roughness, float ior ) { - // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and - // an IOR of 1.5 results in the default amount of microfacet refraction. - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } `),s=new Le(` -vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { - float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - float lod = applyIorToRoughness(roughness, ior); - - return blur(transmissionSamplerMap, fragCoord, vec2(lod / (transmissionSamplerSize.x / 2.)), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); - }`,[i,t]),o=new Le(` -vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - - // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - - vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); - vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; - unrefractedCoords += 1.0; - unrefractedCoords /= 2.0; - - // Sample framebuffer to get pixel the refracted ray hits. - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); - // Get the specular component. - return vec4( ( 1.0 ) * transmittedLight.rgb, transmittedLight.a ); - }`,[s,n]);return{transmission:new Le(` - vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float alpha, out float calpha) { - vec3 v = vec3(0.); - if (isOrthographic) { - v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - v = normalize(vWPosition - cameraPosition); - } - vec4 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); - float lalpha = alpha; - - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - return transmission.rgb; - }`,[o])}}();var Jp=class extends je{constructor(e,t){super("v3");this.nodeType="CustomNormal";this.cnormal=e,this.alpha=t}generate(e,t){if(e.isShader("fragment")){let n=e.include(Jp.Nodes.customNormal),i=[];return i.push(this.cnormal.build(e,"v3")),i.push("normal"),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("CustomNormalNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.cnormal=this.cnormal.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.cnormal&&(this.cnormal=t.getNode(e.cnormal)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.cnormal.copy(e.cnormal),this.alpha.copy(e.alpha),this}},Ha=Jp;Ha.Nodes=function(){return{customNormal:new Le(`vec3 customNormal(vec3 cnormal, vec3 norm, float alpha) { - vec3 normal = packNormalToRGB( norm ).rgb; - normal *= step( vec3(0.5), cnormal ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return normal; - }`)}}();var Xp=class extends je{constructor(e,t,n,i,s,o,a,l,c){super("v3");this.nodeType="Gradient";this.glType=e,this.num=t,this.smooth=n,this.colors=i,this.steps=s,this.offset=o,this.morph=a,this.angle=l,this.alpha=c,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.define("GRAD_MAX",10),e.require("uv"),e.requires.uv=[!0],e.addFragmentVariable(this.calpha,"float");let n=e.include(Xp.Nodes.gradient),i=[];return i.push(this.glType.build(e,"i")),i.push(this.num.build(e,"i")),i.push(this.smooth.build(e,"b")),i.push(this.colors.build(e,"v4[]")),i.push(this.steps.build(e,"f[]")),i.push(this.offset.build(e,"v2")),i.push(this.morph.build(e,"v2")),i.push(this.angle.build(e,"f")),i.push(this.alpha.build(e,"f")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("GradientNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.glType=this.glType.toJSON(e).uuid,t.num=this.num.toJSON(e).uuid,t.smooth=this.smooth.toJSON(e).uuid,t.colors=this.colors.toJSON(e).uuid,t.steps=this.steps.toJSON(e).uuid,t.offset=this.offset.toJSON(e).uuid,t.morph=this.morph.toJSON(e).uuid,t.angle=this.angle.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}copy(e){return super.copy(e),this.glType=e.glType.clone(),this.num=e.num.clone(),this.smooth=e.smooth.clone(),this.colors=e.colors.clone(),this.steps=e.steps.clone(),this.offset=e.offset.clone(),this.morph=e.morph.clone(),this.angle=e.angle.clone(),this.alpha=e.alpha.clone(),this.calpha=e.calpha,this}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.glType&&(this.glType=t.getNode(e.glType)),e.num&&(this.num=t.getNode(e.num)),e.smooth&&(this.smooth=t.getNode(e.smooth)),e.colors&&(this.colors=t.getNode(e.colors)),e.steps&&(this.steps=t.getNode(e.steps)),e.offset&&(this.offset=t.getNode(e.offset)),e.morph&&(this.morph=t.getNode(e.morph)),e.angle&&(this.angle=t.getNode(e.angle)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}},ja=Xp;ja.Nodes=function(){return{gradient:new Le(`vec3 gradient(int glType, int num, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, float alpha, out float calpha) { - vec4 color = colors[0]; - vec2 m = morph / vUv.xy; - vec2 rot = vec2( 0.5 + m.x, m.y ); - vec2 dt = vec2( - cos( angle ) * rot.x - sin( angle ) * rot.y, - sin( angle ) * rot.x + cos( angle ) * rot.y - ); - vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; - float t = dot( pt, dt ) / dot( dt, dt ); - if ( glType == 1 ) { - t = distance ( - ( vUv + morph ) * 3.0, - ( vUv + offset ) + 1.0 - ) + angle; - } else if ( glType == 2 ) { - float polar = atan( - vUv.x + morph.x - 0.5 + offset.x, - vUv.y + morph.y - 0.5 + offset.y - ) * -1.0; - t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); - } - - float p; - if (smoothed) { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); - } - - } else { - for ( int i = 1; i < GRAD_MAX; i++ ) { - p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); - color = mix(color, colors[i], p); - } - } - - float lalpha = alpha * color.a; - calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * lalpha; - - return color.xyz; - }`)}}();var So;(function(t){t.NOISE="noise",t.MAP="map"})(So||(So={}));var qp=class extends je{constructor(e=new it(0),t,n,i,s,o){super("v3");this.nodeType="VertexDisplacement";this.displacementTypeIndex=e,this.intensity=t,this.movementOrTexture=n,Object.values(So)[this.displacementTypeIndex.value]===So.MAP&&(this.mat=new zr(this.movementOrTexture.value.matrix)),this.cropOrOffset=i,this.scale=s,this.noiseFunctionIndex=o}generate(e,t){if(e.isShader("vertex")){e.define("USE_LAYER_DISPLACE");let n,i=[];switch(i.push("displaced_position"),i.push("displaced_normal"),Object.values(So)[this.displacementTypeIndex.value]){case So.MAP:{n=e.include(qp.Nodes.map),i.push(this.movementOrTexture.getTexture(e,"t")),i.push("uv"),i.push(this.cropOrOffset.build(e,"f")),this.mat&&i.push(this.mat.build(e,"mat3"));break}case So.NOISE:{let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),l=new Le(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement) { - return p + n * ${o}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),c=new Le(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 tangent1 = orthogonal(normal); - vec3 tangent2 = normalize(cross(normal, tangent1)); - - // TODO(Max): The distance to the neighbors was originally scaled by 0.1. - // This caused some small oval/circular visual artifacts in the lighting. - // For now, simply using neighbors further away betters the problem, - // but we should figure out the underlying cause when we have some time. - // Maybe its related to how we calculate the tangent and bitangent? - vec3 nearby1 = position + tangent1; - vec3 nearby2 = position + tangent2; - vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement); - vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement); - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[l,a]);n=e.include(c),i.push(this.scale.build(e,"f")),i.push(this.cropOrOffset.build(e,"v3")),i.push(this.movementOrTexture.build(e,"f"));break}}return i.push(this.intensity.build(e,"f")),i.push("displaced_normal"),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("VertexDisplacementNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.intensity=this.intensity.toJSON(e).uuid,t.scale=(n=this.scale)==null?void 0:n.toJSON(e).uuid,t.movementOrTexture=this.movementOrTexture.toJSON(e).uuid,t.cropOrOffset=this.cropOrOffset.toJSON(e).uuid),t.displacementTypeIndex=this.displacementTypeIndex,t.noiseFunctionIndex=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),this.displacementTypeIndex=e.displacementTypeIndex,this.noiseFunctionIndex=e.noiseFunctionIndex,e.cropOrOffset&&(this.cropOrOffset=t.getNode(e.cropOrOffset)),e.intensity&&(this.intensity=t.getNode(e.intensity)),e.movementOrTexture&&(this.displacementTypeIndex.value===1?(this.movementOrTexture=t.getNode(e.movementOrTexture),this.movementOrTexture.value.updateMatrix(),this.mat=new zr(this.movementOrTexture.value.matrix)):this.displacementTypeIndex.value===0&&(this.movementOrTexture=t.getNode(e.movementOrTexture))),e.scale&&(this.scale=t.getNode(e.scale)),this}copy(e){var t,n;return super.copy(e),this.noiseFunctionIndex=(t=e.noiseFunctionIndex)==null?void 0:t.clone(),this.scale=(n=e.scale)==null?void 0:n.clone(),this.cropOrOffset=e.cropOrOffset.clone(),this.intensity=e.intensity.clone(),this.movementOrTexture=e.movementOrTexture.clone(),this}},Mo=qp;Mo.Nodes=function(){let e=new Le(`vec3 orthogonal(vec3 v) { - return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); - }`),t=new Le(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { - vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; - vec4 tmp = texture2D(tex, uvs); - vec3 col = tmp.rgb; - if (crop > 0.5) { - if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { - return 0.0; - } - } - return col.r; - }`);return{map:new Le(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { - vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; - vec3 tangent1 = normalize(orthogonal(normal)); - vec3 tangent2 = normalize(cross(normal, tangent1)); - vec3 nearby1 = position + tangent1 * 0.1; - vec3 nearby2 = position + tangent2 * 0.1; - vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; - displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); - return displaced_position; - }`,[e,t])}}();var Wa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze,s=new ze,o=new ze,a=new ze,l=new ze,c=new ze,u=new ze,h=new ze,d=new ze,f=new ze,p=new ze,m=new ze,v=new ze){super("v3");this.nodeType="Noise";this.scale=e,this.size=t,this.move=n,this.fA=i,this.fB=s,this.distortion=o,this.colorA=a,this.colorB=l,this.colorC=c,this.colorD=u,this.intA=h,this.intB=d,this.intC=f,this.intD=p,this.alpha=m,this.noiseFunctionIndex=v}generate(e,t,n,i,s){e.require("uv"),e.requires.uv=[!0];let o=Object.values(Ua)[this.noiseFunctionIndex.value],a=new Le(`vec3 ${o}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec3 colorA, vec3 colorB, vec3 colorC, vec3 colorD, float intA, float intB, float intC, float intD, float alpha) { - vec3 st = position / size; - st /= scale; - vec3 q = vec3(${o}(st), - ${o}(st + vec3(1.0)), - ${o}(st + vec3(1.0))); - vec3 r = vec3(${o}(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), - ${o}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), - ${o}(st * q)); - float f = ${o}(st + r); - vec3 color; - color = mix(colorA * intA, colorB * intB, clamp((f * f) * 4.0, 0.0, 1.0)); - color = mix(color, colorC * intC, clamp(length(q), 0.0, 1.0)); - color = mix(color, colorD * intD, clamp(length(r.x), 0.0, 1.0)); - accumAlpha += (1.0 - accumAlpha) * alpha; - return clamp(color, 0.0, 1.0); - }`,[si.simplex,si.simplexFractal,si.simplexAshima,si.fbm,si.perlin]),l=e.include(a),c=[];return c.push(this.scale.build(e,"f")),c.push(this.size.build(e,"v3")),c.push(this.move.build(e,"f")),c.push(this.fA.build(e,"v2")),c.push(this.fB.build(e,"v2")),c.push(this.distortion.build(e,"v2")),c.push(this.colorA.build(e,"c")),c.push(this.colorB.build(e,"c")),c.push(this.colorC.build(e,"c")),c.push(this.colorD.build(e,"c")),c.push(this.intA.build(e,"f")),c.push(this.intB.build(e,"f")),c.push(this.intC.build(e,"f")),c.push(this.intD.build(e,"f")),c.push(this.alpha.build(e,"f")),e.format(l+"("+c.join(",")+")",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scale=this.scale.toJSON(e).uuid,t.size=this.size.toJSON(e).uuid,t.move=this.move.toJSON(e).uuid,t.fA=this.fA.toJSON(e).uuid,t.fB=this.fB.toJSON(e).uuid,t.distortion=this.distortion.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.colorC=this.colorC.toJSON(e).uuid,t.colorD=this.colorD.toJSON(e).uuid,t.intA=this.intA.toJSON(e).uuid,t.intB=this.intB.toJSON(e).uuid,t.intC=this.intC.toJSON(e).uuid,t.intD=this.intD.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.noiseFunction=this.noiseFunctionIndex,t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scale&&(this.scale=t.getNode(e.scale)),e.size&&(this.size=t.getNode(e.size)),e.move&&(this.move=t.getNode(e.move)),e.fA&&(this.fA=t.getNode(e.fA)),e.fB&&(this.fB=t.getNode(e.fB)),e.distortion&&(this.distortion=t.getNode(e.distortion)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.colorC&&(this.colorC=t.getNode(e.colorC)),e.colorD&&(this.colorD=t.getNode(e.colorD)),e.intA&&(this.intA=t.getNode(e.intA)),e.intB&&(this.intB=t.getNode(e.intB)),e.intC&&(this.intC=t.getNode(e.intC)),e.intD&&(this.intD=t.getNode(e.intD)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.noiseFunctionIndex&&(this.noiseFunctionIndex=t.getNode(e.noiseFunctionIndex)),this}copy(e){return super.copy(e),this.scale.copy(e.scale),this.size.copy(e.size),this.move.copy(e.move),this.fA.copy(e.fA),this.fB.copy(e.fB),this.distortion.copy(e.distortion),this.colorA.copy(e.colorA),this.colorB.copy(e.colorB),this.colorC.copy(e.colorC),this.colorD.copy(e.colorD),this.intA.copy(e.intA),this.intB.copy(e.intB),this.intC.copy(e.intC),this.intD.copy(e.intD),this.alpha.copy(e.alpha),this.noiseFunctionIndex.copy(e.noiseFunctionIndex),this}};Wa.numOctaves=5;var Ja;(function(i){i.ADD="+",i.SUB="-",i.MUL="*",i.DIV="/"})(Ja||(Ja={}));var Yp=class extends je{constructor(e=new ze,t=new ze,n=Yp.ADD){super();this.nodeType="Operator";this.type=e.type,this.a=e,this.b=t,this.op=n}getType(e){let t=this.a.getType(e),n=this.b.getType(e);return e.isTypeMatrix(t)?"v4":e.getTypeLength(n)>e.getTypeLength(t)?n:t}generate(e,t){let n=this.getType(e);this.type=n;let i=this.a.build(e,n),s=this.b.build(e,n);return e.format("( "+i+" "+this.op+" "+s+" )",n,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),this}},Yn=Yp;Yn.ADD=Ja.ADD,Yn.SUB=Ja.SUB,Yn.MUL=Ja.MUL,Yn.DIV=Ja.DIV;var Xa=class extends je{constructor(e=new ze,t=new ze,n=new ze,i=new ze){super("v3");this.nodeType="Blend";this.a=e,this.b=t,this.alpha=n,this.mode=i}generate(e,t){if(e.isShader("fragment")){let n=[];return n.push(this.a.build(e,"c")),n.push(this.b.build(e,"c")),n.push(this.alpha.build(e,"f")),n.push(this.mode.build(e,"i")),e.format("spe_blend("+n.join(",")+")",this.getType(e),t)}else return console.warn("BlendNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.alpha.copy(e.alpha),this.mode.copy(e.mode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.mode&&(this.mode=t.getNode(e.mode)),this}};var Kp=class extends je{constructor(e,t,n,i,s,o,a,l){super("v3");this.nodeType="Depth";this.near=e,this.far=t,this.isVector=n,this.isWorldSpace=i,this.origin=s,this.colorA=o,this.colorB=a,this.alpha=l}generate(e,t){if(e.isShader("fragment")){e.require("worldPosition");let n=e.include(Kp.Nodes.sdepth),i=[];return i.push(this.near.build(e,"f")),i.push(this.far.build(e,"f")),i.push(this.isVector.build(e,"f")),i.push(this.isWorldSpace.build(e,"f")),i.push(this.origin.build(e,"v3")),i.push(this.colorA.build(e,"v3")),i.push(this.colorB.build(e,"v3")),i.push(this.alpha.build(e,"f")),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("DepthNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.near=this.near.toJSON(e).uuid,t.far=this.far.toJSON(e).uuid,t.isVector=this.isVector.toJSON(e).uuid,t.isWorldSpace=this.isWorldSpace.toJSON(e).uuid,t.origin=this.origin.toJSON(e).uuid,t.colorA=this.colorA.toJSON(e).uuid,t.colorB=this.colorB.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.near&&(this.near=t.getNode(e.near)),e.far&&(this.far=t.getNode(e.far)),e.isVector&&(this.isVector=t.getNode(e.isVector)),e.isWorldSpace&&(this.isWorldSpace=t.getNode(e.isWorldSpace)),e.origin&&(this.origin=t.getNode(e.origin)),e.colorA&&(this.colorA=t.getNode(e.colorA)),e.colorB&&(this.colorB=t.getNode(e.colorB)),e.alpha&&(this.alpha=t.getNode(e.alpha)),this}copy(e){return super.copy(e),this.near=e.near.clone(),this.far=e.far.clone(),this.isVector=e.isVector.clone(),this.isWorldSpace=e.isWorldSpace.clone(),this.origin=e.origin.clone(),this.colorA=e.colorA.clone(),this.colorB=e.colorB.clone(),this.alpha=e.alpha.clone(),this}},qa=Kp;qa.Nodes=function(){return{sdepth:new Le(`vec3 sdepth(float near, float far, float isVector, float isWorldSpace, vec3 origin, vec3 colorA, vec3 colorB, float alpha) { - float dist; - if (isVector > 0.5) { - dist = (isWorldSpace > 0.5) ? length(vWPosition - origin) : length(position - origin); - } else { - dist = length (vWPosition - cameraPosition); - } - float dep = ( dist - near ) / ( far - near ); - vec3 depth = mix( colorB, colorA, 1.0 - clamp( dep, 0., 1. ) ); - - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return depth; - }`)}}();var Qp=class extends je{constructor(e,t,n,i){super("v3");this.nodeType="Matcap";this.color=e,this.texture=t,this.alpha=n,this.mode=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(e,t){if(e.isShader("fragment")){e.addFragmentVariable(this.calpha,"float");let n=e.include(Qp.Nodes.matcap);e.require("normal"),e.requires.normal=!0;let i=[];return i.push(this.color.build(e,"v3")),i.push(this.texture.getTexture(e,"t")),i.push("normal"),i.push(this.alpha.build(e,"f")),i.push(this.mode.build(e,"i")),i.push(this.calpha),e.format(n+"("+i.join(",")+")",this.getType(e),t)}else return console.warn("MatcapNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.texture=e.texture.clone(),this.color=e.color.clone(),this.alpha=e.alpha.clone(),this.mode=e.mode.clone(),this.calpha=e.calpha,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.texture=this.texture.toJSON(e).uuid,t.color=this.color.toJSON(e).uuid,t.alpha=this.alpha.toJSON(e).uuid,t.mode=this.mode.toJSON(e).uuid,t.calpha=this.calpha),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.calpha&&(this.calpha=e.calpha),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.texture&&(this.texture=t.getNode(e.texture)),e.color&&(this.color=t.getNode(e.color)),e.mode&&(this.mode=t.getNode(e.mode)),this}},Ya=Qp;Ya.Nodes=function(){return{matcap:new Le(`vec3 matcap(vec3 color, sampler2D matcapTex, vec3 normal, float alpha, int mode, out float calpha) { - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - vec4 matcapColor = texture2D( matcapTex, uv ); - // matcapColor = matcapTexelToLinear( matcapColor ); - matcapColor.rgb *= color; - - calpha = alpha / clamp( alpha + accumAlpha, 0.00001, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * alpha; - - return matcapColor.rgb; - } - `)}}();var Kn=class{constructor(e){this.id=2,this.layerCount=2,this.uuid=Ee.generateUUID(),this.needsUpdate=!1,this._material=e,this._layerNodes=[];let t=this._createLayer({id:0,type:lt.COLOR});this._material.color=t.color,this._material.alpha===void 0&&(this._material.alpha=new Te(1));let n=new Te(1),i=new it(0);"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=n,this._material.shadingBlend=i),this._layerNodes.push({id:0,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),this._layerNodes.push({id:1,type:Gt.LIGHTING,alpha:n,mode:i}),this.head=t.layer,this.head.next=new jt(1,{type:lt.LIGHTING,alpha:n,mode:i}),this.attachLightNodes()}get material(){return this._material}set material(e){this._material=e;let t,n,i=this.head;for(;i!==void 0;){if(i.type===lt.LIGHTING){t=i.uniforms[`f${i.id}_alpha`],n=i.uniforms[`f${i.id}_mode`];break}i=i.next}"shadingAlpha"in this._material&&"shadingBlend"in this._material&&(this._material.shadingAlpha=t,this._material.shadingBlend=n),this.attachLightNodes(),this.blendColors(),this.blendAfterColors(),this.blendPositions()}getLayersOfType(e){let t=[],n=this.head;for(;n;)n.type===e&&t.push(n),n=n.next;return t}addLayer(e){var i;if(e.id=(i=e.id)!=null?i:++this.id,this.layerCount++,e.type===lt.LIGHTING){let s=this.createLightLayer(e);return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}let t=this._createLayer(e),n=t.layer;if(this.head===void 0)this.head=n;else{let s=this.head;for(;s.next!=null;)s=s.next;s.next=n}return t.color&&this._layerNodes.push({id:n.id,type:Gt.COLOR,color:t.color,alpha:t.alpha,mode:t.mode}),t.position&&this._layerNodes.push({id:n.id,type:Gt.POSITION,position:t.position}),this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),n}addLayerBeforeAt(e,t){var a;let n=this.head;e.id=(a=e.id)!=null?a:++this.id,this.layerCount++;let i=this._createLayer(e),s=i.layer;s.next=t;let o=0;if(n===t)this.head=s,i.color&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(0,0,{id:s.id,type:Gt.POSITION,position:i.position});else{for(o=1;(n==null?void 0:n.next)!==t;)n=n==null?void 0:n.next,o++;n.next=s,i.color&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.COLOR,color:i.color,alpha:i.alpha,mode:i.mode}),i.position&&this._layerNodes.splice(o,0,{id:s.id,type:Gt.POSITION,position:i.position})}return this.uuid=Ee.generateUUID(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),s}addLayerAt(e,t){var s;t.id=(s=t.id)!=null?s:++this.id,this.layerCount++;let n=this._createLayer(t),i=n.layer;if(n.color&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.COLOR,color:n.color,alpha:n.alpha,mode:n.mode}),n.position&&this._layerNodes.splice(e,0,{id:i.id,type:Gt.POSITION,position:n.position}),e==0)i.next=this.head,this.head=i;else{let o=this.head,a=this.head.next;for(let l=0;ll.clone&&!n?l.clone():l);else{let l=t.uniforms[a].value;if(o==="transmissionDepthMap"){i[o]=l;continue}l!=null&&(i[o]=l.clone&&!n&&!l.isRenderTargetTexture?l.clone():l)}}this.addLayer(i)}}attachLightNodes(e){var i,s,o,a,l,c,u,h,d,f,p;let t={},n=this.getLightLayer();switch(this._material.userData.category){case"Lambert":t.emissive=new ct((s=(i=e==null?void 0:e.getValue("emissive"))==null?void 0:i.clone())!=null?s:0);break;case"Phong":t.shininess=new Te((o=e==null?void 0:e.getValue("shininess"))!=null?o:30),t.specular=new ct((l=(a=e==null?void 0:e.getValue("specular"))==null?void 0:a.clone())!=null?l:1118481);break;case"Toon":t.shininess=new Te((c=e==null?void 0:e.getValue("shininess"))!=null?c:30),t.specular=new ct((h=(u=e==null?void 0:e.getValue("specular"))==null?void 0:u.clone())!=null?h:1118481);break;case"Physical":t.roughness=new Te((d=e==null?void 0:e.getValue("roughness"))!=null?d:.3),t.metalness=new Te((f=e==null?void 0:e.getValue("metalness"))!=null?f:0),t.reflectivity=new Te((p=e==null?void 0:e.getValue("reflectivity"))!=null?p:.5);break;default:break}Object.keys(t).forEach(m=>{this._material[m]=t[m],n.uniforms[`f${n.id}_${m}`]=t[m]})}clone(e){return new Kn(e).copy(this)}toJSON(e){return{id:this.id,uuid:this.uuid,head:this.head.toJSON(e)}}fromJSON(e,t,n){let i=new jt(e.head.id,{type:e.head.type}).fromJSON(e.head,t),s=e.head.next,o=i;for(;s!=null;)o.next=new jt(s.id,{type:s.type}).fromJSON(s,t),s=s.next,o=o.next;this._layerNodes=[],this.head=void 0,this.rebuildLayerNodes(this.head,i,!0);let a=i;for(o=this.head;a.next!=null;)this.rebuildLayerNodes(o,a.next,!0),o=o.next,a=a.next;return this._material=n,this.id=e.id,this.uuid=e.uuid,this.blendColors(),this.blendAfterColors(),this.blendPositions(),this}getLightLayer(){var t;let e=this.head;for(;e!==void 0&&e.type!=="light";)e=(t=e.next)!=null?t:e;return e}dispose(){let e=this.head;for(this._layerNodes=[],this.layerCount=0;e!==void 0;)e.hasOwnProperty("dispose")===!0&&e.dispose(),e=e.next;this.head=void 0}_createLayer(e){var n,i,s,o,a,l,c,u,h,d,f,p,m,v,g,y,x,b,w,_,S,A,T,L,C,U,P,R,G,B,j,ne,le,W,z,D,K,q,ee,V,de,ae,te,X,se,$,H,Q,ce,ie,N,E,Y,re,ye,pe,Ie,ve,Fe,Ce,J,xe,he,Ne,Be,ke,ht,ft,Bn,Mt,Tn,En,Di,_r,xn,F,Pe,et,Ft,Nn,Gs,sr,Ll,Il,mu,gu,I,oe;let t=e.type;switch(t){case lt.COLOR:{let k=new ct((n=e.color)!=null?n:5855577),Z=new Te((i=e.alpha)!=null?i:1),ue=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");ue.keywords.alpha=Z;let Me=new it((s=e.mode)!=null?s:0);return k.alpha=Z,{layer:new jt(e.id,{type:t,color:k,alpha:Z,calpha:ue,mode:Me}),color:k,alpha:ue,mode:Me}}case lt.TEXTURE:{let k=(o=e.texture)!=null?o:new bi,Z=k.matrix;e.mat&&Z.copy(e.mat),k.needsUpdate=!0;let ue=new Te((a=e.crop)!=null?a:0),Me=new it((l=e.projection)!=null?l:0),_e=new it((c=e.axis)!=null?c:0),Se=new In((u=e.size)!=null?u:new O(100,100)),De=new Te((h=e.alpha)!=null?h:1),Ve=new it((d=e.mode)!=null?d:0),Oe=new kn(k),He=new Un((f=e.textureSize)!=null?f:new M(k.image?k.image.width:0,k.image?k.image.height:0)),Ge=new za(Oe,He,ue,Me,_e,Se,De,Ve),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Oe,textureSize:He,crop:ue,projection:Me,axis:_e,size:Se,mat:Ge.mat,alpha:De,calpha:Kt,mode:Ve}),color:Ge,alpha:Kt,mode:Ve}}case lt.MATCAP:{let k=new ct((p=e.color)!=null?p:16777215),Z=(m=e.texture)!=null?m:new bi;Z.needsUpdate=!0;let ue=new Te((v=e.alpha)!=null?v:1),Me=new kn(Z),_e=new it((g=e.mode)!=null?g:0),Se=new Ya(k,Me,ue,_e),De=new yt(Se.calpha,"f");return{layer:new jt(e.id,{type:t,texture:Me,color:k,alpha:ue,calpha:De,mode:_e}),color:Se,alpha:De,mode:_e}}case lt.FRESNEL:{let k=new ct((y=e.color)!=null?y:16777215),Z=new Te((x=e.bias)!=null?x:.1),ue=new Te((b=e.scale)!=null?b:1),Me=new Te((w=e.intensity)!=null?w:2),_e=new Te((_=e.factor)!=null?_:1),Se=new Te((S=e.alpha)!=null?S:1),De=new it((A=e.mode)!=null?A:0),Ve=new Ga(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f");return{layer:new jt(e.id,{type:t,color:k,bias:Z,scale:ue,intensity:Me,factor:_e,alpha:Se,calpha:Oe,mode:De}),color:Ve,alpha:Oe,mode:De}}case lt.RAINBOW:{let k=new Te((T=e.filmThickness)!=null?T:30),Z=new Te((L=e.movement)!=null?L:0),ue=new Un((C=e.wavelengths)!=null?C:new M(0,0,0)),Me=new Te((U=e.noiseStrength)!=null?U:0),_e=new Te((P=e.noiseScale)!=null?P:1),Se=new Un((R=e.offset)!=null?R:new M(0,0,0)),De=new Te((G=e.alpha)!=null?G:1),Ve=new ka(k,Z,ue,Me,_e,Se,De),Oe=new yt(Ve.calpha,"f"),He=new it((B=e.mode)!=null?B:0);return{layer:new jt(e.id,{type:t,filmThickness:k,movement:Z,wavelengths:ue,noiseStrength:Me,noiseScale:_e,offset:Se,alpha:De,calpha:Oe,mode:He}),color:Ve,alpha:Oe,mode:He}}case lt.TRANSMISSION:{let k=new Te((j=e.thickness)!=null?j:10),Z=new Te((ne=e.ior)!=null?ne:1.5),ue=new Te((le=e.roughness)!=null?le:.5),Me=new In((W=e.transmissionSamplerSize)!=null?W:new O(2048,2048)),_e=(z=e.transmissionSamplerMap)!=null?z:new bi,Se=(D=e.transmissionDepthMap)!=null?D:new bi,De=new kn(_e),Ve=new kn(Se),Oe=window.innerWidth,He=window.innerHeight,Ge=Oe>=He?new In(He/Oe,1):new In(1,Oe/He),Kt=new Te((K=e.alpha)!=null?K:1),vt=new Va(k,Z,ue,Me,De,Ve,Ge,Kt),bn=new yt(vt.calpha,"f"),wn=new it((q=e.mode)!=null?q:0);return{layer:new jt(e.id,{type:t,thickness:k,ior:Z,roughness:ue,transmissionSamplerSize:Me,transmissionSamplerMap:De,transmissionDepthMap:Ve,aspectRatio:Ge,alpha:Kt,calpha:bn,mode:wn}),color:vt,alpha:bn,mode:wn}}case lt.DEPTH:{let k=new Te((ee=e.near)!=null?ee:50),Z=new Te((V=e.far)!=null?V:200),ue=new Te((de=e.isVector)!=null?de:1),Me=new Te((ae=e.isWorldSpace)!=null?ae:0),_e=new Un((te=e.origin)!=null?te:new M),Se=new ct((X=e.colorA)!=null?X:new fe),De=new ct((se=e.colorB)!=null?se:new fe(0,0,0)),Ve=new Te(($=e.alpha)!=null?$:1),Oe=new it((H=e.mode)!=null?H:0),He=new yt("alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","f");He.keywords.alpha=Ve;let Ge=new qa(k,Z,ue,Me,_e,Se,De,Ve);return{layer:new jt(e.id,{type:t,near:k,far:Z,isVector:ue,isWorldSpace:Me,origin:_e,colorA:Se,colorB:De,alpha:Ve,calpha:He,mode:Oe}),color:Ge,alpha:He,mode:Oe}}case lt.NOISE:{let k=new Te((Q=e.scale)!=null?Q:1),Z=new Un((ce=e.size)!=null?ce:new M(100,100,100)),ue=new Te((ie=e.move)!=null?ie:1),Me=new In((N=e.fA)!=null?N:new O(1.7,9.2)),_e=new In((E=e.fB)!=null?E:new O(8.3,2.8)),Se=new In((Y=e.distortion)!=null?Y:new O(1,1)),De=new ct((re=e.colorA)!=null?re:new fe(.4,.4,.4)),Ve=new ct((ye=e.colorB)!=null?ye:new fe(.4,.4,.4)),Oe=new ct((pe=e.colorC)!=null?pe:new fe(1,1,1)),He=new ct((Ie=e.colorD)!=null?Ie:new fe(1,1,1)),Ge=new Te((ve=e.intA)!=null?ve:1),Kt=new Te((Fe=e.intB)!=null?Fe:1),vt=new Te((Ce=e.intC)!=null?Ce:1),bn=new Te((J=e.intD)!=null?J:1),wn=new Te((xe=e.alpha)!=null?xe:1),Ri=new it((he=e.mode)!=null?he:0),Bi=new it((Ne=e.noiseType)!=null?Ne:0),Qt=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");Qt.keywords.alpha=wn;let Mi=new Wa(k,Z,ue,Me,_e,Se,De,Ve,Oe,He,Ge,Kt,vt,bn,wn,Bi);return{layer:new jt(e.id,{type:t,scale:k,size:Z,move:ue,fA:Me,fB:_e,distortion:Se,colorA:De,colorB:Ve,colorC:Oe,colorD:He,intA:Ge,intB:Kt,intC:vt,intD:bn,alpha:wn,calpha:Qt,mode:Ri,noiseType:Bi}),color:Mi,alpha:Qt,mode:Ri}}case lt.NORMAL:{let k=new Un((Be=e.cnormal)!=null?Be:new M(1,1,1)),Z=new Te((ke=e.alpha)!=null?ke:1),ue=new it((ht=e.mode)!=null?ht:0),Me=new Ha(k,Z),_e=new yt("alpha / clamp(alpha + accumAlpha, 0.00001, 1.0 )","f");return _e.keywords.alpha=Z,{layer:new jt(e.id,{type:t,cnormal:k,alpha:Z,calpha:_e,mode:ue}),color:Me,alpha:_e,mode:ue}}case lt.GRADIENT:{let k=new it((ft=e.gl_type)!=null?ft:0),Z=new it((Bn=e.num)!=null?Bn:2),ue=new mc((Mt=e.smooth)!=null?Mt:!1),Me;e.colors?Me=new Ra(e.colors.length,e.colors):(Me=new Ra(10,new Qe(0,0,0,1)),Me.value[1]=new Qe(1,1,1,1));for(let bn=Z.value;bn<10;bn++)Me.value[bn]=Me.value[Z.value-1];let _e;e.steps?_e=new Ba(e.steps.length,e.steps):(_e=new Ba(10,1),_e.value[0]=0);let Se=new In((Tn=e.offset)!=null?Tn:new O(0,0)),De=new In((En=e.morph)!=null?En:new O(0,0)),Ve=new Te((Di=e.angle)!=null?Di:0),Oe=new Te((_r=e.alpha)!=null?_r:1),He=new it((xn=e.mode)!=null?xn:0),Ge=new ja(k,Z,ue,Me,_e,Se,De,Ve,Oe),Kt=new yt(Ge.calpha,"f");return{layer:new jt(e.id,{type:t,gl_type:k,num:Z,smooth:ue,colors:Me,steps:_e,offset:Se,morph:De,angle:Ve,alpha:Oe,calpha:Kt,mode:He}),color:Ge,alpha:Kt,mode:He}}case lt.DISPLACE:{let k=new it((F=e.displacementType)!=null?F:0);if(k.value===0){let Z=new Un((Pe=e.offset)!=null?Pe:new M(0,0,0)),ue=new Te((et=e.scale)!=null?et:10),Me=new Te((Ft=e.intensity)!=null?Ft:8),_e=new Te((Nn=e.movement)!=null?Nn:1),Se=new Te((Gs=e.alpha)!=null?Gs:1),De=new it((sr=e.mode)!=null?sr:0),Ve=new it((Ll=e.noiseType)!=null?Ll:0),Oe=new Mo(k,Me,_e,Z,ue,Ve);return{layer:new jt(e.id,{displacementType:k,type:t,offset:Z,scale:ue,intensity:Me,movement:_e,alpha:Se,mode:De,noiseType:Ve}),position:Oe}}else if(k.value===1){let Z=(Il=e.texture)!=null?Il:new bi,ue=Z.matrix;e.mat&&ue.copy(e.mat),Z.needsUpdate=!0;let Me=new Te((mu=e.intensity)!=null?mu:8),_e=new kn(Z),Se=new Te((gu=e.crop)!=null?gu:0),De=new Te((I=e.alpha)!=null?I:1),Ve=new it((oe=e.mode)!=null?oe:0),Oe=new Mo(k,Me,_e,Se);return{layer:new jt(e.id,{displacementType:k,type:t,intensity:Me,texture:_e,crop:Se,mat:Oe.mat,alpha:De,mode:Ve}),position:Oe}}return{}}}return{}}blendColors(){let e=this._layerNodes.findIndex(n=>n.type===Gt.COLOR),t=this._layerNodes.findIndex(n=>n.type===Gt.LIGHTING);if(e!==-1&&en.type===Gt.LIGHTING);if(this._layerNodes.length>t+1){for(let n=t+1;nt.type===Gt.POSITION);if(e.length>0){let t=e[0].position;for(let n=1;nt.id!==e.id),e.type){case lt.DISPLACE:{this.blendPositions();break}default:{this.blendColors(),this.blendAfterColors();break}}}};var Nh=class{constructor(e){e=e!=null?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}};var yc=class extends Ct{constructor(e=0,t,n,i){super("v4");this.nodeType="Vector4";this.value=e instanceof Qe?e:new Qe(e,t,n,i)}get x(){return this.value.x}set x(e){this.value.x=e}get y(){return this.value.y}set y(e){this.value.y=e}get z(){return this.value.z}set z(e){this.value.z=e}get w(){return this.value.w}set w(e){this.value.w=e}generateReadonly(e,t,n,i,s,o){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,this.getReadonly()===!0&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),e.readonly!==void 0&&(this.readonly=e.readonly),this}};var ML=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| -)*?)}`,"gim"),AL=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),Ao=class extends je{constructor(e=""){super();this.inputs=[];this.src="";this.nodeType="Struct";this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,n,i,s){return t==="source"?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];let t=ML.exec(e);if(t){let n=t[2],i;for(;i=AL.exec(n);)this.inputs.push({type:i[1],name:i[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}};var Ch=class extends je{constructor(e,t){super();this.inputs=[];this.nodeType="FunctionCall";this.value=e,this.inputs=t!=null?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,n,i,s){i=this.getType(e);let o=this.value,a=o.build(e,t)+"( ",l=[];if(o.inputs){for(let c=0;ct.clone()),this}toJSON(e){var n;let t=this.getJSONNode(e);if(!t){let i=this.value;if(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,(n=i.inputs)==null?void 0:n.length){t.inputs={};for(let s=0;sn&&t>i?this.a.getType(e):n>i?this.b.getType(e):this.c.getType(e)}getType(e){switch(this.method){case St.LENGTH:case St.DISTANCE:case St.DOT:return"f";case St.CROSS:return"v3"}return this.getInputType(e)}generate(e,t){let n,i,s,o=this.a?e.getTypeLength(this.a.getType(e)):0,a=this.b?e.getTypeLength(this.b.getType(e)):0,l=this.c?e.getTypeLength(this.c.getType(e)):0,c=this.getInputType(e),u=this.getType(e);switch(this.type=u,this.method){case St.NEGATE:return e.format("( -"+this.a.build(e,c)+" )",c,t);case St.INVERT:return e.format("( 1.0 - "+this.a.build(e,c)+" )",c,t);case St.CROSS:n=this.a.build(e,"v3"),i=this.b.build(e,"v3");break;case St.STEP:n=this.a.build(e,o===1?"f":c),i=this.b.build(e,c);break;case St.MIN:case St.MAX:case St.MOD:n=this.a.build(e,c),i=this.b.build(e,a===1?"f":c);break;case St.REFRACT:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,"f");break;case St.MIX:n=this.a.build(e,c),i=this.b.build(e,c),s=this.c.build(e,l===1?"f":c);break;default:n=this.a.build(e,c),this.b&&(i=this.b.build(e,c)),this.c&&(s=this.c.build(e,c));break}let h=[];h.push(n),i&&h.push(i),s&&h.push(s);let d=this.getNumInputs(e);if(h.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${h.length}.`);return e.format(this.method+"( "+h.join(", ")+" )",u,t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b=e.b instanceof ze?e.b.clone():e.b,this.c=e.c instanceof ze?e.c.clone():e.c,this.method=e.method,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,this.b&&(t.b=this.b.toJSON(e).uuid),this.c&&(t.c=this.c.toJSON(e).uuid),t.method=this.method),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.c&&(this.c=t.getNode(e.c)),e.method&&(this.method=e.method),this}},Ye=St;Ye.RAD=st.RAD,Ye.DEG=st.DEG,Ye.EXP=st.EXP,Ye.EXP2=st.EXP2,Ye.LOG=st.LOG,Ye.LOG2=st.LOG2,Ye.SQRT=st.SQRT,Ye.INV_SQRT=st.INV_SQRT,Ye.FLOOR=st.FLOOR,Ye.CEIL=st.CEIL,Ye.NORMALIZE=st.NORMALIZE,Ye.FRACT=st.FRACT,Ye.SATURATE=st.SATURATE,Ye.SIN=st.SIN,Ye.COS=st.COS,Ye.TAN=st.TAN,Ye.ASIN=st.ASIN,Ye.ACOS=st.ACOS,Ye.ARCTAN=st.ARCTAN,Ye.ABS=st.ABS,Ye.SIGN=st.SIGN,Ye.LENGTH=st.LENGTH,Ye.NEGATE=st.NEGATE,Ye.INVERT=st.INVERT,Ye.MIN=st.MIN,Ye.MAX=st.MAX,Ye.MOD=st.MOD,Ye.STEP=st.STEP,Ye.REFLECT=st.REFLECT,Ye.DISTANCE=st.DISTANCE,Ye.DOT=st.DOT,Ye.CROSS=st.CROSS,Ye.POW=st.POW,Ye.MIX=st.MIX,Ye.CLAMP=st.CLAMP,Ye.REFRACT=st.REFRACT,Ye.SMOOTHSTEP=st.SMOOTHSTEP,Ye.FACEFORWARD=st.FACEFORWARD;var Ka=class extends je{constructor(e=new ze,t=new ze,n=new ze){super("v4");this.nodeType="TextureCubeUV";this.value=e,this.uv=t,this.bias=n}bilinearCubeUV(e,t,n,i){var l,c,u,h;let s=new Ch(Ka.Nodes.bilinearCubeUV,[t,n,i]);this.colorSpaceTL=(l=this.colorSpaceTL)!=null?l:new Bt(new yt("","v4")),this.colorSpaceTL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(s.build(e)+".tl"),this.colorSpaceTR=(c=this.colorSpaceTR)!=null?c:new Bt(new yt("","v4")),this.colorSpaceTR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(s.build(e)+".tr"),this.colorSpaceBL=(u=this.colorSpaceBL)!=null?u:new Bt(new yt("","v4")),this.colorSpaceBL.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(s.build(e)+".bl"),this.colorSpaceBR=(h=this.colorSpaceBR)!=null?h:new Bt(new yt("","v4")),this.colorSpaceBR.fromDecoding(e.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(s.build(e)+".br");let o={include:e.isShader("vertex"),ignoreCache:!0};e.addContext(o),this.colorSpaceTLExp=new yt(this.colorSpaceTL.build(e,"v4"),"v4"),this.colorSpaceTRExp=new yt(this.colorSpaceTR.build(e,"v4"),"v4"),this.colorSpaceBLExp=new yt(this.colorSpaceBL.build(e,"v4"),"v4"),this.colorSpaceBRExp=new yt(this.colorSpaceBR.build(e,"v4"),"v4"),e.removeContext();let a=new yt("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return a.keywords.cubeUV_TL=this.colorSpaceTLExp,a.keywords.cubeUV_TR=this.colorSpaceTRExp,a.keywords.cubeUV_BL=this.colorSpaceBLExp,a.keywords.cubeUV_BR=this.colorSpaceBRExp,a.keywords.cubeUV=s,a}generate(e,t){if(e.isShader("fragment")){let n=this.uv,i=this.bias||e.context.roughness,s=new Ch(Ka.Nodes.roughnessToMip,[i]),o=new Ye(s,Ka.Nodes.m0,Ka.Nodes.cubeUV_maxMipLevel,Ye.CLAMP),a=new Ye(o,Ye.FLOOR),l=new Ye(o,Ye.FRACT),c=this.bilinearCubeUV(e,this.value,n,a),u=this.bilinearCubeUV(e,this.value,n,new Yn(a,new Te(1).setReadonly(!0),Yn.ADD)),h=new Ye(c,u,l,Ye.MIX);return e.format(h.build(e),"v4",t)}else return console.warn("TextureCubeUVNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t)}copy(e){return super.copy(e),this.uv.copy(e.uv),this.bias.copy(e.bias),this.value.copy(e.value),e.colorSpaceTL?this.colorSpaceTL?this.colorSpaceTL.copy(e.colorSpaceTL):this.colorSpaceTL=e.colorSpaceTL.clone():this.colorSpaceTL=void 0,e.colorSpaceTR?this.colorSpaceTR?this.colorSpaceTR.copy(e.colorSpaceTR):this.colorSpaceTR=e.colorSpaceTR.clone():this.colorSpaceTR=void 0,e.colorSpaceBL?this.colorSpaceBL?this.colorSpaceBL.copy(e.colorSpaceBL):this.colorSpaceBL=e.colorSpaceBL.clone():this.colorSpaceBL=void 0,e.colorSpaceBR?this.colorSpaceBR?this.colorSpaceBR.copy(e.colorSpaceBR):this.colorSpaceBR=e.colorSpaceBR.clone():this.colorSpaceBR=void 0,e.colorSpaceTLExp?this.colorSpaceTLExp?this.colorSpaceTLExp.copy(e.colorSpaceTLExp):this.colorSpaceTLExp=e.colorSpaceTLExp.clone():this.colorSpaceTLExp=void 0,e.colorSpaceTRExp?this.colorSpaceTRExp?this.colorSpaceTRExp.copy(e.colorSpaceTRExp):this.colorSpaceTRExp=e.colorSpaceTRExp.clone():this.colorSpaceTRExp=void 0,e.colorSpaceBLExp?this.colorSpaceBLExp?this.colorSpaceBLExp.copy(e.colorSpaceBLExp):this.colorSpaceBLExp=e.colorSpaceBLExp.clone():this.colorSpaceBLExp=void 0,e.colorSpaceBRExp?this.colorSpaceBRExp?this.colorSpaceBRExp.copy(e.colorSpaceBRExp):this.colorSpaceBRExp=e.colorSpaceBRExp.clone():this.colorSpaceBRExp=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,t.uv=this.uv.toJSON(e).uuid,t.bias=this.bias.toJSON(e).uuid,this.colorSpaceTL&&this.colorSpaceTL.toJSON(e).uuid,this.colorSpaceTR&&this.colorSpaceTR.toJSON(e).uuid,this.colorSpaceBL&&this.colorSpaceBL.toJSON(e).uuid,this.colorSpaceBR&&this.colorSpaceBR.toJSON(e).uuid,this.colorSpaceTLExp&&this.colorSpaceTLExp.toJSON(e).uuid,this.colorSpaceTRExp&&this.colorSpaceTRExp.toJSON(e).uuid,this.colorSpaceBLExp&&this.colorSpaceBLExp.toJSON(e).uuid,this.colorSpaceBRExp&&this.colorSpaceBRExp.toJSON(e).uuid),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),e.colorSpaceTL&&(this.colorSpaceTL=t.getNode(e.colorSpaceTL)),e.colorSpaceTR&&(this.colorSpaceTR=t.getNode(e.colorSpaceTR)),e.colorSpaceBL&&(this.colorSpaceBL=t.getNode(e.colorSpaceBL)),e.colorSpaceBR&&(this.colorSpaceBR=t.getNode(e.colorSpaceBR)),e.colorSpaceTLExp&&(this.colorSpaceTLExp=t.getNode(e.colorSpaceTLExp)),e.colorSpaceTRExp&&(this.colorSpaceTRExp=t.getNode(e.colorSpaceTRExp)),e.colorSpaceBLExp&&(this.colorSpaceBLExp=t.getNode(e.colorSpaceBLExp)),e.colorSpaceBRExp&&(this.colorSpaceBRExp=t.getNode(e.colorSpaceBRExp)),this}},_o=Ka;_o.Nodes=function(){let e=new Ao(`struct TextureCubeUVData { - vec4 tl; - vec4 tr; - vec4 br; - vec4 bl; - vec2 f; - }`),t=new rt("float cubeUV_maxMipLevel 8.0",!0),n=new rt("float cubeUV_minMipLevel 4.0",!0),i=new rt("float cubeUV_maxTileSize 256.0",!0),s=new rt("float cubeUV_minTileSize 16.0",!0),o=new Le(`float getFace(vec3 direction) { - vec3 absDirection = abs(direction); - float face = -1.0; - if (absDirection.x > absDirection.z) { - if (absDirection.x > absDirection.y) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if (absDirection.z > absDirection.y) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - }`);o.useKeywords=!1;let a=new Le(`vec2 getUV(vec3 direction, float face) { - vec2 uv; - if (face == 0.0) { - uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x - } else if (face == 1.0) { - uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y - } else if (face == 2.0) { - uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z - } else if (face == 3.0) { - uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x - } else if (face == 4.0) { - uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y - } else { - uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z - } - return 0.5 * (uv + 1.0); - }`);a.useKeywords=!1;let l=new Le(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { - float face = getFace(direction); - float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); - mipInt = max(mipInt, cubeUV_minMipLevel); - float faceSize = exp2(mipInt); - float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); - vec2 uv = getUV(direction, face) * (faceSize - 1.0); - vec2 f = fract(uv); - uv += 0.5 - f; - if (face > 2.0) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - if(mipInt < cubeUV_maxMipLevel){ - uv.y += 2.0 * cubeUV_maxTileSize; - } - uv.y += filterInt * 2.0 * cubeUV_minTileSize; - uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); - uv *= texelSize; - vec4 tl = texture2D(envMap, uv); - uv.x += texelSize; - vec4 tr = texture2D(envMap, uv); - uv.y += texelSize; - vec4 br = texture2D(envMap, uv); - uv.x -= texelSize; - vec4 bl = texture2D(envMap, uv); - return TextureCubeUVData( tl, tr, br, bl, f ); - }`,[e,o,a,t,n,i,s]);l.useKeywords=!1;let c=new rt("float r0 1.0",!0),u=new rt("float v0 0.339",!0),h=new rt("float m0 -2.0",!0),d=new rt("float r1 0.8",!0),f=new rt("float v1 0.276",!0),p=new rt("float m1 -1.0",!0),m=new rt("float r4 0.4",!0),v=new rt("float v4 0.046",!0),g=new rt("float m4 2.0",!0),y=new rt("float r5 0.305",!0),x=new rt("float v5 0.016",!0),b=new rt("float m5 3.0",!0),w=new rt("float r6 0.21",!0),_=new rt("float v6 0.0038",!0),S=new rt("float m6 4.0",!0),A=[c,u,h,d,f,p,m,v,g,y,x,b,w,_,S],T=new Le(`float roughnessToMip(float roughness) { - float mip = 0.0; - if (roughness >= r1) { - mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; - } else if (roughness >= r4) { - mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; - } else if (roughness >= r5) { - mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; - } else if (roughness >= r6) { - mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; - } else { - mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 - } - return mip; - }`,A);return{bilinearCubeUV:l,roughnessToMip:T,m0:h,cubeUV_maxMipLevel:t}}();var To=class extends je{constructor(e){super("v3");this.nodeType="Normal";this.scope=e!=null?e:To.VIEW}getShared(){return this.scope===To.WORLD}build(e,t,n,i){let s=e.context[this.scope+"Normal"];return s?s.build(e,t,n,i):super.build(e,t,n)}generate(e,t,n,i,s){let o;switch(this.scope){case To.VIEW:e.isShader("vertex")?o="transformedNormal":o="geometryNormal";break;case To.LOCAL:e.isShader("vertex")?o="objectNormal":(e.requires.normal=!0,o="vObjectNormal");break;case To.WORLD:e.isShader("vertex")?o="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(e.requires.worldNormal=!0,o="vWNormal");break}return e.format(o,this.getType(e),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},mn=To;mn.LOCAL="local",mn.WORLD="world",mn.VIEW="view",mn.NORMAL="normal";pn.addKeyword("viewNormal",function(){return new mn(mn.VIEW)});pn.addKeyword("localNormal",function(){return new mn(mn.NORMAL)});pn.addKeyword("worldNormal",function(){return new mn(mn.WORLD)});var dr=class extends je{constructor(e){super("v3");this.nodeType="Position";this.scope=e!=null?e:dr.LOCAL}getType(){switch(this.scope){case dr.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case dr.LOCAL:case dr.WORLD:return!1}return!0}generate(e,t,n,i,s){let o;switch(this.scope){case dr.LOCAL:e.isShader("vertex")?o="transformed":(e.requires.position=!0,o="vPosition");break;case dr.WORLD:if(e.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";e.requires.worldPosition=!0,o="vWPosition";break;case dr.VIEW:o=e.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case dr.PROJECTION:o=e.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return e.format(o,this.getType(),t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},_n=dr;_n.LOCAL="local",_n.WORLD="world",_n.VIEW="view",_n.PROJECTION="projection";pn.addKeyword("position",function(){return new _n});pn.addKeyword("worldPosition",function(){return new _n(_n.WORLD)});pn.addKeyword("viewPosition",function(){return new _n(_n.VIEW)});var Zi=class extends je{constructor(e){super("v3");this.nodeType="Reflect";this.scope=e!=null?e:Zi.CUBE}getUnique(e){return!e.context.viewNormal}getType(){switch(this.scope){case Zi.SPHERE:return"v2"}return this.type}generate(e,t){let n=this.getUnique(e);if(e.isShader("fragment")){let i;switch(this.scope){case Zi.VECTOR:{let s=new mn(mn.VIEW),o=e.context.roughness,a=s.build(e,"v3"),l=new _n(_n.VIEW).build(e,"v3"),c=o?o.build(e,"f"):void 0,u=`reflect( -normalize( ${l} ), ${a} )`;c&&(u=`normalize( mix( ${u}, ${a}, ${c} * ${c} ) )`);let h=`inverseTransformDirection( ${u}, viewMatrix )`;n?(e.addNodeCode(`vec3 reflectVec = ${h};`),i="reflectVec"):i=h;break}case Zi.CUBE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="vec3( -"+s+".x, "+s+".yz )";n?(e.addNodeCode(`vec3 reflectCubeVec = ${o};`),i="reflectCubeVec"):i=o;break}case Zi.SPHERE:{let s=new Zi(Zi.VECTOR).build(e,"v3"),o="normalize( ( viewMatrix * vec4( "+s+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";n?(e.addNodeCode(`vec2 reflectSphereVec = ${o};`),i="reflectSphereVec"):i=o;break}}return e.format(i,this.getType(),t)}else return console.warn("ReflectNode is not compatible with "+e.shader+" shader."),e.format("vec3( 0.0 )",this.type,t)}copy(e){return super.copy(e),this.scope=e.scope,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.scope=this.scope),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),this}},Qi=Zi;Qi.CUBE="cube",Qi.SPHERE="sphere",Qi.VECTOR="vector";var vc=class extends je{constructor(e=new kn,t,n){super("v4");this.nodeType="TextureCube";this.value=e,this.radianceNode=new _o(this.value,t!=null?t:new Qi(Qi.VECTOR),n),this.irradianceNode=new _o(this.value,new mn(mn.WORLD),new Te(1).setReadonly(!0))}generate(e,t){return e.isShader("fragment")?(e.require("irradiance"),e.context.bias&&e.context.bias.setTexture(this.value),(e.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(e,t)):(console.warn("TextureCubeNode is not compatible with "+e.shader+" shader."),e.format("vec4( 0.0 )",this.getType(e),t))}copy(e){return super.copy(e),this.value.copy(e.value),this.radianceNode.copy(e.radianceNode),this.irradianceNode.copy(e.irradianceNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.value=this.value.toJSON(e).uuid,this.radianceNode&&(t.radianceNode=this.radianceNode.toJSON(e).uuid),this.irradianceNode&&(t.irradianceNode=this.irradianceNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getNode(e.value)),e.radianceNode&&(this.radianceNode=t.getNode(e.radianceNode)),e.irradianceNode&&(this.irradianceNode=t.getNode(e.irradianceNode)),this}};var xc=class extends Ct{constructor(e=new as,t,n){super("v4",{shared:!0});this.nodeType="CubeTexture";this.value=e,this.uv=t!=null?t:new Qi,this.bias=n}getTexture(e,t){return super.generate(e,t,this.value.uuid,"tc")}generate(e,t){var c,u;if(t==="samplerCube")return this.getTexture(e,t);let n=this.getTexture(e,t),i=(c=this.uv)==null?void 0:c.build(e,"v3"),s=this.bias?this.bias.build(e,"f"):void 0;s===void 0&&e.context.bias&&(s=e.context.bias.setTexture(this).build(e,"f"));let o;s?o="texCubeBias( "+n+", "+i+", "+s+" )":o="texCube( "+n+", "+i+" )";let a={include:e.isShader("vertex"),ignoreCache:!0},l=this.getType(e);return e.addContext(a),this.colorSpace=(u=this.colorSpace)!=null?u:new Bt(new yt("",l)),this.colorSpace.fromDecoding(e.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(e,l),e.removeContext(),e.format(o,l,t)}copy(e){return super.copy(e),this.value.copy(e.value),e.uv?this.uv?this.uv.copy(e.uv):this.uv=e.uv.clone():this.uv=void 0,e.bias?this.bias?this.bias.copy(e.bias):this.bias=e.bias.clone():this.bias=void 0,this}toJSON(e){var n;let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value.uuid),t.uv=(n=this.uv)==null?void 0:n.toJSON(e).uuid,this.bias&&(t.bias=this.bias.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=t.getTexture(e.value)),e.uv&&(this.uv=t.getNode(e.uv)),e.bias&&(this.bias=t.getNode(e.bias)),this}};var bx=["x","y","z","w"],_L=["float","vec2","vec3","vec4"],TL={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},EL={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},Zp=class{constructor(){this.includes={consts:{},functions:{},structs:{}};this.cache="";this.slot="";this.shader="";this.context={};this.getIncludesCode=function(){function e(t,n){return t.deps.length-n.deps.length}return function(n,i){let s=this.getIncludes(n,i);if(!s)return"";let o="";s=s.sort(e);for(let a=0;a","#include "].join(` -`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` -`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { - accumAlpha += (1.0 - accumAlpha) * alpha; - }`,""].join(` -`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(e,t){this.buildShader("vertex",e),this.buildShader("fragment",t);for(let n=0;n0?n+1:"";this.addVaryCode("varying vec2 vUv"+i+";"),n>0&&this.addVertexParsCode("attribute vec2 uv"+i+";"),this.addVertexFinalCode("vUv"+i+" = uv"+i+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition&&(this.addVaryCode("varying vec3 vWPosition;"),this.addVertexFinalCode("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;")),this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.requires.vWorldNormal&&(this.addVaryCode("varying vec3 vWorldNormal;"),this.addVertexFinalCode("vWorldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );")),this}buildShader(e,t){this.resultCode[e]=t.build(this.setShader(e),"v4")}setMaterial(e,t){return this.material=e,this.renderer=t,this.requires.lights=e.lights,this.requires.fog=e.fog,this.mergeDefines(e.defines),this}addFlow(e,t,n){return this.addSlot(e).addCache(t).addContext(n)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(e){return this.cache=e!=null?e:"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(e){return this.context=Object.assign({},this.context,e),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(e){return this.slot=e||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(e,t){this.fragmentVariables[e]===void 0&&(this.addFragmentCode(`${t} ${e};`),this.fragmentVariables[e]="")}addVertexCode(e){this.addCode(e,"vertex")}addFragmentCode(e){this.addCode(e,"fragment")}addCode(e,t){this.code[t!=null?t:this.shader]+=e+` -`}addVertexNodeCode(e){this.addNodeCode(e,"vertex")}addFragmentNodeCode(e){this.addNodeCode(e,"fragment")}addNodeCode(e,t){this.nodeCode[t!=null?t:this.shader]+=e+` -`}clearNodeCode(e){e=e!=null?e:this.shader;let t=this.nodeCode[e];return this.nodeCode[e]="",t}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(e){this.addFinalCode(e,"vertex")}addFragmentFinalCode(e){this.addFinalCode(e,"fragment")}addFinalCode(e,t){this.finalCode[t!=null?t:this.shader]+=e+` -`}addVertexParsCode(e){this.addParsCode(e,"vertex")}addFragmentParsCode(e){this.addParsCode(e,"fragment")}addParsCode(e,t){this.parsCode[t!=null?t:this.shader]+=e+` -`}addVaryCode(e){this.addVertexParsCode(e),this.addFragmentParsCode(e)}isCache(e){return this.caches.indexOf(e)!==-1}isSlot(e){return this.slots.indexOf(e)!==-1}define(e,t){this.defines[e]=t===void 0?1:t}require(e){this.requires[e]=!0}isDefined(e){return this.defines[e]!==void 0}getVar(e,t,n,i="varying",s="V",o=""){let a=this.getVars(i),l=a[e];if(!l){let c=a.length;l={name:n||"node"+s+c+(o?"_"+o:""),type:t},a.push(l),a[e]=l}return l}getTempVar(e,t,n,i){return this.getVar(e,t,n,this.shader,"T",i)}getAttribute(e,t){if(!this.attributes[e]){let n=this.getVar(e,t);this.addVertexParsCode("attribute "+t+" "+e+";"),this.addVertexFinalCode(n.name+" = "+e+";"),this.attributes[e]={varying:n,name:e,type:t}}return this.attributes[e]}getCode(e){return[this.prefixCode,this.parsCode[e],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[e],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[e],"uniform"),this.getIncludesCode("consts",e),this.getIncludesCode("structs",e),this.getIncludesCode("functions",e),"void main() {",this.getVarListCode(this.getVars(e)),this.code[e],this.resultCode[e],this.finalCode[e],"}"].join(` -`)}getVarListCode(e,t){t=t!=null?t:"";let n="";for(let i=0,s=e.length;i{for(;e.image===void 0;)await new Promise(n=>requestAnimationFrame(n));t.addLayerAt(1,{type:lt.TEXTURE,texture:e}),this.dispose()})(),t}clampUniformsForPreview(e,t){let n=(i,s,o)=>Math.min(Math.max(i,s),o);if(this.userData.layers){for(let i of this.userData.layers.getLayers())if(i.type==lt.DISPLACE){this.uniformsBackup[`f${i.id}_intensity`]=i.uniforms[`f${i.id}_intensity`].value;let s=n(i.uniforms[`f${i.id}_intensity`].value,e,t);i.uniforms[`f${i.id}_intensity`].value=s}}}restoreClampedUniforms(){if(this.userData.layers)for(let e of this.userData.layers.getLayers())e.type==lt.DISPLACE&&(e.uniforms[`f${e.id}_intensity`].value=this.uniformsBackup[`f${e.id}_intensity`])}customProgramCacheKey(){return this.getHash()}updateFrame(e){for(let t=0;tVs,this}getHash(){let e="{";return e+='"vertex":'+this.vertex.getHash()+",",e+='"fragment":'+this.fragment.getHash(),e+="}",e}copy(e){let t=this.uuid;for(let n in e)this[n]=e[n];return this.uuid=t,e.userData!==void 0&&(this.userData=JSON.parse(JSON.stringify(e.userData))),this}toJSON(e){let t=this.userData.layers;this.userData.layers=void 0;let n=super.toJSON(e);return n.type="ShaderMaterial",n.userData={type:this.userData.type,category:this.userData.category,nodeType:this.type,layers:t.toJSON(e)},n.vertex=this.vertex.toJSON(e).uuid,n.fragment=this.fragment.toJSON(e).uuid,delete n.vertexShader,delete n.fragmentShader,delete n.color,delete n.shininess,delete n.specular,delete n.roughness,delete n.metalness,delete n.uniforms,e&&!e.materials[this.uuid]&&(e.materials[this.uuid]=n),this.userData.layers=t,n}fromJSON(e,t){var n;this.defines=(n=e.defines)!=null?n:{},this.depthFunc=e.depthFunc,this.depthWrite=e.depthWrite,this.side=e.side!==void 0?e.side:Oi,this.transparent=e.transparent,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.wireframe=e.wireframe,this.userData.layers.fromJSON(e.userData.layers,t,this)}};Object.defineProperties(Ni.prototype,{properties:{get:function(){return this.fragment.properties}},needsUpdate:{set:function(r){r===!0&&this.version++,this.needsCompile=r},get:function(){return this.needsCompile}}});var bc=class extends ze{constructor(){super("basic");this.nodeType="Basic";this.color=new ct(5855577)}generate(e){let t;if(e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.alpha&&this.alpha.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"});let n=this.color.flow(e,"c",{slot:"color"}),i=this.alpha?this.alpha.flow(e,"f"):void 0,s=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0;e.requires.transparent=i!==void 0,e.addParsCode(["#include ","#include ","varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif"].join(` -`));let o=["#include ",n.code];i&&o.push(i.code,"#ifdef ALPHATEST"," if ( "+i.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${n.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${n.result};`),i?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${i.result} );`):o.push("gl_FragColor = vec4("+n.result+", 1.0 );"),o.push("#include ","#include "),t=o.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.color&&(t.color=this.color.toJSON(e).uuid),this.position&&(t.position=this.position.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),this}};var $p=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}constructor(e=new bc,t){super(e,e,t);this.type="BasicNodeMaterial",this.fragment=e}};var oi=class extends $p{constructor(e,t,n){super(t,e);this.userData.type="BasicMaterial",this.userData.category="Basic",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new oi(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new oi(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var wc=class extends ze{constructor(){super("phong");this.nodeType="Phong";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("PHONG"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," BlinnPhongMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var em=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new wc,t){super(e,e,t);this.type="PhongNodeMaterial",this.fragment=e}};var Ci=class extends em{constructor(e,t,n){super(t,e);this.userData.type="PhongMaterial",this.userData.category="Phong",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ci(void 0,i);return s.fromJSON(t,n),s}static fromMaterial(e){let t=new Ci(e.map?{map:e.map}:{}),n=t.fragment;return n.color.value.copy(e.color),n.alpha.value=e.opacity,t}dispose(){super.dispose()}};var Sc=class extends ze{constructor(){super("lambert");this.nodeType="Lambert";this.color=new ct(5855577),this.emissive=new ct(0),this.emissiveIntensity=new Te(1),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("LAMBERT"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include ",` - vec3 diffuse = vec3( 1.0 ); - GeometricContext geometry; - geometry.position = mvPosition.xyz; - geometry.normal = normalize( transformedNormal ); - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); - GeometricContext backGeometry; - backGeometry.position = geometry.position; - backGeometry.normal = -geometry.normal; - backGeometry.viewDir = geometry.viewDir; - vLightFront = vec3( 0.0 ); - vIndirectFront = vec3( 0.0 ); - #ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); - #endif - IncidentLight directLight; - float dotNL; - vec3 directLightColor_Diffuse; - #if NUM_POINT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_DIR_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - #ifdef DOUBLE_SIDED - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - #endif - } - #pragma unroll_loop_end - #endif - #if NUM_HEMI_LIGHTS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - #ifdef DOUBLE_SIDED - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - #endif - } - #pragma unroll_loop_end - #endif - `," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.emissive.flow(e,"c",{slot:"emissive"}),s=this.emissiveIntensity.flow(e,"f",{slot:"emissive"}),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["varying vec3 vViewPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include ","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx, viewdy)); - bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); - `,"#include "];u.push(n.code,"vec3 diffuseColor = "+n.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += (isFrontFacing) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include ","reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = (isFrontFacing) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();"),i&&u.push(i.code,"reflectedLight.directDiffuse += "+i.result+" * "+s.result+";"),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),this.emissiveIntensity=e.emissiveIntensity.clone(),e.color&&(this.color=e.color.clone()),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),e.emissive&&(this.emissive=e.emissive.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.emissiveIntensity=this.emissiveIntensity.toJSON(e).uuid,t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid,t.shadingBlend=this.shadingBlend.toJSON(e).uuid,this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid),this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.emissive&&(t.emissive=this.emissive.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.emissiveIntensity&&(this.emissiveIntensity=t.getNode(e.emissiveIntensity)),this}};var tm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get emissive(){return this.fragment.emissive}set emissive(e){this.fragment.emissive=e}get emissiveIntensity(){return this.fragment.emissiveIntensity}set emissiveIntensity(e){this.fragment.emissiveIntensity=e}constructor(e=new Sc,t){super(e,e,t);this.type="LambertNodeMaterial",this.fragment=e}};var Mc=class extends tm{constructor(e,t,n){super(t,e);this.userData.type="LambertMaterial",this.userData.category="Lambert",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Mc(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Ac=class extends ze{constructor(){super("toon");this.nodeType="Toon";this.color=new ct(5855577),this.specular=new ct(1118481),this.shininess=new Te(30),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("TOON"),e.requires.lights=!0,e.extensions.derivatives=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #ifdef USE_LAYER_DISPLACE - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #ifndef USE_LAYER_DISPLACE - #include - #endif - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push(" #include "," #include "," #include "," vViewPosition = - mvPosition.xyz;"," #include "," #include "," #include "),t=i.join(` -`)}else{this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color"}),this.specular.analyze(e),this.shininess.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e);let n=this.color.flow(e,"c",{slot:"color"}),i=this.specular.flow(e,"c"),s=this.shininess.flow(e,"f"),o=this.shadingAlpha.flow(e,"f"),a=this.shadingBlend.flow(e,"i"),l=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(e,"f"):void 0;e.requires.transparent=c!==void 0,e.addParsCode(["#include ","#include ","#include ","#include ","#include ",` - varying vec3 vViewPosition; - #ifndef FLAT_SHADED - varying vec3 vNormal; - #endif - struct ToonMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - }; - void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - #ifndef PHYSICALLY_CORRECT_LIGHTS - irradiance *= PI; - #endif - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - } - void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - } - #define RE_Direct RE_Direct_Toon - #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon - #define Material_LightProbeLOD( material ) (0) - `,"#include ","#include ","#include "].join(` -`));let u=["#include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," ToonMaterial material;"];u.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",i.code," vec3 specular = "+i.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include ","#include "),u.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular;"),u.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result}, ${a.result} ); - } - `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u.push("#include ","#include ","#include "),t=u.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.specular=e.specular.clone(),this.shininess=e.shininess.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.specular=this.specular.toJSON(e).uuid,t.shininess=this.shininess.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.specular&&(this.specular=t.getNode(e.specular)),e.shininess&&(this.shininess=t.getNode(e.shininess)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var nm=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get specular(){return this.fragment.specular}set specular(e){this.fragment.specular=e}get shininess(){return this.fragment.shininess}set shininess(e){this.fragment.shininess=e}constructor(e=new Ac,t){super(e,e,t);this.type="ToonNodeMaterial",this.fragment=e}};var _c=class extends nm{constructor(e,t,n){super(t,e);this.userData.type="ToonMaterial",this.userData.category="Toon",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new _c(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var Tc=class extends ze{constructor(){super("standard");this.nodeType="Standard";this.color=new ct(5855577),this.roughness=new Te(.3),this.metalness=new Te(0),this.reflectivity=new Te(.5),this.shadingAlpha=new Te(1),this.shadingBlend=new it(0)}build(e){let t;if(e.define("STANDARD"),e.requires.lights=!0,e.extensions.derivatives=!0,e.extensions.shaderTextureLOD=!0,e.isShader("vertex")){let n=this.position?this.position.analyzeAndFlow(e,"v3",{cache:"position"}):void 0;e.mergeUniform(ki.merge([be.fog,be.lights])),be.LTC_1&&(e.uniforms.ltc_1={value:void 0},e.uniforms.ltc_2={value:void 0}),e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include "].join(` -`));let i=["#include ",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif - - vec3 displaced_position = position; - vec3 displaced_normal = normal; - - #if defined( USE_LAYER_DISPLACE ) - vec3 transformed; - vec3 transformedNormal; - #endif - `,"#ifndef FLAT_SHADED"," vNormal = normalize( transformedNormal );","#endif",` - #if !defined( USE_LAYER_DISPLACE ) - #include - #endif /* !USE_LAYER_DISPLACE */ - `];n&&i.push(n.code,n.result?"displaced_position = "+n.result+";":""),i.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),i.push("#include ","#include ","#include "," vViewPosition = - mvPosition.xyz;","#include ","#include "),t=i.join(` -`)}else{let n={gamma:!0};this.color===void 0&&(this.color=new ct(5855577)),this.color.analyze(e,{slot:"color",context:n}),this.roughness.analyze(e),this.metalness.analyze(e),this.shadingAlpha.analyze(e),this.shadingBlend.analyze(e),this.afterColor&&this.afterColor.analyze(e,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(e),this.reflectivity&&this.reflectivity.analyze(e);let i=this.color.flow(e,"c",{slot:"color",context:n}),s=this.roughness.flow(e,"f"),o=this.metalness.flow(e,"f"),a=this.shadingAlpha.flow(e,"f"),l=this.shadingBlend.flow(e,"i"),c=this.afterColor?this.afterColor.flow(e,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(e,"f"):void 0,h=this.reflectivity?this.reflectivity.flow(e,"f"):void 0;e.requires.transparent=u!==void 0,e.addParsCode(["varying vec3 vViewPosition;","#ifndef FLAT_SHADED"," varying vec3 vNormal;","#endif","#include ","#include ","#include ","#include ","#include ","#include "].join(` -`));let d=["#include "," #include ",` - // NOTE: gl_FrontFacing alternative using face normal estimation. - vec3 viewdx = dFdx(vViewPosition); - vec3 viewdy = dFdy(vViewPosition); - vec3 faceNormal = normalize(cross(viewdx,viewdy)); - if (dot(normal, faceNormal) < 0.0) { - normal *= -1.0; - } - `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];d.push(i.code," vec3 diffuseColor = "+i.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",s.code," float roughnessFactor = "+s.result+";",o.code," float metalnessFactor = "+o.result+";"),u&&d.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),d.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),d.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.specularRoughness = max( roughnessFactor, 0.0525 );","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );"),h?d.push(h.code,"material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( "+h.result+" ) ), diffuseColor, metalnessFactor );"):d.push("material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor, metalnessFactor );"),d.push("#include "),d.push("#include "),d.push("vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;"),d.push(` - if (outgoingLight != diffuseColor) { - float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); - accumAlpha += ( 1.0 - accumAlpha ) * ${a.result} * lightAccu; - outgoingLight = spe_blend( diffuseColor, outgoingLight, ${a.result}, ${l.result} ); - } - `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),u?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d.push("#include ","#include ","#include "),t=d.join(` -`)}return t}copy(e){return super.copy(e),e.color&&(this.color=e.color.clone()),this.roughness=e.roughness.clone(),this.metalness=e.metalness.clone(),e.position&&(this.position=e.position.clone()),e.afterColor&&(this.afterColor=e.afterColor.clone()),e.alpha&&(this.alpha=e.alpha.clone()),e.reflectivity&&(this.reflectivity=e.reflectivity.clone()),e.shadingAlpha&&(this.shadingAlpha=e.shadingAlpha.clone()),e.shadingBlend&&(this.shadingBlend=e.shadingBlend.clone()),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.position&&(t.position=this.position.toJSON(e).uuid),this.color&&(t.color=this.color.toJSON(e).uuid),t.roughness=this.roughness.toJSON(e).uuid,t.metalness=this.metalness.toJSON(e).uuid,this.alpha&&(t.alpha=this.alpha.toJSON(e).uuid),this.reflectivity&&(t.reflectivity=this.reflectivity.toJSON(e).uuid),this.shadingAlpha&&(t.shadingAlpha=this.shadingAlpha.toJSON(e).uuid),this.shadingBlend&&(t.shadingBlend=this.shadingBlend.toJSON(e).uuid),this.afterColor&&(t.afterColor=this.afterColor.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.position&&(this.position=t.getNode(e.position)),e.color&&(this.color=t.getNode(e.color)),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.metalness&&(this.metalness=t.getNode(e.metalness)),e.alpha&&(this.alpha=t.getNode(e.alpha)),e.reflectivity&&(this.reflectivity=t.getNode(e.reflectivity)),e.shadingAlpha&&(this.shadingAlpha=t.getNode(e.shadingAlpha)),e.shadingBlend&&(this.shadingBlend=t.getNode(e.shadingBlend)),e.afterColor&&(this.afterColor=t.getNode(e.afterColor)),this}};var im=class extends Ni{get color(){return this.fragment.color}set color(e){this.fragment.color=e}get afterColor(){return this.fragment.afterColor}set afterColor(e){this.fragment.afterColor=e}get alpha(){return this.fragment.alpha}set alpha(e){this.fragment.alpha=e}get shadingAlpha(){return this.fragment.shadingAlpha}set shadingAlpha(e){this.fragment.shadingAlpha=e}get shadingBlend(){return this.fragment.shadingBlend}set shadingBlend(e){this.fragment.shadingBlend=e}get position(){return this.fragment.position}set position(e){this.fragment.position=e}get roughness(){return this.fragment.roughness}set roughness(e){this.fragment.roughness=e}get metalness(){return this.fragment.metalness}set metalness(e){this.fragment.metalness=e}get reflectivity(){return this.fragment.reflectivity}set reflectivity(e){this.fragment.reflectivity=e}constructor(e=new Tc,t){super(e,e,t);this.type="StandardNodeMaterial",this.fragment=e}};var Ec=class extends im{constructor(e,t,n){super(t,e);this.userData.type="PhysicalMaterial",this.userData.category="Physical",this.userData.layers=n!=null?n:this._getLayerStack(e==null?void 0:e.map)}get layersList(){return this.userData.layers}set layersList(e){this.userData.layers=e}equals(e){return this.userData.type===e.userData.type&&this.userData.layers.uuid==e.userData.layers.uuid}copy(e){if(e.userData.layers!==void 0&&e.userData.layers instanceof Kn){let t=e.userData.layers,n=e.fragment;super.copy(e);let i=n.clone();this.fragment=i,this.vertex=i;let s=t.clone(this);this.userData.layers=s,i.shadingAlpha.value=n.shadingAlpha.value,i.shadingBlend.value=n.shadingBlend.value}else super.copy(e);return this}static fromJSON(e,t,n){let i=n.getNode(t.vertex),s=new Ec(void 0,i);return s.fromJSON(t,n),s}dispose(){super.dispose()}};var wx={BasicMaterial:oi,PhongMaterial:Ci,LambertMaterial:Mc,ToonMaterial:_c,PhysicalMaterial:Ec};var Sx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var o,a,l,c,u;let t=Object.assign({},(o=e==null?void 0:e.parameters)!=null?o:{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:0,cornerSegments:8,hollow:0},r.parameters),n=t.width/2,i=(a=t.radiusTop)!=null?a:n,s=(l=t.radiusBottom)!=null?l:n;return i===s?(i=n,s=n):i>s?(i=n,s=s*n/i):(i=i*n/s,s=n),{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs((u=t.depth)!=null?u:t.width),radiusTop:i,radiusBottom:s})}}static build(r){let{width:e,depth:t,height:n,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l,radiusTop:c,radiusBottom:u,cornerRadius:h,cornerSegments:d,hollow:f}=r.parameters,p;return h||f?p=new Lh(c,u,n,i,s,o,a,l*Math.PI/180,h,h,d,f):p=new ds(c,u,n,i,s,o,a,l*Math.PI/180),p.scale(1,1,t/e),Object.assign(p,{userData:tt(Ue({},r),{type:"CylinderGeometry"})})}};function ys(r,e,t){t.x=r.x*e.x,t.y=r.y,t.z=r.x*e.y}function Mx(r){return new O(r.y,-r.x)}var Lh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d,f=!1){super();this.type="RoundedCylinderBufferGeometry",e=e!==void 0?e:1,t=t!==void 0?t:1,n=n||1,i=Math.floor(i)||8,s=Math.floor(s)||1,o=o!==void 0?o:!1,a=a!==void 0?a:0,l=l!==void 0?l:Math.PI*2,o&&(c=0,u=0);let p=[],m=[],v=[],g=[],y=0,x=n/2,b=new M,w=new M;f&&e==0&&(e=c),f&&t==0&&(t=u);let _=new O(e,x),S=new O(t,-x),A=null,T=null,L=null,C=null,U=_.clone().sub(S),P=0,R=0,G=0;d>0&&(P=Math.min(e,t)*(1-d),R=e-P,G=t-P);let B=_.clone();B.x-=P;let j=Math.PI-U.angle(),ne=U.angle(),le=Math.tan(ne/2),W=Math.tan(j/2),z=le+W,D=d?z:W,K=d?z:le;if(c=Math.min(c,(e-R)/D,U.length()/z),u=Math.min(u,(t-G)/K,U.length()/z),c>0){let te=c/le;A=_.clone().sub(new O(te,c)),d&&(L=A.clone(),L.x-=P-z*c),_.sub(U.clone().setLength(te))}if(u>0){let te=u/W;T=S.clone().sub(new O(te,-u)),S.add(U.clone().setLength(te)),d&&(C=T.clone(),C.x-=P-z*u,B.sub(U.clone().setLength(te)))}U=_.clone().sub(S);let q=U.length()<.5,ee=[];for(let te=0;te<=i;te++){let X=[],se=te/i,$=se*l+a,H=new O(Math.sin($),Math.cos($));C&&T?(V(X,se,H,j,u,C,-1,!0),V(X,se,H,ne,u,T,-1,!1)):T?(de(X,H,T.x,0,-1),V(X,se,H,ne,u,T,-1,!1)):o||de(X,H,t,G,-1);let Q=Mx(U).normalize();if(ys(Q,H,b),!q)for(let ce=0;ce<=s;ce++){let ie=ce/s,N=U.clone().multiplyScalar(ie).add(S);ys(N,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}if(L&&A?(V(X,se,H,j,c,A,1,!1),V(X,se,H,ne,c,L,1,!0)):A?(V(X,se,H,j,c,A,1,!1),de(X,H,A.x,0,1)):o||de(X,H,e,R,1),d&&!q){let ce=Mx(U).multiplyScalar(-1).normalize();ys(ce,H,b);for(let ie=0;ie<=s;ie++){let N=ie/s,E=U.clone().multiplyScalar(-N).add(B);ys(E,H,w),m.push(w.x,w.y,w.z),v.push(b.x,b.y,b.z),g.push(se,.5+w.y/n),X.push(y++)}}d&&!o&&X.push(X[0]),ee.push(X)}for(let te=0;tep.push(E,Y,re):(E,Y,re)=>p.push(E,re,Y),ie=new O((e+t+R+G)/4,0);ys(ie,$,Q),m.push(Q.x,Q.y,Q.z),v.push(H.x,0,H.y),g.push(.5,.5);let N=y++;for(let E of X){let Y=m.slice(E*3,E*3+3);m.push(...Y),v.push(H.x,0,H.y);let re=g.slice(E*2,E*2+2);g.push(...re),y++}for(let E=N+1;E0||u>0||l<360?d=new Lh(0,e/2,n,i,s,o,a,l*Math.PI/180,c,u,h,0,!0):d=new oo(e/2,n,i,s,o),d.scale(1,1,t/e),Object.assign(d,{userData:tt(Ue({},r),{type:"ConeGeometry"})})}};var _x=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:0,cornerSegments:8},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o,cornerRadius:a,cornerSegments:l}=r.parameters,c;return a==0?c=new jn(e,t,n,i,s,o):c=new Tx(e,t,n,i,s,o,a,l),Object.assign(c,{userData:tt(Ue({},r),{type:"CubeGeometry"})})}},rm=Math.PI/2,Tx=class extends we{constructor(e=1,t=1,n=1,i=1,s=1,o=1,a=0,l=4){super();this.type="BoxBufferGeometry";let c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o),l=Math.floor(l),a=Math.min(a,e/2,t/2,n/2);let u=[],h=[],d=[],f=[],p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),a>0&&(g("z","y","x",-1,-1,1,n,t,e,o,0),g("z","y","x",1,-1,-1,n,t,e,o,1),g("z","y","x",-1,1,-1,n,t,e,o,1),g("z","y","x",1,1,1,n,t,e,o,0),g("x","y","z",-1,-1,-1,e,t,n,i,0),g("x","y","z",1,-1,1,e,t,n,i,1),g("x","y","z",-1,1,1,e,t,n,i,0),g("x","y","z",1,1,-1,e,t,n,i,1),g("y","x","z",-1,-1,1,t,e,n,s,0),g("y","x","z",1,-1,-1,t,e,n,s,1),g("y","x","z",1,1,1,t,e,n,s,1),g("y","x","z",-1,1,-1,t,e,n,s,0),y(1,1,1),y(-1,1,1),y(1,-1,1),y(-1,-1,1),y(1,1,-1),y(-1,1,-1),y(1,-1,-1),y(-1,-1,-1)),this.setIndex(u),this.setAttribute("position",new ge(h,3)),this.setAttribute("normal",new ge(d,3)),this.setAttribute("uv",new ge(f,2));function v(x,b,w,_,S,A,T,L,C,U,P){let R=(A-2*a)/C,G=(T-2*a)/U,B=A/2-a,j=T/2-a,ne=L/2,le=C+1,W=U+1,z=0,D=0,K=new M;for(let q=0;q0?1:-1,d.push(K.x,K.y,K.z),f.push(V/C),f.push(1-q/U),z+=1}}for(let q=0;q0?(C,U,P)=>u.push(C,U,P):(C,U,P)=>u.push(C,P,U);for(let C=0;C<=l;C++){let U=[],P=rm*(1-C/l),R=Math.cos(P),G=Math.sin(P),B=0;for(let j=0;j<=C;j++){let ne=Math.cos(B),le=Math.sin(B);_.x=R*ne,_.y=G,_.z=R*le;let W=S.clone().addScaledVector(_,a);h.push(x*W.x,b*W.y,w*W.z),d.push(x*_.x,b*_.y,w*_.z),f.push(0,0),U.push(p++),B+=rm/C}A.push(U)}let L=A.length-1;for(let C=0;Cb.subVectors(W,z).normalize(),_=(W,z)=>Array(W).fill(void 0).map(z),S=_(e.length/3,(W,z)=>new M().fromArray(e,z*3).setLength(i)),A=[],T=1e6;for(let W=0;WH[0]==q)}A.push(ae)}let L=[];{let W=0,z=0,D,K,q=f==3;for(let ee=0;ee<=o;ee++){D=ee*(ee+1)/2,K=(ee+1)*(ee+2)/2;for(let V=0;V_(f,()=>p.clone()));for(let W=0;Wae.add(te),ee).multiplyScalar(1/f);for(let ae=0;aese[H]);a.push(...$.map(H=>[H.x,H.y,H.z]).flat()),c.push(...$.map(H=>(w(H,C),[b.x,b.y,b.z])).flat())}}let ne=[];for(let W=0;WV%T==W),q=B[W][z],ee=B[D][K];for(let V=0;V{a.push(se[0].x,se[0].y,se[0].z),c.push(se[1].x,se[1].y,se[1].z)})}ne.push(q[0][0],ee[x][0],q[x][0],ee[0][0])}}for(;ne.length;){let W,z,D,K;[W,z]=ne.splice(0,2);let q=[W];for(;W!=z;)q.push(z),D=ne.indexOf(z),K=D%2,z=ne.splice(D-K,2)[1-K];b.subVectors(q[0],q[1]).cross(p.subVectors(q[0],q[2])).normalize();let ee=b.dot(q[0])<0;ee&&b.negate();for(let V=1;V<=q.length-2;V++)[q[V+ +ee],q[V+1-+ee],q[0]].forEach(de=>{a.push(de.x,de.y,de.z),c.push(b.x,b.y,b.z)})}}function h(){let d=new M;for(let S=0;S{L<0&&S.x===1&&(l[A]=S.x-1),T.x===0&&T.z===0&&(l[A]=L/2/Math.PI+.5)};for(let S=0,A=0;S.9&&U<.1&&(A<.2&&(l[S+0]+=1),T<.2&&(l[S+2]+=1),L<.2&&(l[S+4]+=1))}function w(S){return Math.atan2(S.z,-S.x)}function _(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}}static fromJSON(e){return new Eo(e.vertices,e.indices,e.radius,e.corner,e.cornerSides)}};var Ex=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,detail:0,corner:0,cornerSides:4},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e,height:t,depth:n,detail:i,corner:s,cornerSides:o}=r.parameters,a=i===0&&s!==0?new Ih(e*.5,s,o):new ao(e*.5,i);return a.scale(1,t/e,n/e),Object.assign(a,{userData:tt(Ue({},r),{type:"DodecahedronGeometry"})})}},Ih=class extends Eo{constructor(e=1,t=.2,n=4){let i=(1+Math.sqrt(5))/2,s=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-i,0,-s,i,0,s,-i,0,s,i,-s,-i,0,-s,i,0,s,-i,0,s,i,0,-i,0,-s,i,0,-s,-i,0,s,i,0,s],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(o,a,l,e,t,n);this.type=l}static fromJSON(e){return new Ih(e.radius,e.corner,e.cornerSides)}};var Nc=1e-12,Cc=class{constructor(e){this.position=new O;this.startPosition=new O;this.uuid=Ee.generateUUID();this.position=e.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(e){this.position.copy(this.startPosition).add(e)}copy(e){return this.position.copy(e.position),this.startPosition.copy(e.startPosition),this}clone(){return new Cc(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},Lc=class extends Cc{constructor(e){super(e.position);this.parent=e}copy(e){return super.copy(e),this}clone(){return new Lc(this.parent).copy(this)}},vs=class extends Cc{constructor(e,t){super(t);this.controls=[];this.roundness=0;this.areControlsDirectionsMirrored=!0;this.uuid=e,this.controls.push(new Lc(this),new Lc(this))}getOppositeControl(e){let t=this.controls.indexOf(e);return t===0?this.controls[1]:t===1?this.controls[0]:null}applyOffsetToControls(e,t=1){for(let n=0,i=this.controls.length;nr,Ic=new O,om=new O,NL=new O,CL=new O,LL=new O,IL=new O,Nx=new M,Cx=new M;function Lx(r){let e=new O;e.addVectors(r.v0,Ic.subVectors(r.v1,r.v0).multiplyScalar(2/3));let t=new O;return t.addVectors(r.v2,om.subVectors(r.v1,r.v2).multiplyScalar(2/3)),new ii(r.v0,e,t,r.v2)}function Pc(r,e,t=Number.EPSILON){return Math.abs(r-e)Math.PI&&(u*=-1),Pc(c,a)?h=(a+c)*(n/u-.5)*8/3/(o-l):h=(o+l)*(n/u-.5)*8/3/(c-a),i.set(e.x-h*a,e.y+h*o),s.set(t.x+h*c,t.y-h*l),[i,s]}function lm(r,e){return r.position.equals(r.controls[1].position)&&e.position.equals(e.controls[0].position)}function Rx(r,e,t,n,i=.5){let s=Ic.subVectors(e,r).multiplyScalar(i).add(r),o=om.subVectors(t,e).multiplyScalar(i).add(e),a=NL.subVectors(n,t).multiplyScalar(i).add(t),l=s,c=CL.subVectors(o,s).multiplyScalar(i).add(s),u=LL.subVectors(a,o).multiplyScalar(i).add(o),h=a,d=IL.subVectors(u,c).multiplyScalar(i).add(c);return[r.x,r.y,l.x,l.y,c.x,c.y,d.x,d.y,u.x,u.y,h.x,h.y,n.x,n.y]}function Bx(r,e,t=12,n=!0){let i=Cx.set(0,0,0),s,o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),r}function Ox(r,e,t,n=12,i=!0){let s=Cx.set(0,0,0),o=0,a=[];for(let l=0;l1&&!(r.getX(o-1)===r.getX(0)&&r.getY(o-1)===r.getY(0)&&r.getZ(o-1)===r.getZ(0))&&(r.setXYZ(o,r.getX(0),r.getY(0),r.getZ(0)),o++),a}function cm(r,e=12,t=!1){let n=[];for(let i=0,s=r.length;i0&&(n[i-1]+=l),a+=l}o.curveAfter!==void 0&&(a+=xs(o.curveAfter,e)),n.push(a)}return r.length>0&&t&&r[0].roundedCurveCorner!==void 0&&(n[r.length-1]+=xs(r[0].roundedCurveCorner,e)*.5),n}function xs(r,e=12){return r&&r instanceof lo?e*2:r&&(r instanceof ri||r instanceof dh)?1:r&&r instanceof Ea?e*r.points.length:e}function Fx(r,e,t=12,n=!0){let i,s=0;for(let o=0;o1&&!(Pc(r[s-1],r[1],Nc)&&Pc(r[s-2],r[0],Nc))&&(r.push(r[0],r[1]),s++),r}var um=new O,RL=new O,BL=new O,OL=new O,FL=new O,zL=new O,Lt=class extends yi{constructor(e=100,t=100){super();this.points=[];this.shapeHoles=[];this.eventDispatcher=new cn;this.plane=new ni(new M(0,0,-1));this.subdivision=0;this.controlSnapDistance=4;this.pointIDs=0;this.isMesh2D=!1;this._roundness=0;this.isClosed=!1;this.useCubicForRoundedCorners=!0;this.uuid=Ee.generateUUID();this.needsUpdate=!1;this.roundedCurves=[];this._width=e,this._height=t}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(e){if(this._roundness!==e){this._roundness=e;for(let t=0,n=this.points.length;t0)for(let t=0,n=this.shapeHoles.length;t=0)return t;if(t=this.points.length,this.shapeHoles.length>0)for(let n=0,i=this.shapeHoles.length;n=0)return t+o;t+=s.points.length}return-1}getAllPoints(){let e=[].concat(...this.shapeHoles.map(t=>t.points));return[...this.points,...e]}applySize(e,t){e===0&&(e=.001),t===0&&(t=.001),this.applyScale(e/this.width,t/this.height),this._width=e,this._height=t}applyScale(e,t){let n=um.set(e,t);for(let i=0,s=this.points.length;i=0&&this.points.splice(t,1),this.needsUpdate=!0}update(e=!0){for(let t=0,n=this.shapeHoles.length;ts+o,0)+1}computeCurveDivisions(e=12){return this.curveDivisions=cm(this.points,e,!1),this.roundedCurveDivisions=cm(this.points,e,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(e,t,n=12){return Ox(e,this.curves,t,n,this.autoClose).reduce((s,o)=>s+o,0)*2}extractShapePointsToFlatArray(e,t=12){return this.subdivision=t,this.curveDivisions===void 0&&this.computeCurveDivisions(t),Fx(e,this.roundedCurves,t,this.autoClose)}getCurveIndexFromVertexId(e,t=!1){let n=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let i=t?this.roundedCurveDivisions:this.curveDivisions,s=0;t&&this.points[0].roundedCurveCorner!==void 0&&(s=xs(this.points[0].roundedCurveCorner,this.subdivision)*.5);let o=e-s;o<0&&(o+=i.reduce((a,l)=>a+l,0));for(let a=0,l=i.length;a=this.points.length-1?0:e+1],o=this.curveDivisions,a=o[e];if(lm(i,s)){let u=i.position.distanceTo(s.position);return i.position.distanceTo(um.set(n.x,n.y))/u}let l=0;for(let u=0;u2){let i=0;for(let s=0,o=this.points.length;s0){let c=a.curveBefore,u=a.curveAfter;if(c===void 0||u===void 0)continue;let h=a.roundedCurveBefore,d=a.roundedCurveAfter,f=c.getLength(),p=u.getLength(),m=Math.min(l,f*.499),v=Math.min(l,p*.499),g=Math.min(m,v),y=1-g/f,x=g/p,b=c.getPointAt(y,um),w=u.getPointAt(x,RL);this._subSplitCurve(c,h,y,b,void 0),this._subSplitCurve(u,d,x,void 0,w);let _;if(this.useCubicForRoundedCorners){let S=am(b,a.position,w)/2,A=Math.tan(S)*b.distanceTo(a.position),[T,L]=Ix(b,w,A,BL,OL),C=Px(T,L,a.position),[U,P]=Dx(C,b,w,A,FL,zL);_=new ii(b.clone(),U.clone(),P.clone(),w.clone())}else _=new Wi(b.clone(),a.position.clone(),w.clone());a.roundedCurveCorner=_,this.roundedCurves.splice(s+i,0,_),i++}}}e&&((n=this.eventDispatcher)==null||n.dispatchEvent({type:"update"}))}_subSplitCurve(e,t,n,i,s){if(e instanceof ri)i!==void 0&&t.v2.copy(i),s!==void 0&&t.v1.copy(s);else{let o=e,a=t,l=o.getUtoTmapping(n,0),c=Rx(o.v0,o.v1,o.v2,o.v3,l);return i!==void 0&&(a.v0.set(c[0],c[1]),a.v1.set(c[2],c[3]),a.v2.set(c[4],c[5]),a.v3.set(c[6],c[7])),s!==void 0&&(a.v0.set(c[6],c[7]),a.v1.set(c[8],c[9]),a.v2.set(c[10],c[11]),a.v3.set(c[12],c[13])),a}return t}clone(){let e=new Lt(this._width,this._height);return e.points=this.points.map(t=>t.clone()),e.isClosed=this.isClosed,e.roundness=this.roundness,e.isMesh2D=this.isMesh2D,e.shapeHoles=this.shapeHoles.map(t=>t.clone()),e}toJSON(){return{points:this.points.reduce((e,t)=>e.concat(t.toJSON()),[]),shapeHoles:this.shapeHoles.map(e=>e.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(e){var n;this.points=[],this.pointIDs=0;let t=e.points.length/7;for(let i=0;i{let s=new Lt;return s.fromJSON(i),s}):[],this.isClosed=e.isClosed,this._roundness=e.roundness,this._update(),this}fromShape(e){let t=(i,s)=>{s instanceof ii&&s.v3.equals(i.position)&&i.controls[0].position.copy(s.v2)},n=i=>{let s=[],o,a;for(o=0,a=i.length;o0?i[o-1]:null,d;u instanceof ii?(d=this.createPoint(u.v0),d.controls[1].position.copy(u.v1)):u instanceof ri&&(d=this.createPoint(u.v1)),d!==void 0&&(h!==null&&t(d,h),s.push(d))}let l=i[i.length-1],c=!1;return l instanceof ii?l.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(l.v2),c=!0):l instanceof ri&&l.v2.equals(s[0].position)&&(c=!0),this.isClosed=c,s};return this.points=n(e.curves),e instanceof yi&&(this.shapeHoles=e.holes.map(i=>{let s=new Lt;return s.fromShape(i),s})),this.update(),this}};var hm=Math.PI*2;function dm({x:r,y:e},t,n,i,s){return{x:r*t+i,y:e*n+s}}function GL(r,e){let t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(r),i=Math.sin(r),s=Math.cos(r+e),o=Math.sin(r+e);return[{x:n-i*t,y:i+n*t},{x:s+o*t,y:o-s*t},{x:s,y:o}]}function zx(r,e,t,n){let i=r*n-e*t<0?-1:1,s=Math.min(1,Math.max(-1,r*t+e*n));return i*Math.acos(s)}function UL(r,e,t,n,i,s,o,a,l,c){let u=Math.pow(i,2),h=Math.pow(s,2),d=Math.pow(o,2),f=Math.pow(a,2),p=u*h-u*f-h*d;p<0&&(p=0),p/=u*f+h*d,p=Math.sqrt(p)*(l===c?-1:1);let m=p*i/s*a,v=p*-s/i*o,g=m+(r+t)/2,y=v+(e+n)/2,x=(o-m)/i,b=(a-v)/s,w=(-o-m)/i,_=(-a-v)/s,S=zx(1,0,x,b),A=zx(x,b,w,_);return!c&&A>0&&(A-=hm),c&&A<0&&(A+=hm),{centerx:g,centery:y,ang1:S,ang2:A}}function Gx({px:r,py:e,cx:t,cy:n,rx:i,ry:s,largeArcFlag:o,sweepFlag:a}){let l=[];if(i===0||s===0)return[];let c=(r-t)/2,u=(e-n)/2;if(c===0&&u===0)return[];i=Math.abs(i),s=Math.abs(s);let h=Math.pow(c,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(s,2);h>1&&(i*=Math.sqrt(h),s*=Math.sqrt(h));let d=UL(r,e,t,n,i,s,c,u,o,a),{ang1:f,ang2:p}=d,{centerx:m,centery:v}=d,g=Math.abs(p)/(hm/4);Math.abs(1-g)<1e-7&&(g=1);let y=Math.max(Math.ceil(g),1);p/=y;for(let x=0;x{let{x:b,y:w}=dm(x[0],i,s,m,v),{x:_,y:S}=dm(x[1],i,s,m,v),{x:A,y:T}=dm(x[2],i,s,m,v);return{x1:b,y1:w,x2:_,y2:S,x:A,y:T}})}var Wt;(function(r){r[r.ODD=0]="ODD",r[r.NONZERO=1]="NONZERO",r[r.POSITIVE=2]="POSITIVE",r[r.NEGATIVE=3]="NEGATIVE",r[r.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(Wt||(Wt={}));var gn;(function(r){r[r.POLYGONS=0]="POLYGONS",r[r.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",r[r.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(gn||(gn={}));function Xe(r,e){if(!r)throw e||"Assertion Failed!"}var We=function(){function r(){}return r.vertEq=function(e,t){return e.s===t.s&&e.t===t.t},r.vertLeq=function(e,t){return e.s0?i0?(t.t-n.t)*i+(t.t-e.t)*s:0},r.transEval=function(e,t,n){Xe(r.transLeq(e,t)&&r.transLeq(t,n));var i=t.t-e.t,s=n.t-t.t;return i+s>0?i0?(t.s-n.s)*i+(t.s-e.s)*s:0},r.vertCCW=function(e,t,n){return e.s*(t.t-n.t)+t.s*(n.t-e.t)+n.s*(e.t-t.t)>=0},r.interpolate=function(e,t,n,i){return e=e<0?0:e,n=n<0?0:n,e<=n?n===0?(t+i)/2:t+(i-t)*(e/(e+n)):i+(t-i)*(n/(e+n))},r.intersect=function(e,t,n,i,s){var o,a,l;r.vertLeq(e,t)||(l=e,e=t,t=l),r.vertLeq(n,i)||(l=n,n=i,i=l),r.vertLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.vertLeq(n,t)?r.vertLeq(t,i)?(o=r.edgeEval(e,n,t),a=r.edgeEval(n,t,i),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,t.s)):(o=r.edgeSign(e,n,t),a=-r.edgeSign(e,i,t),o+a<0&&(o=-o,a=-a),s.s=r.interpolate(o,n.s,a,i.s)):s.s=(n.s+t.s)/2,r.transLeq(e,t)||(l=e,e=t,t=l),r.transLeq(n,i)||(l=n,n=i,i=l),r.transLeq(e,n)||(l=e,e=n,n=l,l=t,t=i,i=l),r.transLeq(n,t)?r.transLeq(t,i)?(o=r.transEval(e,n,t),a=r.transEval(n,t,i),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,t.t)):(o=r.transSign(e,n,t),a=-r.transSign(e,i,t),o+a<0&&(o=-o,a=-a),s.t=r.interpolate(o,n.t,a,i.t)):s.t=(n.t+t.t)/2},r}(),Dc=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return r}(),Ph=function(){function r(e){this.side=e,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(r.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(e){this.Sym.Lface=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(e){this.Sym.Org=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(e){this.Sym.Lnext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(e){this.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(e){this.Lnext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(e){this.Sym.Onext=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(e){this.Sym.Onext.Sym=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(e){this.Sym.Lnext.Sym=e},enumerable:!0,configurable:!0}),r}(),Za=function(){function r(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return r}(),Ux=function(){function r(){var e=new Za,t=new Dc,n=new Ph(0),i=new Ph(1);e.next=e.prev=e,e.anEdge=null,t.next=t.prev=t,n.next=n,n.Sym=i,i.next=i,i.Sym=n,this.vHead=e,this.fHead=t,this.eHead=n,this.eHeadSym=i}return r.prototype.makeEdge_=function(e){var t=new Ph(0),n=new Ph(1);e.Sym.sidethis.size||this.leq(n[i].key,n[s].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.floatUp_=function(e){var t=this.nodes,n=this.handles,i,s,o;for(i=t[e].handle;;){if(o=e>>1,s=t[o].handle,o===0||this.leq(n[s].key,n[i].key)){t[e].handle=i,n[i].node=e;break}t[e].handle=s,n[s].node=e,e=o}},r.prototype.init=function(){for(var e=this.size;e>=1;--e)this.floatDown_(e);this.initialized=!0},r.prototype.min=function(){return this.handles[this.nodes[1].handle].key},r.prototype.insert=function(e){var t,n;if(t=++this.size,t*2>this.max){this.max*=2;var i,s;for(s=this.nodes.length,this.nodes.length=this.max+1,i=s;i0&&(e[1].handle=e[this.size].handle,t[e[1].handle].node=1,t[n].key=null,t[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),i},r.prototype.delete=function(e){var t=this.nodes,n=this.handles,i;Xe(e>=1&&e<=this.max&&n[e].key!==null),i=n[e].node,t[i].handle=t[this.size].handle,n[t[i].handle].node=i,--this.size,i<=this.size&&(i<=1||this.leq(n[t[i>>1].handle].key,n[t[i].handle].key)?this.floatDown_(i):this.floatUp_(i)),n[e].key=null,n[e].node=this.freeList,this.freeList=e},r}(),fm=function(){function r(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return r}(),Hx=function(){function r(){this.key=null,this.next=null,this.prev=null}return r}(),VL=function(){function r(e,t){this.frame=e,this.leq=t,this.head=new Hx,this.head.next=this.head,this.head.prev=this.head}return r.prototype.min=function(){return this.head.next},r.prototype.max=function(){return this.head.prev},r.prototype.insert=function(e){return this.insertBefore(this.head,e)},r.prototype.search=function(e){var t=this.head;do t=t.next;while(t.key!==null&&!this.leq(this.frame,e,t.key));return t},r.prototype.insertBefore=function(e,t){do e=e.prev;while(e.key!==null&&!this.leq(this.frame,e.key,t));var n=new Hx;return n.key=t,n.next=e.next,e.next.prev=n,n.prev=e,e.next=n,n},r.prototype.delete=function(e){e.next.prev=e.prev,e.prev.next=e.next},r}(),HL=function(){function r(){}return r.regionBelow=function(e){return e.nodeUp.prev.key},r.regionAbove=function(e){return e.nodeUp.next.key},r.debugEvent=function(e){},r.addWinding=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.edgeLeq=function(e,t,n){var i=e.event,s=t.eUp,o=n.eUp;if(s.Dst===i)return o.Dst===i?We.vertLeq(s.Org,o.Org)?We.edgeSign(o.Dst,s.Org,o.Org)<=0:We.edgeSign(s.Dst,o.Org,s.Org)>=0:We.edgeSign(o.Dst,i,o.Org)<=0;if(o.Dst===i)return We.edgeSign(s.Dst,i,s.Org)>=0;var a=We.edgeEval(s.Dst,i,s.Org),l=We.edgeEval(o.Dst,i,o.Org);return a>=l},r.deleteRegion=function(e,t){t.fixUpperEdge&&Xe(t.eUp.winding===0),t.eUp.activeRegion=null,e.dict.delete(t.nodeUp)},r.fixUpperEdge=function(e,t,n){Xe(t.fixUpperEdge),e.mesh.delete(t.eUp),t.fixUpperEdge=!1,t.eUp=n,n.activeRegion=t},r.topLeftRegion=function(e,t){var n=t.eUp.Org,i;do t=r.regionAbove(t);while(t.eUp.Org===n);if(t.fixUpperEdge){if(i=e.mesh.connect(r.regionBelow(t).eUp.Sym,t.eUp.Lnext),i===null)return null;r.fixUpperEdge(e,t,i),t=r.regionAbove(t)}return t},r.topRightRegion=function(e){var t=e.eUp.Dst;do e=r.regionAbove(e);while(e.eUp.Dst===t);return e},r.addRegionBelow=function(e,t,n){var i=new fm;return i.eUp=n,i.nodeUp=e.dict.insertBefore(t.nodeUp,i),i.fixUpperEdge=!1,i.sentinel=!1,i.dirty=!1,n.activeRegion=i,i},r.isWindingInside=function(e,t){switch(e.windingRule){case Wt.ODD:return(t&1)!=0;case Wt.NONZERO:return t!==0;case Wt.POSITIVE:return t>0;case Wt.NEGATIVE:return t<0;case Wt.ABS_GEQ_TWO:return t>=2||t<=-2}throw new Error("Invalid winding rulle")},r.computeWinding=function(e,t){t.windingNumber=r.regionAbove(t).windingNumber+t.eUp.winding,t.inside=r.isWindingInside(e,t.windingNumber)},r.finishRegion=function(e,t){var n=t.eUp,i=n.Lface;i.inside=t.inside,i.anEdge=n,r.deleteRegion(e,t)},r.finishLeftRegions=function(e,t,n){for(var i,s=null,o=t,a=t.eUp;o!==n;){if(o.fixUpperEdge=!1,s=r.regionBelow(o),i=s.eUp,i.Org!=a.Org){if(!s.fixUpperEdge){r.finishRegion(e,o);break}i=e.mesh.connect(a.Lprev,i.Sym),r.fixUpperEdge(e,s,i)}a.Onext!==i&&(e.mesh.splice(i.Oprev,i),e.mesh.splice(a,i)),r.finishRegion(e,o),a=s.eUp,o=s}return a},r.addRightEdges=function(e,t,n,i,s,o){var a,l,c,u,h=!0;c=n;do Xe(We.vertLeq(c.Org,c.Dst)),r.addRegionBelow(e,t,c.Sym),c=c.Onext;while(c!==i);for(s===null&&(s=r.regionBelow(t).eUp.Rprev),l=t,u=s;a=r.regionBelow(l),c=a.eUp.Sym,c.Org===u.Org;)c.Onext!==u&&(e.mesh.splice(c.Oprev,c),e.mesh.splice(u.Oprev,c)),a.windingNumber=l.windingNumber-c.winding,a.inside=r.isWindingInside(e,a.windingNumber),l.dirty=!0,!h&&r.checkForRightSplice(e,l)&&(r.addWinding(c,u),r.deleteRegion(e,l),e.mesh.delete(u)),h=!1,l=a,u=c;l.dirty=!0,Xe(l.windingNumber-c.winding===a.windingNumber),o&&r.walkDirtyRegions(e,l)},r.spliceMergeVertices=function(e,t,n){e.mesh.splice(t,n)},r.vertexWeights=function(e,t,n){var i=We.vertL1dist(t,e),s=We.vertL1dist(n,e),o=.5*s/(i+s),a=.5*i/(i+s);e.coords[0]+=o*t.coords[0]+a*n.coords[0],e.coords[1]+=o*t.coords[1]+a*n.coords[1],e.coords[2]+=o*t.coords[2]+a*n.coords[2]},r.getIntersectData=function(e,t,n,i,s,o){t.coords[0]=t.coords[1]=t.coords[2]=0,t.idx=-1,r.vertexWeights(t,n,i),r.vertexWeights(t,s,o)},r.checkForRightSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp;if(We.vertLeq(i.Org,s.Org)){if(We.edgeSign(s.Dst,i.Org,s.Org)>0)return!1;We.vertEq(i.Org,s.Org)?i.Org!==s.Org&&(e.pq.delete(i.Org.pqHandle),r.spliceMergeVertices(e,s.Oprev,i)):(e.mesh.splitEdge(s.Sym),e.mesh.splice(i,s.Oprev),t.dirty=n.dirty=!0)}else{if(We.edgeSign(i.Dst,s.Org,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Oprev,i)}return!0},r.checkForLeftSplice=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o;if(Xe(!We.vertEq(i.Dst,s.Dst)),We.vertLeq(i.Dst,s.Dst)){if(We.edgeSign(i.Dst,s.Dst,i.Org)<0)return!1;r.regionAbove(t).dirty=t.dirty=!0,o=e.mesh.splitEdge(i),e.mesh.splice(s.Sym,o),o.Lface.inside=t.inside}else{if(We.edgeSign(s.Dst,i.Dst,s.Org)>0)return!1;t.dirty=n.dirty=!0,o=e.mesh.splitEdge(s),e.mesh.splice(i.Lnext,s.Sym),o.Rface.inside=t.inside}return!0},r.checkForIntersect=function(e,t){var n=r.regionBelow(t),i=t.eUp,s=n.eUp,o=i.Org,a=s.Org,l=i.Dst,c=s.Dst,u,h,d=new Za,f,p;if(Xe(!We.vertEq(c,l)),Xe(We.edgeSign(l,e.event,o)<=0),Xe(We.edgeSign(c,e.event,a)>=0),Xe(o!==e.event&&a!==e.event),Xe(!t.fixUpperEdge&&!n.fixUpperEdge),o===a||(u=Math.min(o.t,l.t),h=Math.max(a.t,c.t),u>h))return!1;if(We.vertLeq(o,a)){if(We.edgeSign(c,o,a)>0)return!1}else if(We.edgeSign(l,a,o)<0)return!1;return r.debugEvent(e),We.intersect(l,o,c,a,d),Xe(Math.min(o.t,l.t)<=d.t),Xe(d.t<=Math.max(a.t,c.t)),Xe(Math.min(c.s,l.s)<=d.s),Xe(d.s<=Math.max(a.s,o.s)),We.vertLeq(d,e.event)&&(d.s=e.event.s,d.t=e.event.t),f=We.vertLeq(o,a)?o:a,We.vertLeq(f,d)&&(d.s=f.s,d.t=f.t),We.vertEq(d,o)||We.vertEq(d,a)?(r.checkForRightSplice(e,t),!1):!We.vertEq(l,e.event)&&We.edgeSign(l,e.event,d)>=0||!We.vertEq(c,e.event)&&We.edgeSign(c,e.event,d)<=0?c===e.event?(e.mesh.splitEdge(i.Sym),e.mesh.splice(s.Sym,i),t=r.topLeftRegion(e,t),i=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),n),r.addRightEdges(e,t,i.Oprev,i,i,!0),!0):l===e.event?(e.mesh.splitEdge(s.Sym),e.mesh.splice(i.Lnext,s.Oprev),n=t,t=r.topRightRegion(t),p=r.regionBelow(t).eUp.Rprev,n.eUp=s.Oprev,s=r.finishLeftRegions(e,n,null),r.addRightEdges(e,t,s.Onext,i.Rprev,p,!0),!0):(We.edgeSign(l,e.event,d)>=0&&(r.regionAbove(t).dirty=t.dirty=!0,e.mesh.splitEdge(i.Sym),i.Org.s=e.event.s,i.Org.t=e.event.t),We.edgeSign(c,e.event,d)<=0&&(t.dirty=n.dirty=!0,e.mesh.splitEdge(s.Sym),s.Org.s=e.event.s,s.Org.t=e.event.t),!1):(e.mesh.splitEdge(i.Sym),e.mesh.splitEdge(s.Sym),e.mesh.splice(s.Oprev,i),i.Org.s=d.s,i.Org.t=d.t,i.Org.pqHandle=e.pq.insert(i.Org),r.getIntersectData(e,i.Org,o,l,a,c),r.regionAbove(t).dirty=t.dirty=n.dirty=!0,!1)},r.walkDirtyRegions=function(e,t){for(var n=r.regionBelow(t),i,s;;){for(;n.dirty;)t=n,n=r.regionBelow(n);if(!t.dirty&&(n=t,t=r.regionAbove(t),t===null||!t.dirty))return;if(t.dirty=!1,i=t.eUp,s=n.eUp,i.Dst!==s.Dst&&r.checkForLeftSplice(e,t)&&(n.fixUpperEdge?(r.deleteRegion(e,n),e.mesh.delete(s),n=r.regionBelow(t),s=n.eUp):t.fixUpperEdge&&(r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n),i=t.eUp)),i.Org!==s.Org)if(i.Dst!==s.Dst&&!t.fixUpperEdge&&!n.fixUpperEdge&&(i.Dst===e.event||s.Dst===e.event)){if(r.checkForIntersect(e,t))return}else r.checkForRightSplice(e,t);i.Org===s.Org&&i.Dst===s.Dst&&(r.addWinding(s,i),r.deleteRegion(e,t),e.mesh.delete(i),t=r.regionAbove(n))}},r.connectRightVertex=function(e,t,n){var i,s=n.Onext,o=r.regionBelow(t),a=t.eUp,l=o.eUp,c=!1;if(a.Dst!==l.Dst&&r.checkForIntersect(e,t),We.vertEq(a.Org,e.event)&&(e.mesh.splice(s.Oprev,a),t=r.topLeftRegion(e,t),s=r.regionBelow(t).eUp,r.finishLeftRegions(e,r.regionBelow(t),o),c=!0),We.vertEq(l.Org,e.event)&&(e.mesh.splice(n,l.Oprev),n=r.finishLeftRegions(e,o,null),c=!0),c){r.addRightEdges(e,t,n.Onext,s,s,!0);return}We.vertLeq(l.Org,a.Org)?i=l.Oprev:i=a,i=e.mesh.connect(n.Lprev,i),r.addRightEdges(e,t,i,i.Onext,i.Onext,!1),i.Sym.activeRegion.fixUpperEdge=!0,r.walkDirtyRegions(e,t)},r.connectLeftDegenerate=function(e,t,n){var i,s,o,a,l;if(i=t.eUp,We.vertEq(i.Org,n)){Xe(!1),r.spliceMergeVertices(e,i,n.anEdge);return}if(!We.vertEq(i.Dst,n)){e.mesh.splitEdge(i.Sym),t.fixUpperEdge&&(e.mesh.delete(i.Onext),t.fixUpperEdge=!1),e.mesh.splice(n.anEdge,i),r.sweepEvent(e,n);return}Xe(!1),t=r.topRightRegion(t),l=r.regionBelow(t),o=l.eUp.Sym,s=a=o.Onext,l.fixUpperEdge&&(Xe(s!==o),r.deleteRegion(e,l),e.mesh.delete(o),o=s.Oprev),e.mesh.splice(n.anEdge,o),We.edgeGoesLeft(s)||(s=null),r.addRightEdges(e,t,o.Onext,a,s,!0)},r.connectLeftVertex=function(e,t){var n,i,s,o,a,l,c=new fm;if(c.eUp=t.anEdge.Sym,n=e.dict.search(c).key,i=r.regionBelow(n),!!i){if(o=n.eUp,a=i.eUp,We.edgeSign(o.Dst,t,o.Org)===0){r.connectLeftDegenerate(e,n,t);return}if(s=We.vertLeq(a.Dst,o.Dst)?n:i,n.inside||s.fixUpperEdge){if(s===n)l=e.mesh.connect(t.anEdge.Sym,o.Lnext);else{var u=e.mesh.connect(a.Dnext,t.anEdge);l=u.Sym}s.fixUpperEdge?r.fixUpperEdge(e,s,l):r.computeWinding(e,r.addRegionBelow(e,n,l)),r.sweepEvent(e,t)}else r.addRightEdges(e,n,t.anEdge,t.anEdge,null,!0)}},r.sweepEvent=function(e,t){e.event=t,r.debugEvent(e);for(var n=t.anEdge;n.activeRegion===null;)if(n=n.Onext,n===t.anEdge){r.connectLeftVertex(e,t);return}var i=r.topLeftRegion(e,n.activeRegion);Xe(i!==null);var s=r.regionBelow(i),o=s.eUp,a=r.finishLeftRegions(e,s,null);a.Onext===o?r.connectRightVertex(e,i,a):r.addRightEdges(e,i,a.Onext,o,o,!0)},r.addSentinel=function(e,t,n,i){var s=new fm,o=e.mesh.makeEdge();o.Org.s=n,o.Org.t=i,o.Dst.s=t,o.Dst.t=i,e.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=e.dict.insert(s)},r.initEdgeDict=function(e){e.dict=new VL(e,r.edgeLeq);var t=e.bmax[0]-e.bmin[0],n=e.bmax[1]-e.bmin[1],i=e.bmin[0]-t,s=e.bmax[0]+t,o=e.bmin[1]-n,a=e.bmax[1]+n;r.addSentinel(e,i,s,o),r.addSentinel(e,i,s,a)},r.doneEdgeDict=function(e){for(var t,n=0;(t=e.dict.min().key)!==null;)t.sentinel||(Xe(t.fixUpperEdge),Xe(++n==1)),Xe(t.windingNumber===0),r.deleteRegion(e,t)},r.removeDegenerateEdges=function(e){var t,n,i,s=e.mesh.eHead;for(t=s.next;t!==s;t=n)n=t.next,i=t.Lnext,We.vertEq(t.Org,t.Dst)&&t.Lnext.Lnext!==t&&(r.spliceMergeVertices(e,i,t),e.mesh.delete(t),t=i,i=t.Lnext),i.Lnext===t&&(i!==t&&((i===n||i===n.Sym)&&(n=n.next),e.mesh.delete(i)),(t===n||t===n.Sym)&&(n=n.next),e.mesh.delete(t))},r.initPriorityQ=function(e){var t,n,i,s=0;for(i=e.mesh.vHead,n=i.next;n!==i;n=n.next)s++;for(s+=8,t=e.pq=new kL(s,We.vertLeq),i=e.mesh.vHead,n=i.next;n!==i;n=n.next)n.pqHandle=t.insert(n);return n!==i?!1:(t.init(),!0)},r.donePriorityQ=function(e){e.pq=null},r.removeDegenerateFaces=function(e,t){var n,i,s;for(n=t.fHead.next;n!==t.fHead;n=i)i=n.next,s=n.anEdge,Xe(s.Lnext!==s),s.Lnext.Lnext===s&&(r.addWinding(s.Onext,s),e.mesh.delete(s));return!0},r.computeInterior=function(e,t){t===void 0&&(t=!0);var n,i;if(r.removeDegenerateEdges(e),!r.initPriorityQ(e))return!1;for(r.initEdgeDict(e);(n=e.pq.extractMin())!==null;){for(;i=e.pq.min(),!(i===null||!We.vertEq(i,n));)i=e.pq.extractMin(),r.spliceMergeVertices(e,n.anEdge,i.anEdge);r.sweepEvent(e,n)}return e.event=e.dict.min().key.eUp.Org,r.debugEvent(e),r.doneEdgeDict(e),r.donePriorityQ(e),r.removeDegenerateFaces(e,e.mesh)?(t&&e.mesh.check(),!0):!1},r}(),jL=function(){function r(){this.mesh=new Ux,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Wt.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return r.prototype.dot_=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},r.prototype.normalize_=function(e){var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(!t)throw"Zero-size vector!";t=Math.sqrt(t),e[0]/=t,e[1]/=t,e[2]/=t},r.prototype.longAxis_=function(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t},r.prototype.computeNormal_=function(e){var t,n,i,s,o,a,l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f=[null,null,null],p=[null,null,null],m=this.mesh.vHead;t=m.next;for(var v=0;v<3;++v)s=t.coords[v],c[v]=s,p[v]=t,l[v]=s,f[v]=t;for(t=m.next;t!==m;t=t.next)for(var g=0;g<3;++g)s=t.coords[g],sl[g]&&(l[g]=s,f[g]=t);var y=0;if(l[1]-c[1]>l[0]-c[0]&&(y=1),l[2]-c[2]>l[y]-c[y]&&(y=2),c[y]>=l[y]){e[0]=0,e[1]=0,e[2]=1;return}for(a=0,n=p[y],i=f[y],u[0]=n.coords[0]-i.coords[0],u[1]=n.coords[1]-i.coords[1],u[2]=n.coords[2]-i.coords[2],t=m.next;t!==m;t=t.next)h[0]=t.coords[0]-i.coords[0],h[1]=t.coords[1]-i.coords[1],h[2]=t.coords[2]-i.coords[2],d[0]=u[1]*h[2]-u[2]*h[1],d[1]=u[2]*h[0]-u[0]*h[2],d[2]=u[0]*h[1]-u[1]*h[0],o=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],o>a&&(a=o,e[0]=d[0],e[1]=d[1],e[2]=d[2]);a<=0&&(e[0]=e[1]=e[2]=0,e[this.longAxis_(u)]=1)},r.prototype.checkOrientation_=function(){for(var e=this.mesh.fHead,t,n=this.mesh.vHead,i,s=0,o=e.next;o!==e;o=o.next)if(i=o.anEdge,!(i.winding<=0))do s+=(i.Org.s-i.Dst.s)*(i.Org.t+i.Dst.t),i=i.Lnext;while(i!==o.anEdge);if(s<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},r.prototype.projectPolygon_=function(){var e=this.mesh.vHead,t=[0,0,0],n,i,s=!1;t[0]=this.normal[0],t[1]=this.normal[1],t[2]=this.normal[2],!t[0]&&!t[1]&&!t[2]&&(this.computeNormal_(t),s=!0),n=this.sUnit,i=this.tUnit;var o=this.longAxis_(t);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,i[o]=0,i[(o+1)%3]=0,i[(o+2)%3]=t[o]>0?1:-1;for(var a=e.next;a!==e;a=a.next)a.s=this.dot_(a.coords,n),a.t=this.dot_(a.coords,i);s&&this.checkOrientation_();for(var l=!0,c=e.next;c!==e;c=c.next)l?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,l=!1):(c.sthis.bmax[0]&&(this.bmax[0]=c.s),c.tthis.bmax[1]&&(this.bmax[1]=c.t))},r.prototype.addWinding_=function(e,t){e.winding+=t.winding,e.Sym.winding+=t.Sym.winding},r.prototype.tessellateMonoRegion_=function(e,t){var n,i;if(n=t.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;We.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;We.vertLeq(n.Org,n.Dst);n=n.Lnext);i=n.Lprev;for(var s=void 0;n.Lnext!==i;)if(We.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(We.edgeGoesLeft(i.Lnext)||We.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)s=e.connect(i.Lnext,i),i=s.Sym;i=i.Lprev}else{for(;i.Lnext!==n&&(We.edgeGoesRight(n.Lprev)||We.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=e.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(i.Lnext===n)throw"Mono region invalid";for(;i.Lnext.Lnext!==n;)s=e.connect(i.Lnext,i),i=s.Sym;return!0},r.prototype.tessellateInterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)if(t=n.next,n.inside&&!this.tessellateMonoRegion_(e,n))return!1;return!0},r.prototype.discardExterior_=function(e){for(var t,n=e.fHead.next;n!==e.fHead;n=t)t=n.next,n.inside||e.zapFace(n)},r.prototype.setWindingNumber_=function(e,t,n){for(var i,s=e.eHead.next;s!==e.eHead;s=i)i=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?t:-t:n?e.delete(s):s.winding=0},r.prototype.getNeighbourFace_=function(e){return!e.Rface||!e.Rface.inside?-1:e.Rface.n},r.prototype.outputPolymesh_=function(e,t,n,i){var s,o=0,a=0,l;n>3&&e.mergeConvexFaces(n);for(var c=e.vHead.next;c!==e.vHead;c=c.next)c.n=-1;for(var u=e.fHead.next;u!==e.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;c.n===-1&&(c.n=a,a++),l++,s=s.Lnext}while(s!==u.anEdge);if(l>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,t===gn.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=a,this.vertices=[],this.vertices.length=a*i,this.vertexIndices=[],this.vertexIndices.length=a;for(var c=e.vHead.next;c!==e.vHead;c=c.next)if(c.n!==-1){var h=c.n*i;this.vertices[h+0]=c.coords[0],this.vertices[h+1]=c.coords[1],i>2&&(this.vertices[h+2]=c.coords[2]),this.vertexIndices[c.n]=c.idx}for(var d=0,u=e.fHead.next;u!==e.fHead;u=u.next)if(!!u.inside){s=u.anEdge,l=0;do{var c=s.Org;this.elements[d++]=c.n,l++,s=s.Lnext}while(s!==u.anEdge);for(var f=l;f2&&(this.vertices[l++]=n.Org.coords[2]),this.vertexIndices[c++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==i);this.elements[u++]=s,this.elements[u++]=o,s+=o}},r.prototype.addContour=function(e,t){this.mesh===null&&(this.mesh=new Ux),e<2&&(e=2),e>3&&(e=3);for(var n=null,i=0;i2?n.Org.coords[2]=t[i+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},r.prototype.tesselate=function(e,t,n,i,s,o){if(e===void 0&&(e=Wt.ODD),t===void 0&&(t=gn.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=e,i<2&&(i=2),i>3&&(i=3),!this.mesh)return!1;this.projectPolygon_(),HL.computeInterior(this,o);var a=this.mesh;return t===gn.BOUNDARY_CONTOURS?this.setWindingNumber_(a,1,!0):this.tessellateInterior_(a),o&&a.check(),t===gn.BOUNDARY_CONTOURS?this.outputContours_(a,i):this.outputPolymesh_(a,t,n,i),!0},r}();function No(r){var e=r.windingRule,t=e===void 0?Wt.ODD:e,n=r.elementType,i=n===void 0?gn.POLYGONS:n,s=r.polySize,o=s===void 0?3:s,a=r.vertexSize,l=a===void 0?2:a,c=r.normal,u=c===void 0?[0,0,1]:c,h=r.contours,d=h===void 0?[]:h,f=r.strict,p=f===void 0?!0:f,m=r.debug,v=m===void 0?!1:m;if(!d&&p)throw new Error("Contours can't be empty");if(!!d){var g=new jL;r.edgeCreateCallback&&(g.edgeCreateCallback=r.edgeCreateCallback),r.vertexIdCallback&&(g.vertexIdCallback=r.vertexIdCallback);for(var y=0;yl.extractShapePointsToFlatArray([],this._curveSegments)),n,i=!0,s=!0,o,a;for(let l=0,c=e.length/2;lc&&(c=g),yh&&(h=y)}let d=c-l,f=h-u;for(let p=0,m=n.vertexCount;pthis._maxDrawCount}};var Rh=class{constructor(e=256,t=!1){this.capacity=e,this.size=0,this.debug=t,this.debug&&console.log(`allocating with cap ${e}`);let n=e*Rh.eSize;this.buffer=new ArrayBuffer(n);let i=Float32Array.BYTES_PER_ELEMENT,s=0;this.positions=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.normals=new Float32Array(this.buffer,s*i,3*e),s+=3*e,this.uvs=new Float32Array(this.buffer,s*i,2*e)}realloc(e,t=!1){if(ethis.capacity){let i=this.capacity;for(;t>i;)i*=2;this.realloc(i)}let n=this.size;return this.size=t,n}reserve(e){let t=this.size+e;t>this.capacity&&this.realloc(t)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} \u2192 ${this.size}`),this.realloc(this.size,!0)}},Dh=Rh;Dh.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var pm=(r,e)=>([t,n])=>(n=t?r:r+e)<=n),mm=class extends we{constructor(e,t,n=0,i=12,s=3){super();this.type="ShapeGeometry";this.vertexCache={};this._shape=e,this._depth=t,n<=0?(this._bevelSize=0,this._bevelSegments=0):(this._bevelSize=Math.min(n,t/2-1e-12),this._bevelSegments=Math.floor(s));let o=this._shape.extractShapePointsToFlatArray([],i),a=this._shape.shapeHoles.map(_=>{let S=_.extractShapePointsToFlatArray([],i),A=[];for(let T=S.length-1;T>=1;T-=2){let L=S[T-1],C=S[T-0];A.push(L,C)}return A}),l=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[o]}),c=No({windingRule:Wt.ODD,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]});if(!l)throw new Error("error generating geometry");let u=l.elementCount;if(c){l.elementCount+=c.elementCount;for(let _=0;_d&&(d=T),Lp&&(p=L)}this._minX=h,this._minY=f,this._width=d-h,this._height=p-f;let m=l.vertexCount*2*(2+this._bevelSegments);this._buffer=new Dh(m);let v=[],g=[];for(let _=l.elementCount-1,S=l.elementCount;_>=0;_--){let A=_>=u,T=_*2,L=l.elements[T+0],C=l.elements[T+1],U=L+C,P={start:L,count:C,normals:[],continuous:[],concave:[]},R=L,G=U-1,B=L+1,j=this._shape.roundedCurves.length;do{let z=R-L,D=l.vertices[G*2+0],K=l.vertices[G*2+1],q=l.vertices[R*2+0],ee=l.vertices[R*2+1],V=l.vertices[B*2+0],de=l.vertices[B*2+1],ae=q-D,te=ee-K,X=Math.sqrt(ae*ae+te*te);ae/=X,te/=X;let se=q-V,$=ee-de,H=Math.sqrt(se*se+$*$);se/=H,$/=H,P.normals[z*2+0]=-$,P.normals[z*2+1]=se,P.concave[z]=ae*$-te*se>0;let Q=l.vertexIndices[R];if(Array.isArray(Q))P.continuous[z]=!1;else{let[ce,ie]=this._shape.getCurveIndexFromVertexId(Q-1,!0);if(ie>0&&ie<1)P.continuous[z]=!0;else{let N=ie===1?ce+1:ce-1;N=(N+j)%j;let E=ie===1?0:1,Y=this._shape.roundedCurves[ce].getTangent(ie),re=this._shape.roundedCurves[N].getTangent(E);P.continuous[z]=Y.dot(re)>.95}}A&&(P.normals[z*2+0]*=-1,P.normals[z*2+1]*=-1),[G,R,B]=[R,B,B+1],B>=U&&(B-=C)}while(B!==L+1);let ne=[];ne.push({bevelI:0,angle:0,size:0,boundary:{vertices:l.vertices.slice(L*2,U*2),vertexCount:C,vertexIndices:new Array(C).fill(!0).map((z,D)=>[D,D]),elements:[0,C],elementCount:1,mesh:null},reverseMap:[],insetPoints:l.vertices.slice(L*2,U*2)});for(let z=1;z<=this._bevelSegments;z++){let D=z/this._bevelSegments*Math.PI/2,K=(1-Math.cos(D))*this._bevelSize,q=[],ee=[],V=[],de=[],ae=0;for(let X=0;XY&&(re-=Math.PI*2);let ye=re-Y;if(P.continuous[X]||A){let pe=Y+ye/2,Ie=Math.cos(pe)*K,ve=Math.sin(pe)*K;q[2*ae+0]=H+Ie*(A?-1:1),q[2*ae+1]=Q+ve*(A?-1:1),de[ae]=X,ae++}else{let pe=Math.max(1,Math.floor(i/4*Math.abs(ye)/Math.PI));for(let Ie=0;Ie<=pe;Ie++){let ve=Y+ye*(Ie/pe),Fe=Math.cos(ve)*K,Ce=Math.sin(ve)*K;q[2*ae+0]=H+Fe,q[2*ae+1]=Q+Ce,de[ae]=X,ae++}}}else q[2*ae+0]=H+ce,q[2*ae+1]=Q+ie,de[ae]=X,ee[X]=ae,ae++,q[2*ae+0]=H,q[2*ae+1]=Q,de[ae]=X,ae++,q[2*ae+0]=H+N,q[2*ae+1]=Q+E,de[ae]=X,V[X]=ae,ae++}let te=No({windingRule:Wt.POSITIVE,elementType:gn.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[q],edgeCreateCallback:X=>{let $=X.Org.idx,H=de[$],Q=de[($+1)%de.length];X.idx=[H,Q],X.Sym.idx=[Q,H]},vertexIdCallback:X=>{let se=X.Lprev.idx;return[se?se[1]:0,X.idx[0]]}});if(!te)throw console.log("Error"),new Error(`error generating bevel geometry for ${z}'th loop`);if(!te.vertexCount)break;for(let X=0;X{let q=0,ee=z.boundary.vertexIndices.length;for(;qre){let pe=Y/re,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,N=this.buildBevelVert(P,K,(X+Ie)%ee,Ie/(re-1)),v.push(ce.topN,ie.topP,N.topP),v.push(ie.bottomP,ce.bottomN,N.bottomP),ce=N)}else{let pe=re/Y,Ie=0;for(let ve=1;ve(Ie+1)*pe&&(Ie++,ie=this.buildBevelVert(P,D,(te+Ie)%q,Ie/(Y-1)),v.push(Q.topN,ie.topP,ce.topN),v.push(ie.bottomP,Q.bottomN,ce.bottomN),Q=ie)}te=(te+Y)%q,X=(X+re)%ee,de=(de+1)%V}while(de!==se)}{let z=ne[0];for(let D=0,K=z.boundary.vertexCount;D=W+2;D-=3){let K=v[D-2],q=v[D-1],ee=v[D-0];z.push(ee,q,K)}v.splice(W,v.length-W,...z)}if(A){let z=[];for(let D=ne[ne.length-1].boundary.vertices.length-1;D>=1;D-=2){let K=ne[ne.length-1].boundary.vertices[D-1],q=ne[ne.length-1].boundary.vertices[D-0];z.push(K,q)}g.push(z)}if(!A){let z=ne[ne.length-1],D=No({windingRule:ne.length>1?Wt.POSITIVE:Wt.ODD,elementType:gn.POLYGONS,vertexSize:2,strict:!0,contours:[z.insetPoints,...g]});if(!D)throw new Error("Error generating geometry for surface");for(let K=0;K0,u=e.continuous[l]||h);let d=Math.cos(t.angle),f=Math.sin(t.angle),p=n*2,m=l*2,v=c*2,g=t.boundary.vertices[p+0],y=t.boundary.vertices[p+1],x=(1-f)*this._bevelSize,b=(g-this._minX)/this._width,w=(y-this._minY)/this._height,_=e.normals[m+0],S=e.normals[m+1],A=e.normals[v+0],T=e.normals[v+1];if(h){let R=A-_,G=T-S;_=_+R*(1-i),S=S+G*(1-i);let B=Math.sqrt(_*_+S*S);_/=B,S/=B}let L=this._buffer.get(u?2:4),C=L*3,U=L*2,P={i:n,fi:l,topP:L+0,topN:L+0,bottomP:L+1,bottomN:L+1};return this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=_*d,this._buffer.normals[C+1]=S*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=_*d,this._buffer.normals[C+4]=S*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b,u||(L+=2,C+=6,U+=4,P.topP=L+0,P.bottomP=L+1,this._buffer.positions[C+0]=g,this._buffer.positions[C+1]=y,this._buffer.positions[C+2]=this._depth-x,this._buffer.normals[C+0]=A*d,this._buffer.normals[C+1]=T*d,this._buffer.normals[C+2]=f,this._buffer.uvs[U+0]=b,this._buffer.uvs[U+1]=w,this._buffer.positions[C+3]=g,this._buffer.positions[C+4]=y,this._buffer.positions[C+5]=x,this._buffer.normals[C+3]=A*d,this._buffer.normals[C+4]=T*d,this._buffer.normals[C+5]=-f,this._buffer.uvs[U+2]=w,this._buffer.uvs[U+3]=b),this.vertexCache[s]=P,P}};var Pn=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var c,u,h,d,f,p,m;let t=Object.assign({},(c=e==null?void 0:e.parameters)!=null?c:{width:100,subdivisions:40,roundness:0,extrudeDepth:0,surfaceMaxCount:100,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters),n=Math.abs(t.width),i=Math.abs((u=t.height)!=null?u:t.width),s=Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(h=t.depth)!=null?h:0),o=(d=r.shape)!=null?d:e==null?void 0:e.shape,a=(f=o==null?void 0:o.roundness)!=null?f:t.roundness;o!==void 0&&(o instanceof Lt?(o.width!==n||o.height!==i)&&o.applySize(n,i):o=new Lt(n,i).fromJSON(o),((p=r.parameters)==null?void 0:p.roundness)!==void 0&&((m=r.parameters)==null?void 0:m.roundness)>0&&o.update(!1));let l=o!=null?o:new Lt(n,i);return{parameters:Object.assign(t,{width:n,height:i,depth:s,extrudeDepth:s,roundness:a}),shape:l}}static build(r){let{extrudeDepth:e,extrudeBevelSize:t,extrudeBevelSegments:n,subdivisions:i,roundness:s,surfaceMaxCount:o}=r.parameters;r.shape.roundness=s;let a;return e<=0?a=new Rc(r.shape,i,o):a=new mm(r.shape,e,t,i,n),Object.assign(a,{userData:tt(Ue({},r),{type:"VectorGeometry"})})}};var jx=Math.PI*2,Wx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:128,angle:360,innerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1,surfaceMaxCount:1e3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((s=t.height)!=null?s:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(o=t.depth)!=null?o:0)})}}static build(r){let{width:e,height:t,spikes:n,angle:i,innerRadius:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u=r.shape,h=e*.5,d=t*.5,f=WL(u,h,d,i*Math.PI/180,n,s);u.isClosed=!0,u.update();let p=Pn.create({shape:u,parameters:{subdivisions:f,surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(p,{userData:tt(Ue({},r),{type:"EllipseGeometry"})})}};function WL(r,e,t,n,i,s){if(n>=jx)return i>30||i%4==0?(XL(r,e,t,s),Math.round(i/4)):Jx(r,n,i,e,t,s);let o={x:0,y:t},a=n+Math.PI*.5,l={x:Math.cos(a)*e,y:Math.sin(a)*t},c=Gx({px:o.x,py:o.y,cx:l.x,cy:l.y,rx:e,ry:t,largeArcFlag:n>Math.PI,sweepFlag:!0});return i>30||i%c.length==0?JL(r,o.x,o.y,c,i,e,t,s):Jx(r,n,i,e,t,s)}function JL(r,e,t,n,i,s,o,a){let l=Math.round(i/n.length);r.addPoint($a(e,t));for(let c=0,u=n.length;c0?Xx(r,s,o,a):r.addPoint($a(0,0)),l}function Jx(r,e,t,n,i,s){let o=-e/t;for(let a=0;a<=t;a++){let l=o*a,c=Math.sin(l)*n,u=Math.cos(l)*i;r.addPoint($a(c,u))}return e0?Xx(r,n,i,s):r.addPoint($a(0,0)):(r.removePoint(r.points[r.points.length-1]),s>0&&qx(r,n,i,s)),1}function XL(r,e,t,n=0,i=0,s=0){let o=.5522847498,a=e*o,l=t*o;r.addPoint(Bh(i-e,s,i-e,s-l,i-e,s+l)),r.addPoint(Bh(i,s+t,i-a,s+t,i+a,s+t)),r.addPoint(Bh(i+e,s,i+e,s+l,i+e,s-l)),r.addPoint(Bh(i,s-t,i+a,s-t,i-a,s-t)),n>0&&qx(r,e,t,n)}function $a(r,e){return new vs(Ee.generateUUID(),new O(r,e))}function Bh(r,e,t,n,i,s){let o=$a(r,e);return o.controls[0].position.set(t,n),o.controls[1].position.set(i,s),o}function Xx(r,e,t,n){Yx(r,e,t,n).forEach(s=>r.addPoint(s))}function qx(r,e,t,n){let i=Yx(r,e,t,n),s=new Lt;i.forEach(o=>s.addPoint(o)),s.isClosed=!0,r.shapeHoles.push(s)}function Yx(r,e,t,n){let i=n*e/100,s=i*(Math.abs(t)/Math.abs(e)),o=new O(i/e,s/t),a=r.points.map(l=>l.clone()).reverse();return a.forEach(l=>{l.position.multiply(o);let c=l.controls[0].position.clone().multiply(o),u=l.controls[1].position.clone().multiply(o);l.controls[0].position.copy(u),l.controls[1].position.copy(c)}),a}var Kx=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l,c;let t=Object.assign({},(a=e==null?void 0:e.parameters)!=null?a:{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},r.parameters),n=Math.abs(t.width),i=Math.abs((l=t.height)!=null?l:n),s=Math.abs((c=t.depth)!=null?c:n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(t,{width:n,height:i,depth:s,radius:o,segments:Math.round(t.segments),pathSegments:Math.round(t.pathSegments),cornerSegments:Math.round(t.cornerSegments)})}}static build(r){let{width:e,height:t,depth:n,radius:i,revolutions:s,segments:o,pathRadius:a,pathType:l,pathSegments:c,cornerRadius:u,cornerSegments:h}=r.parameters,d=new Oh(!1,e,t,n,i,s,o,a,l,c,u,h);return Object.assign(d,{userData:tt(Ue({},r),{type:"HelixGeometry"})})}},Oh=class extends we{constructor(e,t,n,i,s,o,a,l,c,u,h,d){super();let f=e&&o===1;f&&(d=0),h>100&&(h=100);let p=()=>new M,m=new M,v=p(),g=p(),y=p(),x,b,w,_,S,A,T,L,C=p(),U=p(),P=p(),R=p(),G=p(),B=p(),j=p(),ne=p(),le=n-2*l+.001,W=le/o,z=Math.ceil(a*o),D=z+1,K=le/z,q=-le/2,ee=u+1,V=2*Math.PI/u,de=Math.PI/2/d,ae=.01,te=Math.min((1-h/100)*l,l-ae),X=l-te,se=0,$=2,H=d*$+$,Q=ee*H/$,ce=Q+ee*D,ie=ee*(D+H),[N,E,Y]=[3,3,2].map(ke=>Array(ie*ke).fill(0)),re=[],ye=s-l;function pe(ke,ht){let ft=Math.PI/2;A=ht*K,L=2*Math.PI*(A%W)/W+ft,A+=q,T=Math.sin(L)*ye,S=Math.cos(L)*ye,e?ke.set(S,T,A):ke.set(S,A,T)}pe(m,-1e-10),pe(v,0),C.copy(m),pe(m,1);let Ie=m.distanceTo(v),ve=X+te,Fe=Ie*z+2*ve,Ce=te,J=Fe-ve;for(let ke=0;ke<=z;ke++){pe(g,ke),ne.subVectors(g,C).normalize(),C.copy(g),B.copy(g).setComponent(+e+1,0).normalize(),j.crossVectors(ne,B).normalize();let ht=ke===0,ft=ke===z,Bn=ht?3*Math.PI/2:de,Mt=ht?Ce:J,Tn=ht?ee:ce,En=ht?0:ie-ee,Di=ne.clone().multiplyScalar(ht?-X:X).add(g),_r=ne.clone().multiplyScalar(ht?-1:1).normalize();for(let xn=0;xn{N[se*3+Pe]=Di.getComponent(Pe),E[se*3+Pe]=_r.getComponent(Pe)}),Y[se*2]=+ft,Y[se*2+1]=xn/u),v.copy(P).multiplyScalar(te),y.addVectors(g,v);for(let Pe=0;Pe{N[se*3+Nn]=v.getComponent(Nn),E[se*3+Nn]=G.getComponent(Nn)});let Ft=+ht+Math.sin(et);Y[se*2]=(Mt+X*Ft)/Fe,Y[se*2+1]=xn/u}}v.addVectors(g,U),se=Q+ke*ee+xn,[0,1,2].forEach(Pe=>{N[se*3+Pe]=v.getComponent(Pe),E[se*3+Pe]=P.getComponent(Pe)}),Y[se*2]=(ve+ke*Ie)/Fe,Y[se*2+1]=xn/u}}let xe=D+2*d+$,he=1,[Ne,Be]=f?[he,he+D-1]:[0,xe-1];for(let ke=Ne;ke<=Be-1;ke++){let ht=f&&ke===Be-1;for(let ft=0;ft{Array.isArray(l)&&(l.x=l[0],l.y=l[1])});let t=Object.assign({},(s=e==null?void 0:e.parameters)!=null?s:{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs((a=t.depth)!=null?a:t.width)})}}static build(r){let{points:e,segments:t,verticalSegments:n}=r.parameters,i=new yi;i.moveTo(e[0].x,e[0].y),i.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y);let s=new uo(i.extractPoints(n).shape,t);return s.rotateZ(Math.PI),Object.assign(s,{userData:tt(Ue({},r),{type:"LatheGeometry"})})}};var fr=new me,gm=new Ke,zh=new M,Co=class extends cn{constructor(){super();this.uuid=Ee.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(e){let t=new Dt().getNormalMatrix(e);for(let n=0,i=this.vertices.length;n0)for(let d=0;d0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,n=this.faces.length;t=0;l--){let c=o[l];this.faces.splice(c,1);for(let u=0,h=this.faceVertexUvs.length;u0,b=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,_=m.vertexColors.length>0,S=0;if(S=u(S,0,0),S=u(S,1,v),S=u(S,2,g),S=u(S,3,y),S=u(S,4,x),S=u(S,5,b),S=u(S,6,w),S=u(S,7,_),n.push(S),n.push(m.a,m.b,m.c),n.push(m.materialIndex),y){let A=this.faceVertexUvs[0][p];n.push(f(A[0]),f(A[1]),f(A[2]))}if(x&&n.push(h(m.normal)),b){let A=m.vertexNormals;n.push(h(A[0]),h(A[1]),h(A[2]))}if(w&&n.push(d(m.color)),_){let A=m.vertexColors;n.push(d(A[0]),d(A[1]),d(A[2]))}}function u(p,m,v){return v?p|1<0&&(e.data.colors=o),l.length>0&&(e.data.uvs=[l]),e.data.faces=n,e}clone(){return new Co().copy(this)}copy(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;let t=e.vertices;for(let d=0,f=t.length;d0){let i=new Float32Array(e.normals.length*3);t.setAttribute("normal",new Re(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){let i=new Float32Array(e.colors.length*3);t.setAttribute("color",new Re(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){let i=new Float32Array(e.uvs.length*2);t.setAttribute("uv",new Re(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){let i=new Float32Array(e.uvs2.length*2);t.setAttribute("uv2",new Re(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(let i in e.morphTargets){let s=[],o=e.morphTargets[i];for(let a=0,l=o.length;a0){let i=new ge(e.skinIndices.length*4,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){let i=new ge(e.skinWeights.length*4,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(t.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(t.boundingBox=e.boundingBox.clone()),t}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(e){let t=new we,n=e.geometry;if(e.isPoints||e.isLine){let i=new ge(n.vertices.length*3,3),s=new ge(n.colors.length*3,3);if(t.setAttribute("position",i.copyVector3sArray(n.vertices)),t.setAttribute("color",s.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){let o=new ge(n.lineDistances.length,1);t.setAttribute("lineDistance",o.copyArray(n.lineDistances))}n.boundingSphere!==null&&(t.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(t.boundingBox=n.boundingBox.clone())}else e.isMesh&&(t=n.toBufferGeometry());return t}};Co.prototype.isGeometry=!0;var $x=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){let t=[],n,i,s,o=e.faces;for(i=0;i0,o=i[1]&&i[1].length>0,a=e.morphTargets,l=a.length,c;if(l>0){c=[];for(let g=0;g0){d=[];for(let g=0;g0&&t.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g0;)this._smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e}_smooth(e){let t=new M,n,i,s,o,a,l=e.vertices,c=e.faces,u=e.faceVertexUvs[0],h=u!==void 0&&u.length>0,d=[],f=new Map;KL(l,c,d,f);let p=[],m,v,g,y,x,b,w;for(let ae of Array.from(f.keys())){for(v=f.get(ae),g=new M,x=3/8,b=1/8,w=v.faces.length,w!=2&&(x=.5,b=0,w!=1),g.addVectors(v.a,v.b).multiplyScalar(x),t.set(0,0,0),o=0;o3&&(_=3/(8*n)),S=1-n*Number(_),A=_,n<=2&&(n==2?(S=3/4,A=1/8):n==1||n==0),U=C.clone().multiplyScalar(S),t.set(0,0,0),o=0;o0?(a===void 0||(o==null?void 0:o.subdivisions)>i)&&(a===void 0&&(a=s),s=new xm(i).modify(a).toBufferGeometry()):(a!==void 0&&(s=a),a=void 0),a!==void 0&&Object.assign(s,{originalGeometry:a}),delete r.geometry,Object.assign(s,{userData:tt(Ue({},r),{type:"NonParametricGeometry"})})}static loadFromUrl(r,e,t){new Ia(t).load(r,i=>{let s=this.normalizeInputs({geometry:i});i.boundingBox.getSize(yn);let o=100/yn.x;Object.assign(s.parameters,{width:100,height:yn.y*o,depth:yn.z*o}),e(this.build(s))})}};var e0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,spikes:5,cornerRadius:0,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:3},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,spikes:n,cornerRadius:i,depth:s,extrudeBevelSize:o,extrudeBevelSegments:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5,d=0,f=0,p=2*Math.PI/n;for(let v=0;v0){{let E=z.clone().add(D).multiplyScalar(.5),Y=b.clone().sub(E).normalize(),ye=x.clone().sub(E).normalize().add(Y).normalize().multiplyScalar(-1),pe=ee.clone().sub(q);ne(E,pe,ye,S.angle())}let ie,N;{let E=new M;Oc(L,$,E);let Y=ee.clone().add(K).multiplyScalar(.5);Y=QL(Y,D,b);let re=ee.clone().sub(K);[ie,N]=ne(Y,re,E,P,K.y)}{let E=ie,Y=E.clone().setY(0).normalize(),re=new M(0,-1,0),ye=Y.clone().cross(re);le(E,Y,re,ye)}j.concat(N);{let E=S.angle(),Y=Math.PI-E,re=b.clone();re.y-=o/Math.sin(E-Math.PI/2);let ye=new M,pe=[];for(let ve=0;veh+d,0);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((l=t.surfaceMaxCount)!=null?l:i>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((c=t.height)!=null?c:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(u=t.depth)!=null?u:0)}),ui:n}}static build(r){let e=r.shape,{width:t,height:n,cornerRadius:i,cornerType:s,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l,surfaceMaxCount:c}=r.parameters,u={x:t*.5,y:n*.5},h={x:-u.x,y:-u.y},d={x:u.x,y:u.y};function f(w,_,S){return _>t&&S>n?Math.min(w*t/_,w*n/S):_>t?w*t/_:S>n?w*n/S:w}let p=[];p[0]=i[0]===0?0:f(i[0],i[0]+i[3],i[0]+i[1]),p[1]=i[1]===0?0:f(i[1],i[1]+i[2],i[1]+i[0]),p[2]=i[2]===0?0:f(i[2],i[2]+i[1],i[2]+i[3]),p[3]=i[3]===0?0:f(i[3],i[3]+i[0],i[3]+i[2]);let m=h.x,v=d.x,g=d.y,y=h.y;e.addPoint(e.createPoint(m,g)),e.addPoint(e.createPoint(v,g)),e.addPoint(e.createPoint(v,y)),e.addPoint(e.createPoint(m,y)),e.isClosed=!0;let x=!0;for(let w=0,_=e.points.length;w<_;w++)e.points[w].roundness=p[w],w>0&&p[w]!==p[w-1]&&(x=!1);x&&(e.roundness=p[0]),e.useCubicForRoundedCorners=s!==1,e.update();let b=Pn.create({shape:e,parameters:{surfaceMaxCount:c,depth:o,extrudeBevelSize:a,extrudeBevelSegments:l}});return Object.assign(b,{userData:tt(Ue({},r),{type:"RectangleGeometry"})})}};var i0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var n,i,s;let t=Object.assign({},(n=e==null?void 0:e.parameters)!=null?n:{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI},r.parameters);return{parameters:Object.assign(t,{width:Math.abs(t.width),height:Math.abs((i=t.height)!=null?i:t.width),depth:Math.abs((s=t.depth)!=null?s:t.width)})}}static build(r){let{width:e=100,height:t=e,depth:n=e,widthSegments:i=64,heightSegments:s=64,phiStart:o,phiLength:a,thetaStart:l,thetaLength:c}=r.parameters,u=new Ji(.5*e,i,s,o,a,l,c);return u.scale(1,t/e,n/e),Object.assign(u,{userData:tt(Ue({},r),{type:"SphereGeometry"})})}};var r0=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var i,s,o,a;let t=Object.assign({},(i=e==null?void 0:e.parameters)!=null?i:{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeDepth:0,extrudeBevelSize:0,extrudeBevelSegments:1},r.parameters);return{shape:r.shape&&r.shape instanceof Lt?r.shape:new Lt,parameters:Object.assign(t,{surfaceMaxCount:((s=t.surfaceMaxCount)!=null?s:t.cornerRadius>0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e,height:t,innerRadiusPercent:n,spikes:i,cornerRadius:s,angle:o,depth:a,extrudeBevelSize:l,extrudeBevelSegments:c,surfaceMaxCount:u}=r.parameters,h=r.shape,d=e*.5,f=t*.5,p=0,m=0,v=o*Math.PI/360/i,g=Math.PI/2*3*-1,y=d*n/100,x=f*n/100;if(i==3&&n==50){v=2*Math.PI/i;for(let w=0;w0)?1e3:100,width:Math.abs(t.width),height:Math.abs((o=t.height)!=null?o:t.width*(t.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(t.depth!==void 0&&t.depth===0&&t.extrudeDepth>0?t.extrudeDepth:(a=t.depth)!=null?a:0)})}}static build(r){let{width:e=100,height:t,cornerRadius:n,depth:i,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:a,surfaceMaxCount:l}=r.parameters,c=r.shape,u=e*.5,h=t*.5;a?(c.addPoint(c.createPoint(-u,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))):(c.addPoint(c.createPoint(0,h)),c.addPoint(c.createPoint(u,-h)),c.addPoint(c.createPoint(-u,-h))),c.isClosed=!0;for(let f=0,p=c.points.length;f[]))}let f=Math.log10(1/t),p=Math.pow(10,f);for(let v=0;v{$L=r});var ot;c0.then(r=>{ot=r});var Fc=new M,pr=new M,zc=new me;function u0(r,...e){let t=0;for(let s of e)t+=s.length;let n=new r(t),i=0;for(let s of e)n.set(s,i),i+=s.length;return n}var nl,Qn=(nl=class{static create(r){return this.build(this.normalizeInputs(r))}static normalizeInputs(r,e){var a,l;let t=(a=r.geometry)!=null?a:e==null?void 0:e.geometry,{width:n,height:i,depth:s}=t.userData.parameters,o=Ue(Ue({},(l=e==null?void 0:e.parameters)!=null?l:{width:n,height:i,depth:s,subdivisions:1}),r.parameters);return{parameters:tt(Ue({},o),{width:Math.abs(o.width),height:Math.abs(o.height),depth:Math.abs(o.depth)}),geometry:t,subdivPointer:e==null?void 0:e.subdivPointer,smoothShading:e==null?void 0:e.smoothShading}}static build(r){let e=r.geometry,t=r.geometry.originalGeometry,{width:n,height:i,depth:s,subdivisions:o}=r.parameters,a=e.userData.parameters;Fc.set(a.width,a.height,a.depth),(n!==Fc.x||i!==Fc.y||s!==Fc.z)&&(pr.set(n,i,s).divide(Fc),zc.makeScale(isNaN(pr.x)||pr.x===0?1:pr.x,isNaN(pr.y)||pr.y===0?1:pr.y,isNaN(pr.z)||pr.z===0?1:pr.z),e.applyMatrix4(zc),t?(t.applyMatrix4(zc),t.getAttribute("positionWASM").applyMatrix4(zc)):e.getAttribute("positionWASM").applyMatrix4(zc));let l,c;return t!==void 0?(c=e,l=t):l=e,r.subdivPointer===void 0&&(this.allocate(l),l==null||l.dispose(),l=this.buildLevel(!0,r.smoothShading),l.computeBoundingSphere(),r.subdivPointer=this.activeSubdivPtr,this.getTopologicalMesh(l)),o>0?((o!==(a==null?void 0:a.subdivisions)||t===void 0)&&(r.subdivPointer!==this.activeSubdivPtr&&(this.activeSubdivPtr=r.subdivPointer),c==null||c.dispose(),ot.set_destination_refinement_level(r.subdivPointer,o),c=this.buildLevel(!1,r.smoothShading),c.boundingSphere=l.boundingSphere),e=c,t=l,delete t.userData.parameters):(e=l,c==null||c.dispose(),t=void 0),Object.assign(e,{originalGeometry:t,subdivPointer:this.activeSubdivPtr,userData:{parameters:r.parameters,type:"SubdivGeometry"}})}static allocate(r){var x;let e,t,n,i=[],s=[];if(r.userData.type!=="SubdivGeometry"){let b=tl.mergeVertices(r,(x=this.mergeVerticesToleranceExceptions[r.userData.type])!=null?x:1.1);e=b.attributes.position.array;let w=b.getIndex().array,_=w.length;switch(r.userData.type){case"TorusGeometry":case"TorusKnotGeometry":case"CubeGeometry":t=new Uint32Array(_/3*2),n=new Uint8Array(_/6).fill(4);for(let U=0,P=0;U<_;U+=6)t[P++]=w[U],t[P++]=w[U+1],t[P++]=w[U+4],t[P++]=w[U+5];break;case"SphereGeometry":case"HelixGeometry":case"CylinderGeometry":case"ConeGeometry":let S,A;if(r.userData.type==="SphereGeometry")A=r.parameters.heightSegments,S=r.parameters.widthSegments;else if(r.userData.type==="CylinderGeometry")A=r.parameters.heightSegments+2,S=r.parameters.radialSegments;else if(r.userData.type==="ConeGeometry")A=r.parameters.heightSegments+1,S=r.parameters.radialSegments;else{let{pathSegments:U,segments:P,revolutions:R}=r.userData.parameters;A=Math.ceil(P*R)+2,S=U}t=new Uint32Array(2*S*3+(A-2)*S*4),n=new Uint8Array(2*S+(A-2)*S);let T=0,L=0,C=0;if(r.userData.type==="SphereGeometry"||r.userData.type==="HelixGeometry"){for(;L<3*S;)t[L++]=w[T++],t[L++]=w[T++],t[L++]=w[T++],n[C++]=3;for(;L<3*S+4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4}else for(;L<4*(A-2)*S;T+=6)t[L++]=w[T],t[L++]=w[T+1],t[L++]=w[T+4],t[L++]=w[T+5],n[C++]=4;for(;L>2,(n>>2)+i),o=s.subarray(4,4+4),a=0,l=ot.HEAPU32[s[a]>>2],c=ot.HEAPF32.subarray(l>>2,(l>>2)+o[a]);a++;let u=ot.HEAPU32[s[a]>>2],h=ot.HEAPF32.subarray(u>>2,(u>>2)+o[a]);a++;let d=ot.HEAPU32[s[a]>>2],f=ot.HEAPU32.subarray(d>>2,(d>>2)+o[a]);a++;let p=ot.HEAPU32[s[a]>>2],m=ot.HEAPU32.subarray(p>>2,(p>>2)+o[a]);if(a++,t===void 0){let v=new we;if(v.setIndex(new is(m,1)),v.setAttribute("position",new ge(c,3)),v.setAttribute("normal",new ge(h,3)),r){v.setAttribute("faceMap",new is(f,1));let g=new Float32Array(h.length/3*4).fill(0);v.setAttribute("color",new Re(g,4))}return ot.free_mesh_data(n),v.userData.type="SubdivGeometry",v}t.getAttribute("position").copyArray(c),t.getAttribute("normal").copyArray(h),t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0,ot.free_mesh_data(n)}static buildControlCageWireframe(r,e){let t=ot.get_wireframe_data_for_base_level(this.activeSubdivPtr),n=4,i=ot.HEAPU32.subarray(t>>2,(t>>2)+n),s=i.subarray(2,2+2),o=0,a=ot.HEAPU32[i[o]>>2],l=ot.HEAPF32.subarray(a>>2,(a>>2)+s[o]);o++;let c=ot.HEAPU32[i[o]>>2],u=ot.HEAPU32.subarray(c>>2,(c>>2)+s[o]);if(r===void 0){let h=new we;h.setAttribute("position",new ge(l,3));let d=new Float32Array(l.length);for(let f=0,p=l.length;f0?(o=this.buildLevel(!1,t),i=o,s=n,delete s.userData.parameters):(i=n,s=void 0),Object.assign(i,{originalGeometry:s,userData:{parameters:r,type:"SubdivGeometry"}})}static getTopologicalMesh(r){let e=ot.get_topological_data(this.activeSubdivPtr),t=6,n=ot.HEAPU32.subarray(e>>2,(e>>2)+t),i=n.subarray(3,3+3),s=0,o=ot.HEAPU32[n[s]>>2],a=ot.HEAPF32.subarray(o>>2,(o>>2)+i[s]);s++;let l=ot.HEAPU32[n[s]>>2],c=ot.HEAPU32.subarray(l>>2,(l>>2)+i[s]);s++;let u=ot.HEAPU32[n[s]>>2],h=ot.HEAPU32.subarray(u>>2,(u>>2)+i[s]);r.setAttribute("positionWASM",new ge(a,3)),r.setAttribute("indexWASM",new is(c,1)),r.setAttribute("verticesPerFaceWASM",new Sf(h,1)),ot.free_topological_data(e)}},nl.checkpoints=[],nl.checkpointCurrentIndex=-1,nl.maxCheckpoints=30,nl.mergeVerticesToleranceExceptions={DodecahedronGeometry:2},nl);var Gc={};fA(Gc,{addBarycentricAttribute:()=>n2,fixUvs:()=>r2,loadFromUrl:()=>i2,resizeGeometry:()=>t2,roundShapePolygon:()=>e2});var h0=function(r,e){let t=e.x-r.x,n=e.y-r.y,i=Math.sqrt(t*t+n*n),s=t/i,o=n/i,a=Math.atan2(o,s);return{x:t,y:n,len:i,nx:s,ny:o,ang:a}},e2=(r,e,t)=>{let n,i,s,o,a,l,c,u,h,d,f,p,m,v,g=e.length;for(o=e[g-2],r.curves=[],n=1;n0&&(h=-1,d=!0),p=f/2,v=Math.abs(Math.cos(p)*t/Math.sin(p)),v>Math.min(y.len/2,x.len/2)?(v=Math.min(y.len/2,x.len/2),m=Math.abs(v*Math.sin(p)/Math.cos(p))):m=t,i=a.x+x.nx*v,s=a.y+x.ny*v,i+=-x.ny*m*h,s+=x.nx*m*h,r.absarc(i,s,m,y.ang+Math.PI/2*h,x.ang-Math.PI/2*h,d),o=a,a=l}r.closePath()},t2=(r,{width:e,height:t,depth:n})=>{e=Math.abs(e),t=Math.abs(t),n=Math.abs(n);let i=r.userData.parameters,s,o,a;e===0?(e=i.width,s=1):s=e/i.width,t===0?(t=i.height,o=1):o=t/i.height,n===0?(n=i.depth,a=1):a=n/i.depth,r.scale(s,o,a),i.width=e,i.height=t,i.depth=n},n2=(r,e)=>{let t=[new M(1,0,0),new M(0,1,0),new M(0,0,1)],n=r.attributes.position,i=new Float32Array(n.count*3);for(let s=0,o=n.count;snew Promise(e=>{new Ia().load(r,n=>e(n))}),r2=(r,e,t)=>{let n=r.getAttribute("uv");if(n)for(let i=0;iUc[r.type].create(r);var Vh=r=>"isEntity"in r,ai=r=>"isAbstractMesh"in r;var Hh=r=>"objectHelper"in r;var il=new tn,Dn=new M,Je=new M,vn=new me;function s2(r,e,t=0,n=e.count){let i=1/0,s=1/0,o=1/0,a=-1/0,l=-1/0,c=-1/0;for(let u=t;ua&&(a=h),d>l&&(l=d),f>c&&(c=f)}return r.min.set(i,s,o),r.max.set(a,l,c),r}var d0=(r,e,t,n)=>{var i,s;if(ai(r)){let o=r.geometry.userData.parameters,a=r.geometry.getAttribute("position");r.geometry.userData.type==="SubdivGeometry"?Dn.copy(((i=r.geometry.originalGeometry)!=null?i:r.geometry).boundingSphere.center):(s2(il,a,r.geometry.drawRange.start,r.geometry.drawRange.count<1/0?r.geometry.drawRange.count:a.count),il.getCenter(Dn)),r.forceComputeSize?il.getSize(Je).multiplyScalar(.5):Je.set(o.width,o.height,(s=o.depth)!=null?s:0).multiplyScalar(.5)}else if(Hh(r)&&n===!0){let o=r.geometryHelper.getAttribute("position");il.setFromArray(o.array),il.getCenter(Dn),il.getSize(Je).multiplyScalar(.5)}else Dn.setScalar(0),Je.setScalar(0);vn.copy(e).multiply(r.matrixWorld),Je.x===0&&Je.y===0&&Je.z===0?t.push(new M(Dn.x,Dn.y,Dn.z).applyMatrix4(vn)):t.push(new M(-Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).add(Dn).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).add(Dn).applyMatrix4(vn))},jh=class extends tn{constructor(e,t){super(e,t);this.transform=new me;this.vertices=[];this.faces=[];this.edges=[];this.centerEdges=[]}setFromObjectSize(e,t=!1){e.updateWorldMatrix(!1,!1),this.makeEmpty(),this.transform=e.matrixWorld;let n=new me().copy(e.matrixWorld).invert();return this.expandByObjectSize(e,n,t)}expandByObjectSize(e,t,n=!1){let i=[];return n===!0?e.traverseEntity(s=>d0(s,t,i,"enableHelper"in e&&e.enableHelper)):d0(e,t,i,"enableHelper"in e&&e.enableHelper),this.setFromPoints(i)}getCenter(e){return e=super.getCenter(e),e.applyMatrix4(this.transform),e}getPositionToCenter(e){return e=super.getCenter(e),e}computeVertices(){this.getSize(Je).multiplyScalar(.5),this.getCenter(Dn),vn.copy(this.transform).setPosition(Dn),this.vertices=[new M(-Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,Je.z).applyMatrix4(vn),new M(Je.x,Je.y,Je.z).applyMatrix4(vn),new M(-Je.x,Je.y,-Je.z).applyMatrix4(vn),new M(-Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,-Je.y,-Je.z).applyMatrix4(vn),new M(Je.x,Je.y,-Je.z).applyMatrix4(vn)]}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=[new qn(this.vertices[0],this.vertices[3]),new qn(this.vertices[1],this.vertices[2]),new qn(this.vertices[5],this.vertices[6]),new qn(this.vertices[4],this.vertices[7]),new qn(this.vertices[0],this.vertices[1]),new qn(this.vertices[3],this.vertices[2]),new qn(this.vertices[7],this.vertices[6]),new qn(this.vertices[4],this.vertices[5]),new qn(this.vertices[0],this.vertices[4]),new qn(this.vertices[1],this.vertices[5]),new qn(this.vertices[2],this.vertices[6]),new qn(this.vertices[3],this.vertices[7])],this.centerEdges=this.edges.map(e=>e.getCenter(new M))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=[new M().copy(this.vertices[0]).sub(this.vertices[2]).multiplyScalar(.5).add(this.vertices[2]),new M().copy(this.vertices[7]).sub(this.vertices[5]).multiplyScalar(.5).add(this.vertices[5]),new M().copy(this.vertices[4]).sub(this.vertices[1]).multiplyScalar(.5).add(this.vertices[1]),new M().copy(this.vertices[3]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6]),new M().copy(this.vertices[4]).sub(this.vertices[3]).multiplyScalar(.5).add(this.vertices[3]),new M().copy(this.vertices[1]).sub(this.vertices[6]).multiplyScalar(.5).add(this.vertices[6])]}};function wm(r,e,t,n){if(n===0)return t.copy(r);if(n===1)return t.copy(e);let i=r.w*e.w+r.x*e.x+r.y*e.y+r.z*e.z;if(i>=1)return t.copy(r);let s=1-i*i;if(s<=Number.EPSILON){let u=1-n;return t.w=u*r.w+n*e.w,t.x=u*r.x+n*e.x,t.y=u*r.y+n*e.y,t.z=u*r.z+n*e.z,t.normalize(),t}let o=Math.sqrt(s),a=Math.atan2(o,i),l=Math.sin((1-n)*a)/o,c=Math.sin(n*a)/o;return t.w=r.w*l+e.w*c,t.x=r.x*l+e.x*c,t.y=r.y*l+e.y*c,t.z=r.z*l+e.z*c,t}function o2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e);return n.dot(i)/e.distanceTo(t)}function a2(r,e){return r.clone().dot(e)/e.length()}function l2(r,e,t,n,i=!1){let s=t-r,o=n-e,a=Math.atan2(o,s)*(180/Math.PI);return i&&a<0&&(a=360+a),a}function c2(r,e,t){let n=r.clone().sub(e),i=t.clone().sub(e),s=e.distanceTo(r),o=e.distanceTo(t),a=n.dot(i)/(s*o);return Math.acos(a)}function u2(r,e){let t=(r+"e").split("e");return t=(Math.round(Number(t[0]+"e"+(+t[1]+e)))+"e").split("e"),+(t[0]+"e"+(+t[1]-e))}function h2(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}var d2=str=>eval(str.replace(/[^0-9()+\-*/.]/g,"")),C5={slerp:wm,getProjection:o2,projectOnVector:a2,angle2D:l2,angle3D:c2,round:u2,swapArrayValues:h2,evaluate:d2};var Io=new Set;var $i;(function(a){a[a.LINEAR=0]="LINEAR",a[a.EASE=1]="EASE",a[a.EASE_IN=2]="EASE_IN",a[a.EASE_OUT=3]="EASE_OUT",a[a.EASE_IN_OUT=4]="EASE_IN_OUT",a[a.CUBIC=5]="CUBIC",a[a.SPRING=6]="SPRING"})($i||($i={}));var rl=class{constructor(){this.easing=4;this.duration=1e3;this.delay=0;this.cubicControls=[.5,.05,.1,.3];this.springParameters={mass:1,stiffness:80,damping:10,velocity:0};this.repeat=!1;this.cycle=!1;this.rewind=!1}get sp_mass(){return this.springParameters.mass}set sp_mass(e){this.springParameters.mass=e}get sp_stiffness(){return this.springParameters.stiffness}set sp_stiffness(e){this.springParameters.stiffness=e}get sp_damping(){return this.springParameters.damping}set sp_damping(e){this.springParameters.damping=e}get sp_velocity(){return this.springParameters.velocity}set sp_velocity(e){this.springParameters.velocity=e}copy(e){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters=Ue({},e.springParameters),this.repeat=e.repeat,this.cycle=e.cycle,this.rewind=e.rewind,this}clone(){return new rl().copy(this)}toJSON(){let e={easing:this.easing,duration:this.duration,delay:this.delay,cubicControls:this.cubicControls,springParameters:Ue({},this.springParameters)};return this.repeat===!0&&(e.repeat=!0),this.cycle===!0&&(e.cycle=!0),this.rewind===!0&&(e.rewind=!0),this.object!==void 0&&(e.object=this.object.uuid),this.state!==void 0&&(e.state=this.state.uuid),e}fromJSON(e,t,n){return this.easing=e.easing,this.duration=e.duration,this.delay=e.delay,this.cubicControls=[...e.cubicControls],this.springParameters.mass=e.springParameters.mass,this.springParameters.stiffness=e.springParameters.stiffness,this.springParameters.damping=e.springParameters.damping,this.springParameters.velocity=e.springParameters.velocity,e.repeat!==void 0&&(this.repeat=e.repeat),e.cycle!==void 0&&(this.cycle=e.cycle),e.rewind!==void 0&&(this.rewind=e.rewind),e.object!==void 0&&(this.object=t[e.object]),e.state!==void 0&&(this.state=n[e.state]),this}};function f2(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ze;(function(h){h[h.MOUSE_DOWN=0]="MOUSE_DOWN",h[h.MOUSE_UP=1]="MOUSE_UP",h[h.MOUSE_HOVER=2]="MOUSE_HOVER",h[h.MOUSE_ENTER=3]="MOUSE_ENTER",h[h.MOUSE_LEAVE=4]="MOUSE_LEAVE",h[h.KEY_DOWN=5]="KEY_DOWN",h[h.KEY_UP=6]="KEY_UP",h[h.START=7]="START",h[h.OPEN_LINK=8]="OPEN_LINK",h[h.LOOK_AT=9]="LOOK_AT",h[h.FOLLOW=10]="FOLLOW"})(Ze||(Ze={}));var sl=class{constructor(e,t){this.targets=[];this.ui={isCollapsed:!1};this._type=e,this.key=t}get type(){return this._type}set type(e){this._type=e,e===9?this.distance=1e3:this.distance=void 0,e!==5&&e!==6&&(this.key=void 0)}newTarget(e){let t=new rl;if(t.object=e,e!==void 0){let n=e.interaction.states;n.length>0&&(t.state=n[n.length-1])}return this.targets.push(t),Io.add(t),t}addTarget(e,t=0){this.targets.splice(t,0,e),Io.add(e)}removeTarget(e){Io.delete(this.targets[e]),this.targets.splice(e,1)}dispatchReverse(){for(let e=0,t=this.targets.length;e0){e.targets=[];for(let t=0,n=this.targets.length;ti.clone())})}else this.material={layersList:e.material.layersList.map(t=>t.clone())};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:e.camera.targetOffset}),this}clone(){return new bs().copy(this)}toJSON(e){let t={uuid:this.uuid,name:this.name,position:this.position.toArray(),rotation:this.rotation.toArray(),scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};if(this.geometry!==void 0&&(t.geometry={width:this.geometry.width,height:this.geometry.height,depth:this.geometry.depth}),this.material!==void 0)if(this.material instanceof Array){t.material=[];for(let n=0,i=this.material.length;ns.toJSON(e))})}else t.material={layersList:this.material.layersList.map(n=>n.toJSON(e))};return this.camera!==void 0&&(t.camera={zoomPersp:this.camera.zoomPersp,zoomOrtho:this.camera.zoomOrtho,targetOffset:this.camera.targetOffset}),t}fromJSON(e,t){var n;if(this.uuid=e.uuid,this.name=e.name,this.position.fromArray(e.position),this.rotation.fromArray(e.rotation),this.scale.fromArray(e.scale),this.hiddenMatrix.fromArray(e.hiddenMatrix),e.geometry!==void 0&&(this.geometry={width:e.geometry.width,height:e.geometry.height,depth:e.geometry.depth}),e.material!==void 0)if(e.material instanceof Array){this.material=[];for(let i=0,s=e.material.length;ikp(o,t))})}else this.material={layersList:e.material.layersList.map(i=>kp(i,t))};return e.camera!==void 0&&(this.camera={zoomPersp:e.camera.zoomPersp,zoomOrtho:e.camera.zoomOrtho,targetOffset:(n=e.camera.targetOffset)!=null?n:-1}),this}};"use strict";var f0={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},Sm={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},p2=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Wh={CSS:{},springs:{}};function mr(r,e,t){return Math.min(Math.max(r,e),t)}function Vc(r,e){return r.indexOf(e)>-1}function Mm(r,e){return r.apply(null,e)}var qe={arr:function(r){return Array.isArray(r)},obj:function(r){return Vc(Object.prototype.toString.call(r),"Object")},pth:function(r){return qe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return!("isNode"in r)&&(r.nodeType||qe.svg(r))},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r=="undefined"},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return qe.hex(r)||qe.rgb(r)||qe.hsl(r)},key:function(r){return!f0.hasOwnProperty(r)&&!Sm.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function p0(r){var e=/\(([^)]+)\)/.exec(r);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m0(r,e){var t=p0(r),n=mr(qe.und(t[0])?1:t[0],.1,100),i=mr(qe.und(t[1])?100:t[1],.1,100),s=mr(qe.und(t[2])?10:t[2],.1,100),o=mr(qe.und(t[3])?0:t[3],.1,100),a=Math.sqrt(i/n),l=s/(2*Math.sqrt(i*n)),c=l<1?a*Math.sqrt(1-l*l):0,u=1,h=l<1?(l*a+-o)/c:-o+a;function d(p){var m=e?e*p/1e3:p;return l<1?m=Math.exp(-m*l*a)*(u*Math.cos(c*m)+h*Math.sin(c*m)):m=(u+h*m)*Math.exp(-m*a),p===0||p===1?p:1-m}function f(){var p=Wh.springs[r];if(p)return p;for(var m=1/6,v=0,g=0;;)if(v+=m,d(v)===1){if(g++,g>=16)break}else g=0;var y=v*m*1e3;return Wh.springs[r]=y,y}return e?d:f}function m2(r){return r===void 0&&(r=10),function(e){return Math.ceil(mr(e,1e-6,1)*r)*(1/r)}}var g2=function(){var r=11,e=1/(r-1);function t(u,h){return 1-3*h+3*u}function n(u,h){return 3*h-6*u}function i(u){return 3*u}function s(u,h,d){return((t(h,d)*u+n(h,d))*u+i(h))*u}function o(u,h,d){return 3*t(h,d)*u*u+2*n(h,d)*u+i(h)}function a(u,h,d,f,p){var m,v,g=0;do v=h+(d-h)/2,m=s(v,f,p)-u,m>0?d=v:h=v;while(Math.abs(m)>1e-7&&++g<10);return v}function l(u,h,d,f){for(var p=0;p<4;++p){var m=o(h,d,f);if(m===0)return h;var v=s(h,d,f)-u;h-=v/m}return h}function c(u,h,d,f){if(!(0<=u&&u<=1&&0<=d&&d<=1))return;var p=new Float32Array(r);if(u!==h||d!==f)for(var m=0;m=.001?l(g,_,u,d):S===0?_:a(g,y,y+e,u,d)}return function(g){return u===h&&d===f||g===0||g===1?g:s(v(g),h,f)}}return c}(),g0=function(){var r={linear:function(){return function(n){return n}}},e={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var i,s=4;n<((i=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((i*3-2)/22-n,2)}},Elastic:function(n,i){n===void 0&&(n=1),i===void 0&&(i=.5);var s=mr(n,1,10),o=mr(i,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(n,i){e[n]=function(){return function(s){return Math.pow(s,i+2)}}}),Object.keys(e).forEach(function(n){var i=e[n];r["easeIn"+n]=i,r["easeOut"+n]=function(s,o){return function(a){return 1-i(s,o)(1-a)}},r["easeInOut"+n]=function(s,o){return function(a){return a<.5?i(s,o)(a*2)/2:1-i(s,o)(a*-2+2)/2}}}),r}();function Am(r,e){if(qe.fnc(r))return r;var t=r.split("(")[0],n=g0[t],i=p0(r);switch(t){case"spring":return m0(r,e);case"cubicBezier":return Mm(g2,i);case"steps":return Mm(m2,i);default:return Mm(n,i)}}function y0(r){try{var e=document.querySelectorAll(r);return e}catch(t){return}}function Jh(r,e){for(var t=r.length,n=arguments.length>=2?arguments[1]:void 0,i=[],s=0;s1&&(p-=1),p<1/6?d+(f-d)*6*p:p<1/2?f:p<2/3?d+(f-d)*(2/3-p)*6:d}var a,l,c;if(n==0)a=l=c=i;else{var u=i<.5?i*(1+n):i+n-i*n,h=2*i-u;a=o(h,u,t+1/3),l=o(h,u,t),c=o(h,u,t-1/3)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function b2(r){if(qe.rgb(r))return y2(r);if(qe.hex(r))return v2(r);if(qe.hsl(r))return x2(r)}function Gr(r){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(e)return e[1]}function w2(r){if(Vc(r,"translate")||r==="perspective")return"px";if(Vc(r,"rotate")||Vc(r,"skew"))return"deg"}function Nm(r,e){return qe.fnc(r)?r(e.target,e.id,e.total):r}function gr(r,e){return r.getAttribute(e)}function Cm(r,e,t){var n=Gr(e);if(_m([t,"deg","rad","turn"],n))return e;var i=Wh.CSS[e+t];if(!qe.und(i))return i;var s=100,o=document.createElement(r.tagName),a=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Wh.CSS[e+t]=c,c}function x0(r,e,t){if(e in r.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=r.style[e]||getComputedStyle(r).getPropertyValue(n)||"0";return t?Cm(r,i,t):i}}function Lm(r,e){if(qe.dom(r)&&!qe.inp(r)&&(gr(r,e)||qe.svg(r)&&r[e]))return"attribute";if(qe.dom(r)&&_m(p2,e))return"transform";if(qe.dom(r)&&e!=="transform"&&x0(r,e))return"css";if(r[e]!=null)return"object"}function b0(r){if(!!qe.dom(r)){for(var e=r.style.transform||"",t=/(\w+)\(([^)]*)\)/g,n=new Map,i;i=t.exec(e);)n.set(i[1],i[2]);return n}}function S2(r,e,t,n){var i=Vc(e,"scale")?1:0+w2(e),s=b0(r).get(e)||i;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),n?Cm(r,s,n):s}function Im(r,e,t,n){switch(Lm(r,e)){case"transform":return S2(r,e,n,t);case"css":return x0(r,e,t);case"attribute":return gr(r,e);default:return r[e]||0}}function Pm(r,e){var t=/^(\*=|\+=|-=)/.exec(r);if(!t)return r;var n=Gr(r)||0,i=parseFloat(e),s=parseFloat(r.replace(t[0],""));switch(t[0][0]){case"+":return i+s+n;case"-":return i-s+n;case"*":return i*s+n}}function w0(r,e){if(qe.col(r))return b2(r);if(/\s/g.test(r))return r;var t=Gr(r),n=t?r.substr(0,r.length-t.length):r;return e?n+e:n}function Dm(r,e){return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function M2(r){return Math.PI*2*gr(r,"r")}function A2(r){return gr(r,"width")*2+gr(r,"height")*2}function _2(r){return Dm({x:gr(r,"x1"),y:gr(r,"y1")},{x:gr(r,"x2"),y:gr(r,"y2")})}function S0(r){for(var e=r.points,t=0,n,i=0;i0&&(t+=Dm(n,s)),n=s}return t}function T2(r){var e=r.points;return S0(r)+Dm(e.getItem(e.numberOfItems-1),e.getItem(0))}function M0(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return M2(r);case"rect":return A2(r);case"line":return _2(r);case"polyline":return S0(r);case"polygon":return T2(r)}}function E2(r){var e=M0(r);return r.setAttribute("stroke-dasharray",e),e}function N2(r){for(var e=r.parentNode;qe.svg(e)&&qe.svg(e.parentNode);)e=e.parentNode;return e}function A0(r,e){var t=e||{},n=t.el||N2(r),i=n.getBoundingClientRect(),s=gr(n,"viewBox"),o=i.width,a=i.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:a/l[3]}}function C2(r,e){var t=qe.str(r)?y0(r)[0]:r,n=e||100;return function(i){return{property:i,el:t,svg:A0(t),totalLength:M0(t)*(n/100)}}}function L2(r,e){function t(a){a===void 0&&(a=0);var l=e+a>=1?e+a:0;return r.el.getPointAtLength(l)}var n=A0(r.el,r.svg),i=t(),s=t(-1),o=t(1);switch(r.property){case"x":return(i.x-n.x)*n.w;case"y":return(i.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function _0(r,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=w0(qe.pth(r)?r.totalLength:r,e)+"";return{original:n,numbers:n.match(t)?n.match(t).map(Number):[0],strings:qe.str(r)||e?n.split(t):[]}}function T0(r){var e=r?Xh(qe.arr(r)?r.map(v0):v0(r)):[];return Jh(e,function(t,n,i){return i.indexOf(t)===n})}function E0(r){var e=T0(r);return e.map(function(t,n){return{target:t,id:n,total:e.length,transforms:{list:b0(t)}}})}function I2(r,e){var t=Tm(e);if(/^spring/.test(t.easing)&&(t.duration=m0(t.easing)),qe.arr(r)){var n=r.length,i=n===2&&!qe.obj(r[0]);i?r={value:r}:qe.fnc(e.duration)||(t.duration=e.duration/n)}var s=qe.arr(r)?r:[r];return s.map(function(o,a){var l=qe.obj(o)&&!qe.pth(o)?o:{value:o};return qe.und(l.delay)&&(l.delay=a?0:e.delay),qe.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return qh(o,t)})}function P2(r){for(var e=Jh(Xh(r.map(function(s){return Object.keys(s)})),function(s){return qe.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},n=function(s){var o=e[s];t[o]=r.map(function(a){var l={};for(var c in a)qe.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},i=0;i-1&&(li.splice(o,1),n=li.length)}i++}r()}else Yh=cancelAnimationFrame(Yh)}return r}();function U2(){document.hidden?(li.forEach(function(r){return r.pause()}),P0=li.slice(0),un.running=li=[]):P0.forEach(function(r){return r.play()})}typeof document!="undefined"&&document.addEventListener("visibilitychange",U2);function un(r){r===void 0&&(r={});var e=0,t=0,n=0,i,s=0,o=null;function a(x){var b=window.Promise&&new Promise(function(w){return o=w});return x.finished=b,b}var l=z2(r),c=a(l);function u(){var x=l.direction;x!=="alternate"&&(l.direction=x!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,i.forEach(function(b){return b.reversed=l.reversed})}function h(x){return l.reversed?l.duration-x:x}function d(){e=0,t=h(l.currentTime)*(1/un.speed)}function f(x,b){b&&b.seek(x-b.timelineOffset)}function p(x){if(l.reversePlayback)for(var w=s;w--;)f(x,i[w]);else for(var b=0;b2||(W=Math.round(W*G)/G)),B.push(W)}var K=R.length;if(!K)ne=B[0];else{ne=R[0];for(var q=0;q0&&(l.began=!0,v("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,v("loopBegin")),S<=w&&l.currentTime!==0&&m(0),(S>=_&&l.currentTime!==b||!b)&&m(b),S>w&&S<_?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,v("changeBegin")),v("change"),m(S)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,v("changeComplete")),l.currentTime=mr(S,0,b),l.began&&v("update"),x>=b&&(t=0,g(),l.remaining?(e=n,v("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,v("loopComplete"),v("complete"),!l.passThrough&&"Promise"in window&&(o(),c=a(l)))))}return l.reset=function(){var x=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=x==="reverse",l.remaining=l.loop,i=l.children,s=i.length;for(var b=s;b--;)l.children[b].reset();(l.reversed&&l.loop!==!0||x==="alternate"&&l.loop===1)&&l.remaining++,m(l.reversed?l.duration:0)},l.set=function(x,b){return C0(x,b),l},l.tick=function(x){n=x,e||(e=n),y((n+(t-e))*un.speed)},l.seek=function(x){y(h(x))},l.pause=function(){l.paused=!0,d()},l.play=function(){!l.paused||(l.completed&&l.reset(),l.paused=!1,li.push(l),d(),Yh||G2())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.reset(),l.autoplay&&l.play(),l}function D0(r,e){for(var t=e.length;t--;)_m(r,e[t].animatable.target)&&e.splice(t,1)}function k2(r){for(var e=T0(r),t=li.length;t--;){var n=li[t],i=n.animations,s=n.children;D0(e,i);for(var o=s.length;o--;){var a=s[o],l=a.animations;D0(e,l),!l.length&&!a.children.length&&s.splice(o,1)}!i.length&&!s.length&&n.pause()}}function V2(r,e){e===void 0&&(e={});var t=e.direction||"normal",n=e.easing?Am(e.easing):null,i=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",u=qe.arr(r),h=parseFloat(u?r[0]:r),d=u?parseFloat(r[1]):0,f=Gr(u?r[1]:r)||0,p=e.start||0+(u?h:0),m=[],v=0;return function(g,y,x){if(a&&(o=0),l&&(o=(x-1)/2),c&&(o=x-1),!m.length){for(var b=0;b-1&&li.splice(i,1);function o(d){d.passThrough=!0}for(var a=0;aa.id===e.id);o==null||o.copy(e)}pushMaterialLayer(e){if(this.i.states.length===0||ai(this.i.object)===!1)return;let t=this.i.object;if(t.material instanceof Array){let n=t.selectedMaterial;if(n!==void 0)for(let i=0,s=this.i.states.length;i{let l=a.count,c=new we,u=new Float32Array(l*3),h=new Float32Array(l*3),d=new Float32Array(l*2);for(let f=0;f255?32:i}return e.buffer}function Y2(r){return Wc(r.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function K2(r,e,t){let n={min:new Array(r.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(r.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i4?o=r.array[i*r.itemSize+s]:s===0?o=r.getX(i):s===1?o=r.getY(i):s===2?o=r.getZ(i):s===3&&(o=r.getW(i)),n.min[s]=Math.min(n.min[s],o),n.max[s]=Math.max(n.max[s],o)}return n}function z0(r){return Math.ceil(r/4)*4}function Bm(r,e=0){let t=z0(r.byteLength);if(t!==r.byteLength){let n=new Uint8Array(t);if(n.set(new Uint8Array(r)),e!==0)for(let i=r.byteLength;i0&&(this.options.trs=!0),this.processInput(e);let i=this;Promise.all(this.pending).then(function(){let s=i.buffers,o=i.json,a=i.options,l=i.extensionsUsed,c=new Blob(s,{type:"application/octet-stream"}),u=Object.keys(l);if(u.length>0&&(o.extensionsUsed=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=c.size),a.binary===!0){let h=new window.FileReader;h.readAsArrayBuffer(c),h.onloadend=function(){let d=Bm(h.result),f=new DataView(new ArrayBuffer(F0));f.setUint32(0,d.byteLength,!0),f.setUint32(4,X2,!0);let p=Bm(q2(JSON.stringify(o)),32),m=new DataView(new ArrayBuffer(F0));m.setUint32(0,p.byteLength,!0),m.setUint32(4,J2,!0);let v=new ArrayBuffer(O0),g=new DataView(v);g.setUint32(0,j2,!0),g.setUint32(4,W2,!0);let y=O0+m.byteLength+p.byteLength+f.byteLength+d.byteLength;g.setUint32(8,y,!0);let x=new Blob([v,m,p,f,d],{type:"application/octet-stream"}),b=new window.FileReader;b.readAsArrayBuffer(x),b.onloadend=function(){t(b.result)}}}else if(o.buffers&&o.buffers.length>0){let h=new window.FileReader;h.readAsDataURL(c),h.onloadend=function(){let d=h.result;o.buffers[0].uri=d,t(o)}}else t(o)})}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,i=this.extensionsUsed;try{let s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(let o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],i[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new M;for(let i=0,s=e.count;i5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),i=new M;for(let s=0,o=n.count;s4?m=e.array[f*e.itemSize+p]:p===0?m=e.getX(f):p===1?m=e.getY(f):p===2?m=e.getZ(f):p===3&&(m=e.getW(f)),t===Et.FLOAT?c.setFloat32(u,m,!0):t===Et.UNSIGNED_INT?c.setUint32(u,m,!0):t===Et.UNSIGNED_SHORT?c.setUint16(u,m,!0):t===Et.UNSIGNED_BYTE&&c.setUint8(u,m),u+=a}let h={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(h.target=s),s===Et.ARRAY_BUFFER&&(h.byteStride=e.itemSize*a),this.byteOffset+=l,o.bufferViews.push(h),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(i){let s=new window.FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){let o=Bm(s.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,i(n.bufferViews.push(a)-1)}})}processAccessor(e,t,n,i){let s=this.options,o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"},l;if(e.array.constructor===Float32Array)l=Et.FLOAT;else if(e.array.constructor===Uint32Array)l=Et.UNSIGNED_INT;else if(e.array.constructor===Uint16Array)l=Et.UNSIGNED_SHORT;else if(e.array.constructor===Uint8Array)l=Et.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(n===void 0&&(n=0),i===void 0&&(i=e.count),s.truncateDrawRange&&t!==void 0&&t.index===null){let f=n+i,p=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),i=Math.min(f,p)-n,i<0&&(i=0)}if(i===0)return null;let c=K2(e,n,i),u;t!==void 0&&(u=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);let h=this.processBufferView(e,l,n,i,u),d={bufferView:h.id,byteOffset:h.byteOffset,componentType:l,count:i,max:c.max,min:c.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,t,n){let i=this,s=i.cache,o=i.json,a=i.options,l=i.pending;s.images.has(e)||s.images.set(e,{});let c=s.images.get(e),u=t===zt?"image/png":"image/jpeg",h=u+":flipY/"+n.toString();if(c[h]!==void 0)return c[h];o.images||(o.images=[]);let d={mimeType:u};if(a.embedImages){let p=G0=G0||document.createElement("canvas");p.width=Math.min(e.width,a.maxTextureSize),p.height=Math.min(e.height,a.maxTextureSize);let m=p.getContext("2d");if(n===!0&&(m.translate(0,p.height),m.scale(1,-1)),typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)m.drawImage(e,0,0,p.width,p.height);else{t!==zt&&t!==Nt&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let v=new Uint8ClampedArray(e.height*e.width*4);if(t===zt)for(let g=0;g1&&(a.multiplyScalar(1/l),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),l>0&&(i.emissiveFactor=a.toArray()),e.emissiveMap){let c={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(c,e.emissiveMap),i.emissiveTexture=c}}if(e.normalMap){let a={index:this.processTexture(e.normalMap)};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){let a={index:this.processTexture(e.aoMap),texCoord:1};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Xt&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});let o=n.materials.push(i)-1;return t.materials.set(e,o),o}processMesh(e){let t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,b=e.material.length;x0){let x=[],b=[],w={};if(e.morphTargetDictionary!==void 0)for(let _ in e.morphTargetDictionary)w[e.morphTargetDictionary[_]]=_;for(let _=0;_0&&(l.extras={},l.extras.targetNames=b)}let m=Array.isArray(e.material);if(m&&o.groups.length===0)return null;let v=m?e.material:[e.material],g=m?o.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,b=g.length;x0&&(w.targets=h),o.index!==null){let S=this.getUID(o.index);(g[x].start!==void 0||g[x].count!==void 0)&&(S+=":"+g[x].start+":"+g[x].count),t.attributes.has(S)?w.indices=t.attributes.get(S):(w.indices=this.processAccessor(o.index,o,g[x].start,g[x].count),t.attributes.set(S,w.indices)),w.indices===null&&delete w.indices}let _=this.processMaterial(v[g[x].materialIndex]);_!==null&&(w.material=_),u.push(w)}l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});let y=n.meshes.push(l)-1;return t.meshes.set(s,y),y}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){let n=this.json,i=this.nodeMap;n.animations||(n.animations=[]),e=jc.Utils.mergeMorphTargetTracks(e.clone(),t);let s=e.tracks,o=[],a=[];for(let l=0;l0){let a=[];for(let l=0,c=e.children.length;l0&&(s.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,s)});let o=t.nodes.push(s)-1;return i.set(e,o),o}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);let s=[];for(let o=0,a=e.children.length;o0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){let t=new An;t.name="AuxScene";for(let n=0;n0&&this.processObjects(n);for(let i=0;i0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);let a=i.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}},V0=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},H0=class{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;let n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);let o=[1,1,1];if(e.specular.toArray(o,0),s.specularFactor=o,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){let a={index:n.processTexture(e.specularMap)};n.applyTextureTransform(a,e.specularMap),s.specularGlossinessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},j0=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){let o={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}},W0=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.thickness===0)return;let n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){let o={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationTint.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}};jc.Utils={insertKeyframe:function(r,e){let t=.001,n=r.getValueSize(),i=new r.TimeBufferType(r.times.length+1),s=new r.ValueBufferType(r.values.length+n),o=r.createInterpolant(new r.ValueBufferType(n)),a;if(r.times.length===0){i[0]=e;for(let l=0;lr.times[r.times.length-1]){if(Math.abs(r.times[r.times.length-1]-e)e){i.set(r.times.slice(0,l+1),0),i[l+1]=e,i.set(r.times.slice(l+1),l+2),s.set(r.values.slice(0,(l+1)*n),0),s.set(o.evaluate(e),(l+1)*n),s.set(r.values.slice((l+1)*n),(l+2)*n),a=l+1;break}}return r.times=i,r.values=s,a},mergeMorphTargetTracks:function(r,e){let t=[],n={},i=r.tracks;for(let s=0;sl.arrayBuffer())]),o=new r,a=await i({wasmBinary:s});return o.registerExtensions(e).registerDependencies({"draco3d.encoder":a}),Kh=o,Qh=t,Zh=n({tolerance:1e-4}),{gltfTransform:Kh,DracoMeshCompressionExtension:Qh,addIndex:Zh}}var vS=Cg(Y0());var rI=typeof global=="object"&&global&&global.Object===Object&&global,ed=rI;var sI=typeof self=="object"&&self&&self.Object===Object&&self,oI=ed||sI||Function("return this")(),en=oI;var aI=en.Symbol,Zn=aI;var K0=Object.prototype,lI=K0.hasOwnProperty,cI=K0.toString,Jc=Zn?Zn.toStringTag:void 0;function uI(r){var e=lI.call(r,Jc),t=r[Jc];try{r[Jc]=void 0;var n=!0}catch(s){}var i=cI.call(r);return n&&(e?r[Jc]=t:delete r[Jc]),i}var Q0=uI;var hI=Object.prototype,dI=hI.toString;function fI(r){return dI.call(r)}var Z0=fI;var pI="[object Null]",mI="[object Undefined]",$0=Zn?Zn.toStringTag:void 0;function gI(r){return r==null?r===void 0?mI:pI:$0&&$0 in Object(r)?Q0(r):Z0(r)}var er=gI;function yI(r){return r!=null&&typeof r=="object"}var $n=yI;var vI="[object Symbol]";function xI(r){return typeof r=="symbol"||$n(r)&&er(r)==vI}var tr=xI;function bI(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t-1&&r%1==0&&r-1&&r%1==0&&r<=pP}var ll=mP;function gP(r){return r!=null&&ll(r.length)&&!nd(r)}var Ss=gP;var yP=Object.prototype;function vP(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||yP;return r===t}var cl=vP;function xP(r,e){for(var t=-1,n=Array(r);++t-1}var Ob=GD;function UD(r,e){var t=this.__data__,n=As(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Fb=UD;function fl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++ea))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var h=-1,d=!0,f=t&rO?new zw:void 0;for(s.set(r,e),s.set(e,r);++h=e||S<0||h&&A>=s}function g(){var _=Nd();if(v(_))return y(_);a=setTimeout(g,m(_))}function y(_){return a=void 0,d&&n?f(_):(n=i=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,n=l=i=a=void 0}function b(){return a===void 0?o:y(Nd())}function w(){var _=Nd(),S=v(_);if(n=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(g,e),f(l)}return a===void 0&&(a=setTimeout(g,e)),o}return w.cancel=x,w.flush=b,w}var Wm=t3;function n3(r,e){var t=-1,n=Ss(r)?Array(r.length):[];return dS(r,function(i,s,o){n[++t]=e(i,s,o)}),n}var fS=n3;function i3(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var pS=i3;function r3(r,e){if(r!==e){var t=r!==void 0,n=r===null,i=r===r,s=tr(r),o=e!==void 0,a=e===null,l=e===e,c=tr(e);if(!a&&!c&&!s&&r>e||s&&o&&l&&!a&&!c||n&&o&&l||!t&&l||!i)return 1;if(!n&&!s&&!c&&r=a)return l;var c=t[n];return l*(c=="desc"?-1:1)}}return r.index-e.index}var gS=s3;function o3(r,e,t){e.length?e=ol(e,function(s){return Jt(s)?function(o){return ml(o,s.length===1?s[0]:s)}:s}):e=[td];var n=-1;e=ol(e,Ms(aS));var i=fS(r,function(s,o,a){var l=ol(e,function(c){return c(s)});return{criteria:l,index:++n,value:s}});return pS(i,function(s,o){return gS(s,o,t)})}var yS=o3;function a3(r,e,t,n){return r==null?[]:(Jt(e)||(e=e==null?[]:[e]),t=n?void 0:t,Jt(t)||(t=t==null?[]:[t]),yS(r,e,t))}var Jm=a3;var Cd={isPublish:!1,gltfQueue:[]};function Yc(r,e,t){return r[e.uuid]===void 0&&(r[e.uuid]=e.toJSON(t)),e.uuid}var l3=new jc;function xS(r,e,t){if(r[e.uuid]===void 0)if(e.userData.type==="NonParametricGeometry"||e.userData.type==="SubdivGeometry"){if(e.userData.type==="SubdivGeometry")if(Cd.isPublish)e=Lo.create({geometry:e.clone()}),e.userData.parameters.subdivisions===0&&(delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.positionWASM,delete e.attributes.indexWASM,delete e.attributes.verticesPerFaceWASM);else{let i=e.originalGeometry;if(i){let s=e.userData;e=i.clone(),e.userData=s}else e=e.clone();delete e.attributes.color,delete e.attributes.faceMap,delete e.attributes.position,delete e.attributes.normal,e.index=null}let n=e.originalGeometry;if(n!==void 0){let i=e.userData;e=n,e.userData=i}if(!Cd.isPublish)r[e.uuid]=e.toJSON();else{let i={type:"NonParametricGeometry",uuid:e.uuid,userData:{}};e.name!==""&&(i.name=e.name),Object.keys(e.userData).length>0&&(i.userData=Ue({},e.userData));let s=e.index===null,o=new Jn;if(Array.isArray(t))R0(e).forEach((l,c)=>{let u=new gt(l,new Xi);o.add(u),l.userData.groupIndex=c,l.userData.materialIndex=e.groups[c].materialIndex,l.index===null&&(s=!0)});else{let a=new gt(e,new Xi);o.add(a)}Cd.gltfQueue.push(new Promise(async a=>{await Promise.all(Cd.gltfQueue),l3.parse(o,async l=>{let{gltfTransform:c,DracoMeshCompressionExtension:u,addIndex:h}=await J0(),d=c.readJSON({json:Hm(l),resources:{}});d.createExtension(u).setRequired(!0).setEncoderOptions({quantizationVolume:"scene"}),s&&await d.transform(h);try{let{json:f,resources:p}=c.writeJSON(d),m=vS.default.fromByteArray(new Uint8Array(p[".bin"]));f.buffers[0].uri=`data:application/octet-stream;base64,${m}`,i.gltf=f,a()}catch(f){i.gltf=l,a()}},{})})),r[e.uuid]=i}}else{let n=e.userData;if(n.type==="VectorGeometry"){let i=e.userData.shape;n=Object.assign({},n,{shape:i.toJSON()})}r[e.uuid]={uuid:e.uuid,userData:n}}return e.uuid}function bl(r){let e=[];for(let t in r){let n=r[t];delete n.metadata,e.push(n)}return e}function bS(r){let e=[];for(let t in r)e.push(r[t]);return e}var Is=class{constructor(e){this.object=e;this.uuid=Ee.generateUUID();this.states=[];this.events=[];this._interpolateMaterialBetweenValues=(e,t,n,i=t.getNames())=>{var s,o,a,l,c;for(let u=0,h=i.length;u{var c,u,h;let i=e.layersList;if(t.backLayer===void 0){let d=n.getValues();d.alpha=0,t.backLayer=i.addLayerBeforeAt(d,t),t.backLayer.isBack=!0,e.dispose()}let s=`f${t.id}_alpha`,o=`f${(c=t.backLayer)==null?void 0:c.id}_alpha`,a=t.uniforms[s],l=(u=t.backLayer)==null?void 0:u.uniforms[o];(h=this._animation)==null||h.add({targets:a,value:0},0).add({targets:l,value:n.uniforms[`f${n.id}_alpha`].value},0)};this._interpolateMaterialTexture=(e,t,n)=>{var d;let i=`f${t.id}_texture`,s=t.uniforms[i].value,o=n.uniforms[`f${n.id}_texture`].value,a=t.uniforms[`f${t.id}_crop`],l=n.uniforms[`f${n.id}_crop`];a&&l&&a.value!==l.value&&(a.value=Number(l.value)),(s.wrapS!==o.wrapS||s.wrapT!==o.wrapT)&&(s.wrapS=o.wrapS,s.wrapT=o.wrapT,s.needsUpdate=!0);let c=s.matrix,u=o.matrix;if(c.equals(u)===!1){let f={repeatX:s.repeat.x,repeatY:s.repeat.y,offsetX:s.offset.x,offsetY:s.offset.y};(d=this._animation)==null||d.add({targets:f,repeatX:o.repeat.x,repeatY:o.repeat.y,offsetX:o.offset.x,offsetY:o.offset.y,update:()=>{s.repeat.set(f.repeatX,f.repeatY),s.offset.set(f.offsetX,f.offsetY),s.updateMatrix(),s.needsUpdate=!0}},0)}let h=["alpha","mode"];t.type==="displace_map"&&h.push("intensity"),this._interpolateMaterialBetweenValues(e,t,n,h)};this._interpolateMaterialGradient=(e,t,n)=>{var p;let i=t.uniforms[`f${t.id}_num`],s=n.uniforms[`f${n.id}_num`],o=`f${t.id}_steps`,a=`f${n.id}_steps`,l=t.uniforms[o],c=n.uniforms[a],u=`f${t.id}_colors`,h=`f${n.id}_colors`,d=t.uniforms[u],f=n.uniforms[h];if(i.value<=s.value){let m=d.value[i.value-1];for(let v=Number(i.value);v{l.value[v]=x.value}},0)}}}else{let m=[];for(let g=0;g{var _;(_=this._animation)==null||_.add({targets:[b,y],value:c.value[g],x:x.x,y:x.y,z:x.z,w:x.w,update:()=>{l.value[g]=b.value},complete:()=>{w(g)}},0)}))}}let v=f.value[s.value-1];for(let g=Number(s.value);g{var w;let b={value:l.value[g]};(w=this._animation)==null||w.add({targets:[b,y],value:1,x:v.x,y:v.y,z:v.z,w:v.w,update:()=>{l.value[g]=b.value},complete:()=>{x(g)}},0)}))}Promise.all(m).then(()=>{i.value=Number(s.value)},()=>{})}this._interpolateMaterialBetweenValues(e,t,n,["alpha","mode","gl_type","smooth","offset","morph","angle"])};this.statesManager=new Rm(this)}static get isAllAnimationsEnded(){let e;for(let t in Is.isAnimating){if(Is.isAnimating[t])return!1;e=!0}return e}computeCache(){return this.cache={mouseDown:this.events.find(e=>e.type===Ze.MOUSE_DOWN),mouseUp:this.events.find(e=>e.type===Ze.MOUSE_UP),mouseHover:this.events.find(e=>e.type===Ze.MOUSE_HOVER),start:this.events.find(e=>e.type===Ze.START),lookAt:this.events.find(e=>e.type===Ze.LOOK_AT),follow:this.events.find(e=>e.type===Ze.FOLLOW),keyDown:this.events.filter(e=>e.type===Ze.KEY_DOWN),keyUp:this.events.filter(e=>e.type===Ze.KEY_UP)},this.cache}newState(e){let t=new bs;return t.name=e,t.update(this.object),this.selectedState=this.states.length,this.states.push(t),t}addState(e,t){this.states.splice(t,0,e)}removeState(e){this.selectedState===e&&(this.selectedState=void 0),this.states.splice(e,1)}selectState(e){e!==void 0&&this.states[e].execute(this.object),this.selectedState=e}hasEventType(e,t){return e===Ze.KEY_DOWN||e===Ze.KEY_UP?t===void 0?!1:this.events.some(n=>n.type===e&&n.key===t):this.events.some(n=>n.type===e)}newEvent(){let e=[Ze.MOUSE_DOWN,Ze.MOUSE_UP,Ze.MOUSE_HOVER,Ze.KEY_DOWN].find(n=>this.hasEventType(n)===!1),t=new sl(e);return this.events.push(t),t}addEvent(e,t){this.events.splice(t,0,e);let n=this.events[t].targets;for(let i=0,s=n.length;i0){t.states=[];for(let n=0,i=this.states.length;n0){t.events=[];for(let n=0,i=this.events.length;n1?(this.states[0].execute(this.object),this._currentState=this.states[0],this._prevState=void 0):this._state0!==void 0?this._state0.execute(this.object):this.events.some(e=>e.type===Ze.LOOK_AT||e.type===Ze.FOLLOW)&&(this._state0=new bs,this._state0.update(this.object))}end(){var e;this._animation!==void 0&&(this._animation.pause(),this._animation=void 0,this._removeBackLayer()),this.states.length>1?this.states[(e=this.selectedState)!=null?e:0].execute(this.object):this._state0!==void 0&&(this._state0.execute(this.object),this._state0=void 0),this._currentState=void 0,this._prevState=void 0}lookAt(e){var t;this.object.lookAt(e),(t=this._animation)==null||t.finished.then(()=>{this.lookAt(e)})}follow(e){this.object.position.copy(e),this.object.parent!==null&&this.object.position.applyMatrix4(new me().copy(this.object.parent.matrixWorld).invert()),this.object.position.applyMatrix4(new me().copy(this.object.hiddenMatrix).invert())}play(e){this.object.visible&&e.state!==void 0&&this.animate(e.state,e)}reverse(e){this.object.visible&&this._prevState!==void 0&&this.animate(this._prevState,e)}_removeBackLayer(){if("material"in this.object){let e=this.object.material;if(e instanceof Array)for(let t=0,n=e.length;t{this._removeBackLayer(),this._animation=void 0,Is.isAnimating[e.uuid]=!1}),this.animateMatrix(e),this.animateGeometry(e),this.animateMaterial(e),this.animateCamera(e)}animateMatrix(e){var s,o,a,l;if(this.object.position.equals(e.position)===!1){let c=this.object.position.clone(),u={t:0};(s=this._animation)==null||s.add({targets:u,t:1,update:()=>{this.object.position.lerpVectors(c,e.position,u.t)}},0)}if(this.object.scale.equals(e.scale)===!1){let c=this.object.scale.clone(),u={t:0};(o=this._animation)==null||o.add({targets:u,t:1,update:()=>{this.object.scale.lerpVectors(c,e.scale,u.t)}},0)}if(this.object.rotation.equals(e.rotation)===!1){let c=this.object.quaternion.clone(),u={t:0},h={x:this.object.rotation.x-e.rotation.x,y:this.object.rotation.y-e.rotation.y,z:this.object.rotation.z-e.rotation.z},d=e.rotation.clone(),f=.01*Ee.DEG2RAD,p=359.99*Ee.DEG2RAD;h.x===Math.PI*2?d.x===0?d.x=f:d.x===Math.PI*2&&(d.x=p):h.x===-Math.PI*2&&(d.x===0?d.x=-f:d.x===Math.PI*2&&(d.x=-p)),h.y===Math.PI*2?d.y===0?d.y=f:d.y===Math.PI*2&&(d.y=p):h.y===-Math.PI*2&&(d.y===0?d.y=-f:d.y===Math.PI*2&&(d.y=-p)),h.z===Math.PI*2?d.z===0?d.z=f:d.z===Math.PI*2&&(d.z=p):h.z===-Math.PI*2&&(d.z===0?d.z=-f:d.z===Math.PI*2&&(d.z=-p));let m=new Tt().setFromEuler(d);(a=this._animation)==null||a.add({targets:u,t:1,update:()=>{wm(c,m,this.object.quaternion,u.t)}},0)}let t=new M,n=new Tt,i=new M;if(e.hiddenMatrix.decompose(t,n,i),"hiddenMatrix"in this.object){let c=new M,u=new Tt,h=new M;if(this.object.hiddenMatrix.decompose(c,u,h),this.object.hiddenMatrix.equals(e.hiddenMatrix)===!1){let d=new M,f=new Tt,p=new M,m={t:0},v=this.object.hiddenMatrix;(l=this._animation)==null||l.add({targets:m,t:1,update:()=>{f.slerpQuaternions(u,n,m.t),d.lerpVectors(c,t,m.t),p.lerpVectors(h,i,m.t),v.compose(d,f,p)}},0)}}}animateGeometry(e){var t;if("geometry"in this.object&&e.geometry!==void 0){let i=this.object.geometry.userData.parameters,s=e.geometry;if(s.width!==i.width||s.height!==i.height||s.depth!==i.depth){let o=this.object;(t=this._animation)==null||t.add({targets:i,width:s.width,height:s.height,depth:s.depth,update:()=>{o.updateGeometry({parameters:{width:i.width,height:i.height,depth:i.depth}})}},0)}}}animateMaterial(e){if("material"in this.object)if(this.object.material instanceof Array)for(let t=0,n=this.object.material.length;t{i.updateProjectionMatrix()}},0)),i.targetOffset!==e.camera.targetOffset&&((n=this._animation)==null||n.add({targets:i,targetOffset:e.camera.targetOffset},0))}}},Ls=Is;Ls.isAnimating={};var Ld=r=>class extends r{hasEntityChild(){return this.children.some(t=>Vh(t))}attach(t,n){this.updateWorldMatrix(!0,!1);let i=new me().copy(this.matrixWorld).invert();return t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),Vh(t)?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),n!==void 0&&(this.children.pop(),this.children.splice(n,0,t)),this}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),n===!0)for(let i=0;i0){s.children=[];for(let o of this.children)(Vh(o)||o instanceof vi)&&s.children.push(o.toJSON(t).object)}if(n){let o=bl(t.geometries),a=bl(t.materials),l=bl(t.textures),c=bl(t.images),u=bl(t.interactionStates),h=bS(t.nodes);o.length>0&&(i.geometries=o),a.length>0&&(i.materials=a),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),u.length>0&&(i.interactionStates=u),h.length>0&&(i.nodes=h)}return i.object=s,i}fromJSON(t){return this.uuid=t.uuid,t.name!==void 0&&(this.name=t.name),t.matrix!==void 0?(this.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(this.matrixAutoUpdate=t.matrixAutoUpdate),this.matrixAutoUpdate&&this.matrix.decompose(this.position,this.quaternion,this.scale)):(t.position!==void 0&&this.position.fromArray(t.position),t.rotation!==void 0&&this.rotation.fromArray(t.rotation),t.quaternion!==void 0&&this.quaternion.fromArray(t.quaternion),t.scale!==void 0&&this.scale.fromArray(t.scale)),this.castShadow=t.castShadow!==void 0,this.receiveShadow=t.receiveShadow!==void 0,t.visible!==void 0&&(this.visible=t.visible),t.frustumCulled!==void 0&&(this.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(this.renderOrder=t.renderOrder),t.layers!==void 0&&(this.layers.mask=t.layers),t.userData!==void 0&&(this.userData=t.userData),this}};var ei=r=>"isEntity"in r,wS=r=>"isAbstractMesh"in r,Xm=r=>"objectHelper"in r,Ii=r=>class extends Ld(r){constructor(){super(...arguments);this.objectType="";this.isEntity=!0;this.raycastLock=!1;this.scaleLock=!1;this.hiddenMatrix=new me;this.interaction=new Ls(this);this.forceComputeSize=!1}set visibility(t){this.visible=t;for(let n of this.children)ei(n)&&n.traverseEntity(i=>{Xm(i)&&i.visible&&(i.objectHelper.visible=t)})}get visibility(){return this.visible}get interactionCache(){return this.interaction.cache===void 0&&this.interaction.computeCache(),this.interaction.cache}traverseEntity(t){t(this);for(let n of this.children)ei(n)&&n.traverseEntity(t)}computeSingleBoundingBox(){this.singleBoundingBox||(this.singleBoundingBox=new jh),this.singleBoundingBox.setFromObjectSize(this,!1),this.singleBoundingBox.computeVertices(),this.singleBoundingBox.computeEdges(),this.singleBoundingBox.computeFaces()}computeComplexBoundingBox(t){this.complexBoundingBox||(this.complexBoundingBox=new jh),this.complexBoundingBox.setFromObjectSize(this,t),this.complexBoundingBox.computeVertices(),this.complexBoundingBox.computeEdges(),this.complexBoundingBox.computeFaces()}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);for(let n of this.children)n.updateMatrixWorld(t)}updateWorldMatrix(t,n){let i=this.parent;if(t&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),n)for(let s of this.children)s.updateWorldMatrix(!1,!0)}shallowClone(t){return new this.constructor().shallowCopy(this,t)}shallowCopy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.shallowClone());return this}clone(t){return new this.constructor().copy(this,t)}copy(t,n=!0){if(super.copy(t,!1),this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),t.interaction!==void 0&&this.interaction.copy(t.interaction),n===!0)for(let i of t.children)ei(i)&&this.add(i.clone());return this}keepChildrenMatrixWorld(){let t=new me,n=this.matrixWorld.clone();this.updateWorldMatrix(!1,!1),t.copy(this.matrixWorld).invert(),t.multiply(n);for(let i of this.children)ei(i)&&i.hiddenMatrix.premultiply(t)}toJSON(t){let n=super.toJSON(t),i=n.object;return this.raycastLock===!0&&(i.raycastLock=!0),this.scaleLock===!0&&(i.scaleLock=!0),i.hiddenMatrix=this.hiddenMatrix.toArray(),this.interaction!==void 0&&(i.interaction=this.interaction.toJSON(t)),n}fromJSON(t){return super.fromJSON(t),t.raycastLock!==void 0&&(this.raycastLock=t.raycastLock),t.scaleLock!==void 0&&(this.scaleLock=t.scaleLock),this.hiddenMatrix.fromArray(t.hiddenMatrix),this}fromObject3D(t){let n=t.children;return t.children=[],Object.assign(t,{raycastLock:!1,scaleLock:!1,hiddenMatrix:new me}),this.copy(t),t.children=n,this}};var Id=class extends Ke{constructor(e,t={}){super();this.object=e,e.computeComplexBoundingBox(!0);let n=e.complexBoundingBox.getSize(new M),i=.1;this.parameters={type:t.type!==void 0?t.type:"radial",hideBase:t.hideBase!==void 0?t.hideBase:!1,count:t.count!==void 0?t.count:3,ra_radius:t.ra_radius!==void 0?t.ra_radius:Math.max(n.x,n.y)*2,ra_startAngle:t.ra_startAngle!==void 0?t.ra_startAngle:0,ra_endAngle:t.ra_endAngle!==void 0?t.ra_endAngle:360,ra_align:t.ra_align!==void 0?t.ra_align:!1,ra_axis:t.ra_axis!==void 0?t.ra_axis:"y",ra_scale:t.ra_scale!==void 0?t.ra_scale.clone():new M,ra_rotation:t.ra_rotation!==void 0?t.ra_rotation.clone():new On,ra_position:t.ra_position!==void 0?t.ra_position.clone():new M,li_scale:t.li_scale!==void 0?t.li_scale.clone():new M,li_rotation:t.li_rotation!==void 0?t.li_rotation.clone():new On,li_position:t.li_position!==void 0?t.li_position.clone():new M(n.x+n.x*i,0,0).round(),gr_count:t.gr_count!==void 0?t.gr_count.clone():new M(2,2,2),gr_size:t.gr_size!==void 0?t.gr_size.clone():new M(n.x+n.x*i,n.y+n.y*i,n.z+n.z*i).round(),gr_fromCenter:t.gr_fromCenter!==void 0?t.gr_fromCenter:!0},this.update(),this.setHideBase(this.parameters.hideBase)}refreshMaterial(){if("material"in this.object)for(let e of this.children)e.material=this.object.material}setHideBase(e){if("material"in this.object){if(Array.isArray(this.object.material)){if(this.children.length>0){for(let t of this.object.material)t.visible=!0;if(e){let t=this.object.material.map(n=>n.clone());for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material}for(let t of this.object.material)t.visible=!e}else{if(this.children.length>0)if(this.object.material.visible=!0,e){let t=this.object.material.clone();for(let n of this.children)n.material=t}else for(let t of this.children)t.material=this.object.material;this.object.material.visible=!e}this.parameters.hideBase=e}}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters)}}_updateCount(){let e=this.parameters.type==="grid"?this.parameters.gr_count.x*this.parameters.gr_count.y*this.parameters.gr_count.z:this.parameters.count;if(this.children.length!==e)if(this.children.lengths.clone()):this.material.clone();return new this.constructor(n,i).copy(this,e)}copy(e,t=!0){return super.copy(e,t),e.cloner&&(this.cloner=new Id(e,e.cloner.parameters),this.add(this.cloner)),this}toJSON(e){let t=super.toJSON(e),n=t.object;if(this.cloner!==void 0&&(n.cloner=this.cloner.toJSON()),n.geometry=xS(e.geometries,this.geometry,this.material),Array.isArray(this.material)){let i=[];for(let s=0,o=this.material.length;s{var e;return e=class extends r{constructor(){super(...arguments);this.isObjectHelper=!0}},e.geometryHelper=new jn(30,30,30),e};var qm=new or,Ym=new ti,SS=new me,br=(r,e,t,n)=>{let i=e,s=r.matrixWorld;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ym.copy(i.boundingSphere),Ym.applyMatrix4(s),t.ray.intersectsSphere(Ym)===!1||(SS.copy(s).invert(),qm.copy(t.ray).applyMatrix4(SS),i.boundingBox!==null&&qm.intersectsBox(i.boundingBox)===!1))return;let o,a,l,c,u=i.index,h=i.attributes.position,d=i.drawRange,f,p,m=Math.max(0,d.start),v=Math.min(u.count,d.start+d.count);for(f=m,p=v;fx.far?null:{faceIndex:1,distance:G,point:P.clone(),object:y}}};var Kc=class extends xr(xi){constructor(e){super(e);this.object=e;let t=new Ji(15,4,2),n=new dn({wireframe:!0,fog:!1,toneMapped:!1}),i=new gt(t,n);this.add(i);let s=new Ji(15,4,2),o=new dn({wireframe:!0,fog:!1,toneMapped:!1,depthTest:!1,depthWrite:!1}),a=new gt(s,o);this.add(a),this.targetHelper=a,this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e),this.targetHelper.position.copy(e),this.targetHelper.updateWorldMatrix(!1,!0)}raycast(e,t){br(this.object,Kc.geometryHelper,e,t)}};var Qc=class extends xr(Bp){constructor(e,t=15,n=10066329){super(e,t,n);this.object=e;this.name=`DirectionalLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Qc.geometryHelper,e,t)}};var Zc=class extends xr(Op){constructor(e,t=15){super(t);this.object=e;this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${e.uuid}`,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}raycast(e,t){br(this.object,Zc.geometryHelper,e,t)}update(){}};var $c=class extends xr(Rp){constructor(e,t=15,n=6710886){super(e,t,n);this.object=e;this.name=`PointLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,$c.geometryHelper,e,t)}};var Dd=class extends xr(Pp){constructor(e,t=6710886){super(e,t);this.object=e;this.name=`SpotLightHelper: ${e.uuid}`}raycast(e,t){br(this.object,Dd.geometryHelper,e,t)}update(){if(this.object!==void 0){let e=Dd._vector,t=this.object.distance?this.object.distance:1e3,n=t*Math.tan(this.object.angle);this.cone.scale.set(n,n,t),e.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(e);let i=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let s=0,o=this.cone.material.length;s{if(this.geometry instanceof Rc){if(this.geometry.updateFromShape()){let e=this.geometry.drawCount,t=this.geometry.userData;this.updateGeometry(Object.assign(this.geometry.userData,{parameters:Object.assign(t.parameters,{surfaceMaxCount:e+1e3})}))}}else this.updateGeometry({});this.computeSingleBoundingBox(),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox()};var n;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!0,this.shape=e.userData.shape,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}toJSON(e){let t=super.toJSON(e);return t.object.objectType="VectorObject",t}setHelperVisibility(){}updateGeometry(e){if(super.updateGeometry(e),"userData"in this.geometry){let t=this.geometry.userData.parameters;this.eventDispatcher.dispatchEvent({type:"geometryUpdate",parameters:t})}}setShape(e){var t,n;this.shape&&((t=this.shape.eventDispatcher)==null||t.removeEventListener("update",this._onShapeUpdate)),this.shape=e,(n=this.shape.eventDispatcher)==null||n.addEventListener("update",this._onShapeUpdate)}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),_S.getNormalMatrix(this.matrixWorld),MS.copy(c3).applyMatrix3(_S).normalize(),AS.setFromMatrixPosition(this.matrixWorld),this.shape.plane.setFromNormalAndCoplanarPoint(MS,AS)}clone(e){let t=this.shape.clone(),n=this.material.clone(),i=this.geometry.userData,s=Pn.create(Object.assign({},i,{shape:t})),o=new Ps(s,n).copy(this,e);return o.shape=t,t.update(),o}raycast(e,t){Vn.prototype.raycast.call(this,e,t)}};var wr=(r,e)=>class extends r{constructor(){super(...arguments);this.objectHelper=new e(this);this.enableHelper=!1}set visibility(n){this.visible=n,this.setHelperVisibility(n),this.setHelperChildrenVisibility(n)}get visibility(){return this.visible}get geometryHelper(){return e.geometryHelper}setHelperVisibility(n){this.objectHelper.visible=n}setHelperChildrenVisibility(n){for(let i of this.children)ei(i)&&i.traverseEntity(s=>{Xm(s)&&s.visible&&(s.objectHelper.visible=n)})}raycast(n,i){this.objectHelper.raycast(n,i)}copy(n,i=!0){return super.copy(n,i),n.enableHelper!==void 0&&(this.enableHelper=n.enableHelper),n.objectHelper!==void 0&&(this.objectHelper.visible=n.objectHelper.visible),this}toJSON(n){let i=super.toJSON(n),s=i.object;return s.enableHelper=this.enableHelper,i}fromJSON(n){return super.fromJSON(n),n.enableHelper!==void 0&&(this.enableHelper=!0),this}};var wl=new M,Km=new M,Qm=class extends wr(Ii(Dr),Kc){constructor(e=100,t=100,n=45,i=50,s=5e4){super();this.objectType="CombinedCamera";this._cameraType="OrthographicCamera";this.targetOffset=Qm.DefaultTargetOffset;this.isUpVectorFlipped=!1;this.angleOffsetFromUp=0;this.width=window.innerWidth,this.height=window.innerHeight,this.orthoCamera=new Rr(e*-.5,e*.5,t*.5,t*-.5,i,s),this.perspCamera=new Vt(n,e/t,i,s),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.fov=this.perspCamera.fov,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.toOrthographic(!0)}setDefault(){this.name="Default Camera",this.isEntity=!1,this.enableHelper=!1,this.objectHelper.visible=!1}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set cameraType(e){e==="PerspectiveCamera"?this.toPerspective():e==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(e){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e){super.lookAt(e),this.getWorldPosition(wl),this.targetOffset=wl.distanceTo(e)}getTarget(e=new M){return this.getWorldDirection(Km),this.getWorldPosition(wl),Km.multiplyScalar(this.targetOffset),e.copy(wl).add(Km),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(wl),wl.distanceTo(e)}updateUp(){let e=this.getWorldQuaternion(new Tt),t=new M(0,0,1).applyQuaternion(e),n=new M().copy(Ke.DefaultUp).applyQuaternion(e),i=new M().copy(Ke.DefaultUp).projectOnPlane(t),s=new M().crossVectors(i,n).dot(t)>=0?1:-1;this.angleOffsetFromUp=i.angleTo(n)*s}getViewFrontToObject(e){let t=e.getWorldPosition(new M),i=e.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().add(i),target:t}}getViewToObject(e){let t=e.getWorldPosition(new M),i=this.getWorldDirection(new M).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}setViewplaneSize(e,t){this.left=-e*.5,this.right=e*.5,this.top=t*.5,this.bottom=-t*.5,this.aspect=e/t,this.updateProjectionMatrix()}toOrthographic(e){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}toPerspective(e){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",(this.enableHelper===!0||e===!0)&&this.objectHelper.update()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,n,i,s,o){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(e,t,n,i,s,o):this.orthoCamera.setViewOffset(e,t,n,i,s,o)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}updateProjectionMatrix(e){this._cameraType==="PerspectiveCamera"?this.toPerspective(e):this._cameraType==="OrthographicCamera"&&this.toOrthographic(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=e.view===null?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=e.targetOffset,this.updateProjectionMatrix(),this}fromCameraRender(e){let t={near:this.orthoCamera.near,far:this.orthoCamera.far},n={near:this.perspCamera.near,far:this.perspCamera.far};return this.copy(e),this.name="",this.isEntity=!0,this.enableHelper=!0,this.objectHelper.visible=!0,this.orthoCamera.near=t.near,this.orthoCamera.far=t.far,this.perspCamera.near=n.near,this.perspCamera.far=n.far,this.updateProjectionMatrix(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="CombinedCamera",n.cameraType=this.cameraType,n.targetOffset=this.targetOffset,n.isUpVectorFlipped=this.isUpVectorFlipped,n.angleOffsetFromUp=this.angleOffsetFromUp,n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,this.view!==null&&(n.view=Object.assign({},this.view)),n.zoomOrtho=this.orthoCamera.zoom,n.nearOrtho=this.orthoCamera.near,n.far=this.far,n.aspect=this.aspect,n.fov=this.fov,n.focus=this.focus,n.filmGauge=this.filmGauge,n.filmOffset=this.filmOffset,n.zoomPersp=this.perspCamera.zoom,n.nearPersp=this.perspCamera.near,t}fromJSON(e){var t,n;if(super.fromJSON(e),this.cameraType=e.cameraType,e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset),e.orbitControlsTarget!==void 0){let i=this.getWorldPosition(new M),s=new M().fromArray(e.orbitControlsTarget);this.targetOffset=s.distanceTo(i)}else e.targetOffset!==void 0&&(this.targetOffset=e.targetOffset);return this.isUpVectorFlipped=(t=e.isUpVectorFlipped)!=null?t:!1,this.angleOffsetFromUp=(n=e.angleOffsetFromUp)!=null?n:0,e.left!==void 0&&(this.left=e.left),e.right!==void 0&&(this.right=e.right),e.top!==void 0&&(this.top=e.top),e.bottom!==void 0&&(this.bottom=e.bottom),e.view!==void 0&&(this.view=Object.assign({},e.view)),e.zoomOrtho!==void 0&&(this.orthoCamera.zoom=e.zoomOrtho),e.nearOrtho!==void 0&&(this.orthoCamera.near=e.nearOrtho),e.far!==void 0&&(this.far=e.far),e.aspect!==void 0&&(this.aspect=e.aspect),e.fov!==void 0&&(this.fov=e.fov),e.focus!==void 0&&(this.focus=e.focus),e.filmGauge!==void 0&&(this.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(this.filmOffset=e.filmOffset),e.zoomPersp!==void 0&&(this.perspCamera.zoom=e.zoomPersp),e.nearPersp!==void 0&&(this.perspCamera.near=e.nearPersp),this.updateProjectionMatrix(),this}},Sr=Qm;Sr.DefaultTargetOffset=1e3;var Pi=class extends wr(Ii(Jn),Zc){constructor(){super(...arguments);this.objectType="EmptyObject"}toJSON(e){let t=super.toJSON(e);return t.object.objectType="EmptyObject",t}};var Rd=class extends wr(Ii(Fr),Qc){constructor(...e){super(...e);this.objectType="LightDirectional";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=1,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightDirectional",n.color=this.color.getHex(),n.intensity=this.intensity,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.left=n.left,t.right=n.right,t.top=n.top,t.bottom=n.bottom,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var Bd=class extends wr(Ii(xo),$c){constructor(...e){super(...e);this.objectType="LightPoint";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new tn(i,s),a=new Da(o,new fe(16755200));a.visible=!1,this._gizmos.shadowmap=a,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof Da&&(t.visible=!1)}}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this._gizmos))for(let e in this._gizmos){let t=this._gizmos[e];if(t instanceof Da){let n=this.shadow.camera,i=new M(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new M(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z);t.box.set(i,s),t.updateMatrixWorld(!0)}}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightPoint",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.decay=this.decay,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i,s;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.decay=e.decay,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray((s=e.shadow.mapSize)!=null?s:[512,512]);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var TS=new M,ES=new M,NS=new Tt,Od=class extends wr(Ii(vo),Pd){constructor(...e){super(...e);this.objectType="LightSpot";this._gizmos={};this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024;let n=this.shadow.camera;n.fov=Ee.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let i=new xi(this.shadow.camera);i.visible=!1,this._gizmos.shadowmap=i,this.update()}get gizmos(){return this._gizmos}showGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!0)}}hideGizmos(){for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&(t.visible=!1)}}update(){this.shadow.camera.updateProjectionMatrix();for(let e in this._gizmos){let t=this._gizmos[e];t instanceof xi&&t.update()}}updateMatrixWorld(e){super.updateMatrixWorld(e),ES.setFromMatrixPosition(this.matrixWorld),NS.setFromRotationMatrix(this.matrixWorld),TS.copy(this.up).applyQuaternion(NS).negate().multiplyScalar(this.distance),this.target.position.copy(ES).add(TS),this.target.updateMatrixWorld(),this.enableHelper===!0&&this.objectHelper.visible===!0&&this.objectHelper.update()}copy(e,t=!0){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e),n=t.object;return n.objectType="LightSpot",n.color=this.color.getHex(),n.intensity=this.intensity,n.distance=this.distance,n.angle=this.angle,n.decay=this.decay,n.penumbra=this.penumbra,n.shadow=this.shadow.toJSON(),t}fromJSON(e){var i;super.fromJSON(e),this.color.set(e.color),this.intensity=e.intensity,this.distance=e.distance,this.angle=e.angle,this.decay=e.decay,this.penumbra=e.penumbra,this.shadow.normalBias=(i=e.shadow.normalBias)!=null?i:0,this.shadow.radius=e.shadow.radius,this.shadow.mapSize.fromArray(e.shadow.mapSize);let t=this.shadow.camera,n=e.shadow.camera;return t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.fov=n.fov,t.focus=n.focus,t.aspect=n.aspect,t.filmGauge=n.filmGauge,t.filmOffset=n.filmOffset,n.view!==void 0&&(t.view=Object.assign({},n.view)),this}};var CS=r=>r.tagName==="VIDEO",Sl=class{static resize(e,t,n){let i=e/t,s;if(!n.image)return;let o=n.image;CS(o)?s=o.videoWidth/o.videoHeight:s=o.width/o.height,i>s&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*s/i):n.repeat.set(1,1*s/i)),is?o={x:1,y:s/i}:io&&(n.imageType=="WEBCAM"?n.repeat.set(1/e*-1,1/t*o/s):n.repeat.set(1/e,1/t*o/s)),so&&(n.imageType=="WEBCAM"?n.repeat.set(-1,1*o/s):n.repeat.set(1,1*o/s)),s{let o=()=>{s({error:!0,filename:r.name}),e.itemError(r.name),e.itemEnd(r.name)};switch(n.addEventListener("loadstart",()=>{e.itemStart(r.name)}),n.addEventListener("load",a=>{var c;let l=(c=a.target)==null?void 0:c.result;l!=null?i(l):o()},!1),n.addEventListener("error",o),t){case 0:n.readAsText(r);break;case 2:n.readAsBinaryString!==void 0&&n.readAsBinaryString(r);break;case 1:default:n.readAsArrayBuffer(r)}})}var Zm=class extends fn{constructor(e){super(e);this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new DS(t)}),this.register(function(t){return new zS(t)}),this.register(function(t){return new GS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new US(t)})}load(e,t,n,i){let s=this,o;this.resourcePath!==""?o=this.resourcePath:this.path!==""?o=this.path:o=Ei.extractUrlBase(e),this.manager.itemStart(e);let a=function(c){i?i(c):console.error(c),s.manager.itemError(e),s.manager.itemEnd(e)},l=new Xn(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{s.parse(c,o,function(u){t(u),s.manager.itemEnd(e)},a)}catch(u){a(u)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s,o={},a={};if(typeof e=="string")s=e;else if(Ei.decodeText(new Uint8Array(e,0,4))===kS){try{o[dt.KHR_BINARY_GLTF]=new HS(e)}catch(h){i&&i(h);return}s=o[dt.KHR_BINARY_GLTF].content}else s=Ei.decodeText(new Uint8Array(e));let l=JSON.parse(s);if(l.asset===void 0||l.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new $S(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(n,i)}};function u3(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}var dt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"},IS=class{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)}},GS=class{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;let o=s.extensions[t],a=i.images[o.source],l=n.textureLoader;if(a.uri){let c=n.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},US=class{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([s,o.ready]).then(function(a){let l=i.byteOffset||0,c=i.byteLength||0,u=i.count,h=i.byteStride,d=new ArrayBuffer(u*h),f=new Uint8Array(a[0],l,c);return o.decodeGltfBuffer(new Uint8Array(d),u,h,f,i.mode,i.filter),d})}else return null}},kS="glTF",eu=12,VS={JSON:1313821514,BIN:5130562},HS=class{constructor(e){this.name=dt.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,eu);if(this.header={magic:Ei.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==kS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-eu,i=new DataView(e,eu),s=0;for(;s",t).replace("#include ",n).replace("#include ",i).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(l){a.specular.value=l}},specularMap:{get:function(){return a.specularMap.value},set:function(l){a.specularMap.value=l,l?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(l){a.glossiness.value=l}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(l){a.glossinessMap.value=l,l?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}},JS=class{constructor(){this.name=dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return zd}extendParams(e,t,n){let i=t.extensions[this.name];e.color=new fe(1,1,1),e.opacity=1;let s=[];if(Array.isArray(i.diffuseFactor)){let o=i.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(i.diffuseTexture!==void 0&&s.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new fe(0,0,0),e.glossiness=i.glossinessFactor!==void 0?i.glossinessFactor:1,e.specular=new fe(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),i.specularGlossinessTexture!==void 0){let o=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",o)),s.push(n.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){let t=new zd(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=Qr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}},XS=class{constructor(){this.name=dt.KHR_MESH_QUANTIZATION}},Oo=class extends qi{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}};Oo.prototype.beforeStart_=Oo.prototype.copySampleValue_;Oo.prototype.afterEnd_=Oo.prototype.copySampleValue_;Oo.prototype.interpolate_=function(r,e,t,n){let i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=o*2,l=o*3,c=n-e,u=(t-e)/c,h=u*u,d=h*u,f=r*l,p=f-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+u;for(let x=0;x!==o;x++){let b=s[p+x+o],w=s[p+x+a]*c,_=s[f+x+o],S=s[f+x]*c;i[x]=g*b+y*w+m*_+v*S}return i};var jr={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},tu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},qS={9728:Pt,9729:$e,9984:Xs,9985:jo,9986:qs,9987:Ai},YS={33071:Zt,33648:qr,10497:di},KS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$m={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Rs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},h3={CUBICSPLINE:void 0,LINEAR:Er,STEP:Yr},eg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function QS(r,e){return typeof r!="string"||r===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(r)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(r)||/^data:.*,.*$/i.test(r)||/^blob:.*$/i.test(r)?r:e+r)}function d3(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new Xi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Oi})),r.DefaultMaterial}function nu(r,e,t){for(let n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Fo(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function f3(r,e,t){let n=!1,i=!1;for(let a=0,l=e.length;a=2&&v.setY(T,_[S*l+1]),l>=3&&v.setZ(T,_[S*l+2]),l>=4&&v.setW(T,_[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){let t=this.json,n=this.options,i=t.textures[e],s=t.images[i.source],o=this.textureLoader;if(s.uri){let a=n.manager.getHandler(s.uri);a!==null&&(o=a)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,n){let i=this,s=this.json,o=this.options,a=s.textures[e],l=(t.uri||t.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let c=self.URL||self.webkitURL,u=t.uri||"",h=!1,d=!0,f=u.search(/\.jpe?g($|\?)/i)>0||u.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||f)&&(d=!1),t.bufferView!==void 0)u=i.getDependency("bufferView",t.bufferView).then(function(m){if(t.mimeType==="image/png"){let g=new DataView(m,25,1).getUint8(0,!1);d=g===6||g===4||g===3}h=!0;let v=new Blob([m],{type:t.mimeType});return u=c.createObjectURL(v),u});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let p=Promise.resolve(u).then(function(m){return new Promise(function(v,g){let y=v;n.isImageBitmapLoader===!0&&(y=function(x){let b=new xt(x);b.needsUpdate=!0,v(b)}),n.load(QS(m,o.path),y,void 0,g)})}).then(function(m){h===!0&&c.revokeObjectURL(u),m.flipY=!1,a.name&&(m.name=a.name),d||(m.format=Nt);let g=(s.samplers||{})[a.sampler]||{};return m.magFilter=qS[g.magFilter]||$e,m.minFilter=qS[g.minFilter]||Ai,m.wrapS=YS[g.wrapS]||di,m.wrapT=YS[g.wrapT]||di,i.associations.set(m,{type:"textures",index:e}),m}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null});return this.textureCache[l]=p,p}assignTexture(e,t,n){let i=this;return this.getDependency("texture",n.index).then(function(s){if(n.texCoord!==void 0&&n.texCoord!=0&&!(t==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[dt.KHR_TEXTURE_TRANSFORM]){let o=n.extensions!==void 0?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){let a=i.associations.get(s);s=i.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),i.associations.set(s,a)}}return e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,n=e.material,i=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let a="PointsMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Ta,nn.prototype.copy.call(l,n),l.color.copy(n.color),l.map=n.map,l.sizeAttenuation=!1,this.cache.add(a,l)),n=l}else if(e.isLine){let a="LineBasicMaterial:"+n.uuid,l=this.cache.get(a);l||(l=new Gn,nn.prototype.copy.call(l,n),l.color.copy(n.color),this.cache.add(a,l)),n=l}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(a+="specular-glossiness:"),i&&(a+="vertex-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=n.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(n))),n=l}n.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Xi}loadMaterial(e){let t=this,n=this.json,i=this.extensions,s=n.materials[e],o,a={},l=s.extensions||{},c=[];if(l[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){let h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else if(l[dt.KHR_MATERIALS_UNLIT]){let h=i[dt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{let h=s.pbrMetallicRoughness||{};if(a.color=new fe(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){let d=h.baseColorFactor;a.color.fromArray(d),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Xt);let u=s.alphaMode||eg.OPAQUE;return u===eg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===eg.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new O(1,-1),s.normalTexture.scale!==void 0&&a.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==dn&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==dn&&(a.emissive=new fe().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==dn&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===zd?h=i[dt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):h=new o(a),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Fi),h.emissiveMap&&(h.emissiveMap.encoding=Fi),Fo(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&nu(i,h,s),h})}createUniqueName(e){let t=nt.sanitizeNodeName(e||""),n=t;for(let i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){let t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return tM(l,a,t)})}let o=[];for(let a=0,l=e.length;a0&&p3(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Fo(g,s),v.extensions&&nu(i,g,v),t.assignFinalMaterial(g),h.push(g)}if(h.length===1)return h[0];let d=new Jn;for(let f=0,p=h.length;f1?l=new Jn:a.length===1?l=a[0]:l=new Ke,l!==a[0])for(let c=0,u=a.length;c{on.fontCache[e]=s,t(s)},void 0,n)})}static loadChar(e,t,n){if(on.charCache[e]){if(on.charCache[e][n]&&on.charCache[e][n].fontFamily===t)return on.charCache[e][n]}else on.charCache[e]={};let i=on.fontCache[t],s=i.generateShapes(e,1);return on.charCache[e][n]={geometry:new ps(s,n),fontFamily:t,resolution:i.data.resolution,glyphsHa:i.data.glyphs[e].ha},on.charCache[e][n]}},ui=on;ui.charCache={},ui.fontCache={},ui._fontPath="/_assets/_fonts/";var zo;(function(n){n[n.STANDARD=1]="STANDARD",n[n.UPPERCASE=2]="UPPERCASE",n[n.LOWERCASE=3]="LOWERCASE"})(zo||(zo={}));var Bs;(function(n){n[n.TOP=1]="TOP",n[n.MIDDLE=2]="MIDDLE",n[n.BOTTOM=3]="BOTTOM"})(Bs||(Bs={}));var hi;(function(i){i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i[i.CENTER=3]="CENTER",i[i.JUSTIFY=4]="JUSTIFY"})(hi||(hi={}));var Go;(function(t){t[t.TO_RIGHT=1]="TO_RIGHT",t[t.TO_LEFT=-1]="TO_LEFT"})(Go||(Go={}));var Gd=new O,_l=class{constructor(e,t,n){this.message=[];this.endLine=!0;this.yLinePos=e,this.lineHeight=t,this.maxCharSize=n,this.nextChar3DPos=new O(0,this.yLinePos+this.maxCharSize*this.lineHeight),this.align=hi.LEFT}addChar3D(e,t,n=this.message.length){this.message.splice(n,0,e),e.fontSize>this.maxCharSize?(this.maxCharSize=e.fontSize,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight,this.fullUpdate(t)):(e.updatePosition(this.nextChar3DPos,t),this.nextChar3DPos.x+=e.charSize)}deleteChar3D(e=this.message.length-1){let t=this.message[e];if(t)return this.message.splice(e,1),this.nextChar3DPos.x-=t.charSize,t}isEndLine(e){this.endLine=e}fullUpdate(e,t=0){this.nextChar3DPos.x=0;for(let n=t,i=this.message.length;n=0;){if(this.message[n].char!==" "){t=this.message[n];break}n-=1}return!!(n>=0&&t&&t.localPosition.x+t.charSize>e)}containSpaceOverFlow(e=this.message.length-1){for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}containSpace(e=this.message.length-1){if(this.endLine)return!0;for(let t=e;t>=0;t-=1)if(this.message[t].char===" ")return!0;return!1}popWord(e=this.message.length-1){let t=[],n=!0,i;for(i=e;i>=0;i-=1)if(this.message[i].char===" "){n=!1,t.length===0&&(i-=1,t.splice(0,0,this.message[i]));break}else t.splice(0,0,this.message[i]);return n?t=[]:this.message.splice(i+1,t.length),t}getWord(e=0,t=1){let n=[],i=e;for(i=e;;i+=t){if(!this.message[i]||this.message[i].char===" "){n.length===0&&this.message[i]&&(n.push(this.message[i]),this.message.splice(i,1));break}t>0?(n.push(this.message[i]),this.message.splice(i,1),i-=t):(n.splice(0,0,this.message[i]),this.message.splice(i,1))}return n}getWordAtIndex(e){let t=[];for(let n=e;n=0&&this.message[n].char!==" ";n--)t.splice(0,0,this.message[n]);return t}wordSize(e=0,t=-1){let n=0,i=e;for(;i>=0&&i=this.message.length)&&!this.endLine?this.message[e]?this.message[e].charSize:999999999:n===0?999999999:n}spaceLeft(e){return e-this.nextChar3DPos.x}popChar(e=this.message.length-1){return this.nextChar3DPos.x-=this.message[e].charSize,this.message.splice(e,1)}isEmpty(){return!this.message.length}updateNextCharPosY(){this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}updateYLinePos(e){this.yLinePos=e,this.updateNextCharPosY()}updatelineHeight(e){this.lineHeight=e,this.updateNextCharPosY()}updateFontSize(e,t=0,n=this.message.length-1){for(let i=t;i<=n;i+=1)this.message[i].updateFontSize(e);this.maxCharSize=e,this.nextChar3DPos.y=this.yLinePos+this.maxCharSize*this.lineHeight}countSpaces(){let e=0;for(let t=0;t0){t.push(n[0]);return}let i=[];for(let s=0,o=this.children.length;s0)){i[0].object=this,t.push(i[0]);return}}updateGeometry(e){var c,u;let t=this.userData,n=this.geometry.userData,i=n.parameters.width,s=(c=e.parameters)==null?void 0:c.width,o=(u=e.parameters)==null?void 0:u.height,a=n.parameters.height,l=t.textFrame;super.updateGeometry(e),l.maxLineSize=n.parameters.width,l.textOrigin.set(n.parameters.width*-.5,n.parameters.height*.5,0),o!==void 0&&a!==o?(this.checkOverFlow(),this.checkCapacity()):s!==void 0&&(is&&this.checkOverFlow())}checkOverFlow(e=0){let t=this.userData,n=t.textFrame.textOrigin,i=t.textFrame.textLines;for(let s=e;s0){i[s+1]===void 0&&(i[s].isEndLine(!1),this.createTextLine());let a=0;for(let l=0;ls?this.checkOverFlow():e{let a=o.message.map(l=>({char:l.char,originalChar:l.originalChar,fontFamily:l.fontFamily,letterSpacing:l.letterSpacing,fontSize:l.fontSize,LOD:l.LOD}));return{align:o.align,endLine:o.endLine,lineHeight:o.lineHeight,maxCharSize:o.maxCharSize,yLinePos:o.yLinePos,message:a}});return n.userData.textFrame.textLinesData=s,t}async fromJSONasync(e){if(super.fromJSON(e),e.userData!==void 0){let t=e.userData.textFrame;await ui.loadFont(t.fontFamily),t.textOrigin=new M(t.textOrigin.x,t.textOrigin.y,t.textOrigin.z);let n=new dn({color:t.hexColor,opacity:t.opacity,visible:t.visible,transparent:!0,side:Xt});t.textLinesData&&(t.textLines=t.textLinesData.map((i,s)=>{let o=new _l(Number(i.yLinePos),Number(i.lineHeight),Number(i.maxCharSize)),a=i.message.map((l,c)=>{if(l.char===void 0){let d=t.textLines[s].message[c];if("geometries"in d){let f=d.geometries[0].userData.parameters;Object.assign(l,{LOD:f.lod,char:f.char,fontFamily:f.fontFamily,fontSize:f.fontSize,letterSpacing:f.letterSpacing,originalChar:f.char})}}let u={char:l.char,fontFamily:l.fontFamily,letterSpacing:Number(l.letterSpacing),fontSize:Number(l.fontSize),LOD:l.LOD},h=new ui(u,n.clone());return o.addChar3D(h,t.textOrigin),this.add(h),h});return o.message=a,o}),this.userData.textFrame=t),this.textFullUpdate()}return this}convertToVector(){let{fontFamily:e,hexColor:t}=this.userData.textFrame,n=new Pi;n.name="Text Shape";let i=ui.fontCache[e];for(let s of this.children)s instanceof ui&&i.generateShapes(s.char,1).forEach(o=>{var h;let a=new Lt().fromShape(o);a.applyScale(s.scale.x,s.scale.y);let l=Pn.create({shape:a}),c=new oi({side:Xt});(h=c.color)==null||h.value.setHex(t);let u=new Ps(l,c);u.name=s.char,u.position.copy(s.position),u.rotation.copy(s.rotation),n.attach(u)});return n}};Os.VERTICAL_ALIGN=Bs,Os.HORIZONTAL_ALIGN=hi,Os.TEXT_TRANSFORM=zo,Os.TRAVEL_DIRECTION=Go;var iM={RED:0,GREEN:1,BLUE:2,ALPHA:3};var iu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";var y3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale; -#if PASS == 1 -uniform vec4 kernel64[32]; -#else -uniform vec4 kernel16[8]; -#endif -varying vec2 vUv;void main(){ -#ifdef FOREGROUND -vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; -#else -float CoC=texture2D(cocBuffer,vUv).g*scale; -#endif -if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ -#ifdef FOREGROUND -vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); -#else -vec2 step=texelSize*CoC; -#endif -#if PASS == 1 -vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0; -#else -vec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue; -#endif -}}`,Ud=class extends _t{constructor(r=!1,e=!1){super({type:"BokehMaterial",defines:{PASS:r?"2":"1"},uniforms:{kernel64:new Ae(null),kernel16:new Ae(null),inputBuffer:new Ae(null),cocBuffer:new Ae(null),texelSize:new Ae(new O),scale:new Ae(1)},fragmentShader:y3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,e&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){let r=2.39996323,e=new Float32Array(128),t=new Float32Array(32),n=0,i=0;for(let a=0;a<80;++a){let l=a*r,c=Math.sqrt(a)/Math.sqrt(80),u=c*Math.cos(l),h=c*Math.sin(l);a%5==0?(t[i++]=u,t[i++]=h):(e[n++]=u,e[n++]=h)}let s=[],o=[];for(let a=0;a<128;)s.push(new Qe(e[a++],e[a++],e[a++],e[a++]));for(let a=0;a<32;)o.push(new Qe(t[a++],t[a++],t[a++],t[a++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e)}},v3=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}void main(){float depth=readDepth(vUv); -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); -#else -float linearDepth=depth; -#endif -float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}`,x3=class extends _t{constructor(r){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ae(null),focusDistance:new Ae(0),focalLength:new Ae(0),cameraNear:new Ae(.3),cameraFar:new Ae(1e3)},fragmentShader:v3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.adoptCameraSettings(r)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},b3=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -#if EDGE_DETECTION_MODE == 1 -#include -#endif -#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} -#elif PREDICATION_MODE == 2 -uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} -#endif -#if PREDICATION_MODE != 0 -vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} -#endif -#if EDGE_DETECTION_MODE != 0 -uniform sampler2D inputBuffer; -#endif -void main(){ -#if EDGE_DETECTION_MODE == 0 -const vec2 threshold=vec2(DEPTH_THRESHOLD); -#elif PREDICATION_MODE != 0 -vec2 threshold=calculatePredicatedThreshold(); -#else -const vec2 threshold=vec2(EDGE_THRESHOLD); -#endif -#if EDGE_DETECTION_MODE == 0 -vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 1 -float l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#elif EDGE_DETECTION_MODE == 2 -vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); -#endif -}`,w3=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; -#if EDGE_DETECTION_MODE != 0 -varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; -#endif -void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); -#if EDGE_DETECTION_MODE != 0 -vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); -#endif -gl_Position=vec4(position.xy,1.0,1.0);}`;var S3=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,M3="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",rM=class extends _t{constructor(r=new O){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new Ae(null),texelSize:new Ae(new O),halfTexelSize:new Ae(new O),kernel:new Ae(0),scale:new Ae(1)},fragmentShader:S3,vertexShader:M3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setTexelSize(r.x,r.y),this.kernelSize=kd.LARGE}getKernel(){return A3[this.kernelSize]}setTexelSize(r,e){this.uniforms.texelSize.value.set(r,e),this.uniforms.halfTexelSize.value.set(r,e).multiplyScalar(.5)}},A3=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],kd={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},_3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -}`,sM=class extends _t{constructor(){super({type:"CopyMaterial",uniforms:{inputBuffer:new Ae(null),opacity:new Ae(1)},fragmentShader:_3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}};var T3=class extends _t{constructor(r=new O,e=Vd.COLOR){super({type:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),predicationBuffer:new Ae(null),texelSize:new Ae(r)},fragmentShader:b3,vertexShader:w3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.setEdgeDetectionMode(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setEdgeDetectionMode(r){this.defines.EDGE_DETECTION_MODE=r.toFixed(0),this.needsUpdate=!0}setLocalContrastAdaptationFactor(r){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=r.toFixed("6"),this.needsUpdate=!0}setEdgeDetectionThreshold(r){this.defines.EDGE_THRESHOLD=r.toFixed("6"),this.defines.DEPTH_THRESHOLD=(r*.1).toFixed("6"),this.needsUpdate=!0}setPredicationMode(r){this.defines.PREDICATION_MODE=r.toFixed(0),this.needsUpdate=!0}setPredicationBuffer(r){this.uniforms.predicationBuffer.value=r}setPredicationThreshold(r){this.defines.PREDICATION_THRESHOLD=r.toFixed("6"),this.needsUpdate=!0}setPredicationScale(r){this.defines.PREDICATION_SCALE=r.toFixed("6"),this.needsUpdate=!0}setPredicationStrength(r){this.defines.PREDICATION_STRENGTH=r.toFixed("6"),this.needsUpdate=!0}},Vd={DEPTH:0,LUMA:1,COLOR:2},oM={DISABLED:0,DEPTH:1,CUSTOM:2},E3=`#include -#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,N3="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",C3=class extends _t{constructor(r=null,e=null,t=null,n,i=!1){super({type:"EffectMaterial",defines:{DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ae(null),depthBuffer:new Ae(null),resolution:new Ae(new O),texelSize:new Ae(new O),cameraNear:new Ae(.3),cameraFar:new Ae(1e3),aspect:new Ae(1),time:new Ae(0)},blending:It,depthWrite:!1,depthTest:!1,dithering:i});this.toneMapped=!1,r!==null&&this.setShaderParts(r),e!==null&&this.setDefines(e),t!==null&&this.setUniforms(t),this.adoptCameraSettings(n)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(r){this.defines.DEPTH_PACKING=r.toFixed(0),this.needsUpdate=!0}setShaderParts(r){return this.fragmentShader=E3.replace(pt.FRAGMENT_HEAD,r.get(pt.FRAGMENT_HEAD)).replace(pt.FRAGMENT_MAIN_UV,r.get(pt.FRAGMENT_MAIN_UV)).replace(pt.FRAGMENT_MAIN_IMAGE,r.get(pt.FRAGMENT_MAIN_IMAGE)),this.vertexShader=N3.replace(pt.VERTEX_HEAD,r.get(pt.VERTEX_HEAD)).replace(pt.VERTEX_MAIN_SUPPORT,r.get(pt.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(r){for(let e of r.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(r){for(let e of r.entries())this.uniforms[e[0]]=e[1];return this}adoptCameraSettings(r=null){r!==null&&(this.uniforms.cameraNear.value=r.near,this.uniforms.cameraFar.value=r.far,r instanceof Vt?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(r,e){let t=Math.max(r,1),n=Math.max(e,1);this.uniforms.resolution.value.set(t,n),this.uniforms.texelSize.value.set(1/t,1/n),this.uniforms.aspect.value=t/n}},pt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"};var L3=`#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=linearToRelativeLuminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,I3=class extends _t{constructor(r=!1,e=null){let t=e!==null;super({type:"LuminanceMaterial",uniforms:{inputBuffer:new Ae(null),threshold:new Ae(0),smoothing:new Ae(1),range:new Ae(t?e:new O)},fragmentShader:L3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorOutput=r,this.useThreshold=!0,this.useRange=t}get threshold(){return this.uniforms.threshold.value}set threshold(r){this.uniforms.threshold.value=r}get smoothing(){return this.uniforms.smoothing.value}set smoothing(r){this.uniforms.smoothing.value=r}get useThreshold(){return this.defines.THRESHOLD!==void 0}set useThreshold(r){r?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.needsUpdate=!0}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(r){r?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}setColorOutputEnabled(r){this.colorOutput=r}get useRange(){return this.defines.RANGE!==void 0}set useRange(r){r?this.defines.RANGE="1":delete this.defines.RANGE,this.needsUpdate=!0}get luminanceRange(){return this.useRange}set luminanceRange(r){this.useRange=r}setLuminanceRangeEnabled(r){this.useRange=r}},P3=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef MASK_PRECISION_HIGH -uniform mediump sampler2D maskTexture; -#else -uniform lowp sampler2D maskTexture; -#endif -#if MASK_FUNCTION != 0 -uniform float strength; -#endif -varying vec2 vUv;void main(){ -#if COLOR_CHANNEL == 0 -float mask=texture2D(maskTexture,vUv).r; -#elif COLOR_CHANNEL == 1 -float mask=texture2D(maskTexture,vUv).g; -#elif COLOR_CHANNEL == 2 -float mask=texture2D(maskTexture,vUv).b; -#else -float mask=texture2D(maskTexture,vUv).a; -#endif -#if MASK_FUNCTION == 0 -#ifdef INVERTED -mask=step(mask,0.0); -#else -mask=1.0-step(mask,0.0); -#endif -#else -mask=clamp(mask*strength,0.0,1.0); -#ifdef INVERTED -mask=1.0-mask; -#endif -#endif -#if MASK_FUNCTION == 2 -gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); -#else -gl_FragColor=mask*texture2D(inputBuffer,vUv); -#endif -}`,D3=class extends _t{constructor(r=null){super({type:"MaskMaterial",uniforms:{maskTexture:new Ae(r),inputBuffer:new Ae(null),strength:new Ae(1)},fragmentShader:P3,vertexShader:iu,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1,this.colorChannel=iM.RED,this.maskFunction=aM.DISCARD}set maskTexture(r){this.uniforms.maskTexture.value=r,delete this.defines.MASK_PRECISION_HIGH,r.type!==At&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}set colorChannel(r){this.defines.COLOR_CHANNEL=r.toFixed(0),this.needsUpdate=!0}set maskFunction(r){this.defines.MASK_FUNCTION=r.toFixed(0),this.needsUpdate=!0}get inverted(){return this.defines.INVERTED!==void 0}set inverted(r){this.inverted&&!r?delete this.defines.INVERTED:r&&(this.defines.INVERTED="1"),this.needsUpdate=!0}get strength(){return this.uniforms.strength.value}set strength(r){this.uniforms.strength.value=r}},aM={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2};var R3=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) -#if __VERSION__ < 300 -#define round(v) floor(v + 0.5) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;iend&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;iend&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); -#endif -}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ -#if !defined(DISABLE_CORNER_DETECTION) -vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); -#endif -}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ -#if !defined(DISABLE_DIAG_DETECTION) -weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ -#endif -vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); -#if !defined(DISABLE_DIAG_DETECTION) -}else{e.r=0.0;} -#endif -}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,B3="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",O3=class extends _t{constructor(r=new O,e=new O){super({type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new Ae(null),areaTexture:new Ae(null),searchTexture:new Ae(null),texelSize:new Ae(r),resolution:new Ae(e)},fragmentShader:R3,vertexShader:B3,blending:It,depthWrite:!1,depthTest:!1});this.toneMapped=!1}setOrthogonalSearchSteps(r){let e=Math.min(Math.max(r,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(r){let e=Math.min(Math.max(r,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setCornerRounding(r){let e=Math.min(Math.max(r,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(r){r?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}get cornerRounding(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerRounding(r){r?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}};var F3=new Dr,Fs=null;function z3(){if(Fs===null){let r=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Fs=new we,Fs.setAttribute!==void 0?(Fs.setAttribute("position",new Re(r,3)),Fs.setAttribute("uv",new Re(e,2))):(Fs.addAttribute("position",new Re(r,3)),Fs.addAttribute("uv",new Re(e,2)))}return Fs}var Wr=class{constructor(r="Pass",e=new An,t=F3){this.name=r,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(r){if(this.rtt===r){let e=this.getFullscreenMaterial();e!==null&&(e.needsUpdate=!0),this.rtt=!r}}getFullscreenMaterial(){return this.screen!==null?this.screen.material:null}setFullscreenMaterial(r){let e=this.screen;e!==null?e.material=r:(e=new gt(z3(),r),e.frustumCulled=!1,this.scene===null&&(this.scene=new An),this.scene.add(e),this.screen=e)}getDepthTexture(){return null}setDepthTexture(r,e=0){}render(r,e,t,n,i){throw new Error("Render method not implemented!")}setSize(r,e){}initialize(r,e,t){}dispose(){let r=this.getFullscreenMaterial();r!==null&&r.dispose();for(let e of Object.keys(this)){let t=this[e];if(t!==null&&typeof t.dispose=="function"){if(t instanceof An)continue;this[e].dispose()}}}},lM=class extends Wr{constructor(r,e=!0){super("SavePass");this.setFullscreenMaterial(new sM),this.needsSwap=!1,this.renderTarget=r,r===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="SavePass.Target"),this.resize=e}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){this.getFullscreenMaterial().uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){if(this.resize){let t=Math.max(r,1),n=Math.max(e,1);this.renderTarget.setSize(t,n)}}initialize(r,e,t){if(!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t,t!==At)){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}};var Jr=-1,nr=class{constructor(r,e=Jr,t=Jr,n=1){this.resizable=r,this.base=new O(1,1),this.target=new O(e,t),this.s=n}get scale(){return this.s}set scale(r){this.s=r,this.target.x=Jr,this.target.y=Jr,this.resizable.setSize(this.base.x,this.base.y)}get width(){let r=this.base,e=this.target,t;return e.x!==Jr?t=e.x:e.y!==Jr?t=Math.round(e.y*(r.x/r.y)):t=Math.round(r.x*this.s),t}set width(r){this.target.x=r,this.resizable.setSize(this.base.x,this.base.y)}get height(){let r=this.base,e=this.target,t;return e.y!==Jr?t=e.y:e.x!==Jr?t=Math.round(e.x/(r.x/r.y)):t=Math.round(r.y*this.s),t}set height(r){this.target.y=r,this.resizable.setSize(this.base.x,this.base.y)}static get AUTO_SIZE(){return Jr}},cM=class extends Wr{constructor({resolutionScale:r=.5,width:e=nr.AUTO_SIZE,height:t=nr.AUTO_SIZE,kernelSize:n=kd.LARGE}={}){super("BlurPass");this.renderTargetA=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B",this.resolution=new nr(this,e,t,r),this.convolutionMaterial=new rM,this.ditheredConvolutionMaterial=new rM,this.ditheredConvolutionMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get scale(){return this.convolutionMaterial.uniforms.scale.value}set scale(r){this.convolutionMaterial.uniforms.scale.value=r,this.ditheredConvolutionMaterial.uniforms.scale.value=r}get kernelSize(){return this.convolutionMaterial.kernelSize}set kernelSize(r){this.convolutionMaterial.kernelSize=r,this.ditheredConvolutionMaterial.kernelSize=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.convolutionMaterial,u=c.uniforms,h=c.getKernel(),d=e,f,p,m;for(this.setFullscreenMaterial(c),p=0,m=h.length-1;p=0;l?(ng.copy(r.getClearColor(ng)),r.setClearColor(s,c?o:a)):c&&r.setClearAlpha(o),r.setRenderTarget(this.renderToScreen?null:e),r.clear(this.color,this.depth,this.stencil),l?r.setClearColor(ng,a):c&&r.setClearAlpha(a)}},rg=!1,uM=class{constructor(r=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(r),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Xt:t=this.materialsFlatShadedDoubleSide;break;case kt:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Xt:t=this.materialsDoubleSide;break;case kt:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(r){if(this.disposeMaterials(),this.material=r,r!==null){let e=this.materials=[r.clone(),r.clone(),r.clone()];for(let t of e)t.uniforms=Object.assign({},r.uniforms),t.side=Oi;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=kt,n}),this.materialsDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.side=Xt,n}),this.materialsFlatShaded=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=kt,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{let n=t.clone();return n.uniforms=Object.assign({},r.uniforms),n.flatShading=!0,n.side=Xt,n})}}render(r,e,t){let n=r.shadowMap.enabled;if(r.shadowMap.enabled=!1,rg){let i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),r.render(e,t);for(let s of i)s[0].material=s[1];this.meshCount!==i.size&&i.clear()}else{let i=e.overrideMaterial;e.overrideMaterial=this.material,r.render(e,t),e.overrideMaterial=i}r.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let r=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let e of r)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return rg}static set workaroundEnabled(r){rg=r}},sg=class extends Wr{constructor(r,e,t=null){super("RenderPass",r,e);this.needsSwap=!1,this.clearPass=new ig,this.overrideMaterialManager=t===null?null:new uM(t)}get renderToScreen(){return super.renderToScreen}set renderToScreen(r){super.renderToScreen=r,this.clearPass.renderToScreen=r}get overrideMaterial(){let r=this.overrideMaterialManager;return r!==null?r.material:null}set overrideMaterial(r){let e=this.overrideMaterialManager;r!==null?e!==null?e.setMaterial(r):this.overrideMaterialManager=new uM(r):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}getClearPass(){return this.clearPass}render(r,e,t,n,i){let s=this.scene,o=this.camera,a=s.background,l=this.renderToScreen?null:e;this.clear&&(this.clearPass.overrideClearColor!==null&&(s.background=null),this.clearPass.render(r,e)),r.setRenderTarget(l),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(r,s,o):r.render(s,o),s.background!==a&&(s.background=a)}};var w$=new Float32Array([255/256/256**3,255/256/256**2,255/256/256,255/256]);var ut={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},U3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",k3="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",V3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",H3="float blend(const in float x,const in float y){return(y==0.0)? y : max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",j3="float blend(const in float x,const in float y){return(y==1.0)? y : min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",W3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",J3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",X3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",Y3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",K3="float blend(const in float x,const in float y){return(y>0.0)? min(x/y,1.0): 1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",Q3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",Z3="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}",$3="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eF="float blend(const in float x,const in float y){return(y==1.0)? y : min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",tF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",nF="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",iF="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",rF=new Map([[ut.SKIP,null],[ut.ADD,U3],[ut.ALPHA,k3],[ut.AVERAGE,V3],[ut.COLOR_BURN,H3],[ut.COLOR_DODGE,j3],[ut.DARKEN,W3],[ut.DIFFERENCE,J3],[ut.EXCLUSION,X3],[ut.LIGHTEN,q3],[ut.MULTIPLY,Y3],[ut.DIVIDE,K3],[ut.NEGATION,Q3],[ut.NORMAL,Z3],[ut.OVERLAY,$3],[ut.REFLECT,eF],[ut.SCREEN,tF],[ut.SOFT_LIGHT,nF],[ut.SUBTRACT,iF]]),sF=class extends cn{constructor(r,e=1){super();this.blendFunction=r,this.opacity=new Ae(e)}getBlendFunction(){return this.blendFunction}setBlendFunction(r){this.blendFunction=r,this.dispatchEvent({type:"change"})}getShaderCode(){return rF.get(this.blendFunction)}},Mr=class extends cn{constructor(r,e,{attributes:t=ir.NONE,blendFunction:n=ut.SCREEN,defines:i=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super();this.name=r,this.attributes=t,this.fragmentShader=e,this.vertexShader=a,this.defines=i,this.uniforms=s,this.extensions=o,this.blendMode=new sF(n),this.blendMode.addEventListener("change",l=>this.setChanged())}setChanged(){this.dispatchEvent({type:"change"})}getAttributes(){return this.attributes}setAttributes(r){this.attributes=r,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(r){this.fragmentShader=r,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(r){this.vertexShader=r,this.setChanged()}setDepthTexture(r,e=0){}update(r,e,t){}setSize(r,e){}initialize(r,e,t){}dispose(){for(let r of Object.keys(this)){let e=this[r];if(e!==null&&typeof e.dispose=="function"){if(e instanceof An)continue;this[r].dispose()}}}},ir={NONE:0,DEPTH:1,CONVOLUTION:2};function og(r,e){let t=[],n;for(;(n=r.exec(e))!==null;)t.push(n[1]);return t}function hM(r,e,t){let n,i;for(let s of e){n="$1"+r+s.charAt(0).toUpperCase()+s.slice(1),i=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(let o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(i,n))}}function oF(r,e,t,n,i,s,o){let a=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,l=/(?:varying\s+\w+\s+(\w*))/g,c=e.blendMode,u=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=u.get("fragment")!==void 0&&/mainImage/.test(u.get("fragment")),d=u.get("fragment")!==void 0&&/mainUv/.test(u.get("fragment")),f=[],p=[],m=!1,v=!1;if(u.get("fragment")===void 0)console.error("Missing fragment shader",e);else if(d&&(o&ir.CONVOLUTION)!=0)console.error("Effects that transform UV coordinates are incompatible with convolution effects",e);else if(!h&&!d)console.error("The fragment shader contains neither a mainImage nor a mainUv function",e);else{if(d&&(t.set(pt.FRAGMENT_MAIN_UV,t.get(pt.FRAGMENT_MAIN_UV)+" "+r+`MainUv(UV); -`),m=!0),u.get("vertex")!==null&&/mainSupport/.test(u.get("vertex"))){let g=" "+r+"MainSupport(";/mainSupport *\([\w\s]*?uv\s*?\)/.test(u.get("vertex"))&&(g+="vUv"),g+=`); -`,t.set(pt.VERTEX_MAIN_SUPPORT,t.get(pt.VERTEX_MAIN_SUPPORT)+g),f=f.concat(og(l,u.get("vertex"))),p=p.concat(f).concat(og(a,u.get("vertex")))}if(p=p.concat(og(a,u.get("fragment"))).concat(Array.from(e.defines.keys()).map(g=>g.replace(/\([\w\s,]*\)/g,""))).concat(Array.from(e.uniforms.keys())),e.uniforms.forEach((g,y)=>s.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),e.defines.forEach((g,y)=>i.set(r+y.charAt(0).toUpperCase()+y.slice(1),g)),hM(r,p,i),hM(r,p,u),n.set(c.blendFunction,c),h){let g=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,y=r+"MainImage(color0, UV, ";(o&ir.DEPTH)!=0&&g.test(u.get("fragment"))&&(y+="depth, ",v=!0),y+=`color1); - `;let x=r+"BlendOpacity";s.set(x,c.opacity),y+="color0 = blend"+c.getBlendFunction()+"(color0, color1, "+x+`); - - `,t.set(pt.FRAGMENT_MAIN_IMAGE,t.get(pt.FRAGMENT_MAIN_IMAGE)+y),t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+"uniform float "+x+`; - -`)}t.set(pt.FRAGMENT_HEAD,t.get(pt.FRAGMENT_HEAD)+u.get("fragment")+` -`),u.get("vertex")!==null&&t.set(pt.VERTEX_HEAD,t.get(pt.VERTEX_HEAD)+u.get("vertex")+` -`)}return{varyings:f,transformedUv:m,readDepth:v}}var Hd=class extends Wr{constructor(r,...e){super("EffectPass");this.setFullscreenMaterial(new C3(null,null,null,r)),this.effects=e.sort((t,n)=>n.attributes-t.attributes),this.skipRendering=!1,this.uniforms=0,this.varyings=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.getFullscreenMaterial().defines.ENCODE_OUTPUT!==void 0}set encodeOutput(r){if(this.encodeOutput!==r){let e=this.getFullscreenMaterial();e.needsUpdate=!0,r?e.defines.ENCODE_OUTPUT="1":delete e.defines.ENCODE_OUTPUT}}get dithering(){return this.getFullscreenMaterial().dithering}set dithering(r){let e=this.getFullscreenMaterial();e.dithering!==r&&(e.dithering=r,e.needsUpdate=!0)}verifyResources(r){let e=r.capabilities,t=Math.min(e.maxFragmentUniforms,e.maxVertexUniforms);this.uniforms>t&&console.warn("The current rendering context doesn't support more than "+t+" uniforms, but "+this.uniforms+" were defined"),t=e.maxVaryings,this.varyings>t&&console.warn("The current rendering context doesn't support more than "+t+" varyings, but "+this.varyings+" were defined")}updateMaterial(){let r=/\bblend\b/g,e=new Map([[pt.FRAGMENT_HEAD,""],[pt.FRAGMENT_MAIN_UV,""],[pt.FRAGMENT_MAIN_IMAGE,""],[pt.VERTEX_HEAD,""],[pt.VERTEX_MAIN_SUPPORT,""]]),t=new Map,n=new Map,i=new Map,s=new Set,o=0,a=0,l=0,c=!1,u=!1,h;for(let f of this.effects)if(f.blendMode.getBlendFunction()===ut.SKIP)l|=f.getAttributes()&ir.DEPTH;else if((l&ir.CONVOLUTION)!=0&&(f.getAttributes()&ir.CONVOLUTION)!=0)console.error("Convolution effects cannot be merged",f);else if(l|=f.getAttributes(),h=oF("e"+o++,f,e,t,n,i,l),a+=h.varyings.length,c=c||h.transformedUv,u=u||h.readDepth,f.extensions!==null)for(let p of f.extensions)s.add(p);for(let f of t.values())e.set(pt.FRAGMENT_HEAD,e.get(pt.FRAGMENT_HEAD)+f.getShaderCode().replace(r,"blend"+f.getBlendFunction())+` -`);(l&ir.DEPTH)!=0?(u&&e.set(pt.FRAGMENT_MAIN_IMAGE,`float depth = readDepth(UV); - - `+e.get(pt.FRAGMENT_MAIN_IMAGE)),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,c?(e.set(pt.FRAGMENT_MAIN_UV,`vec2 transformedUv = vUv; -`+e.get(pt.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")):n.set("UV","vUv"),e.forEach((f,p,m)=>m.set(p,f.trim().replace(/^#/,` -#`))),this.uniforms=i.size,this.varyings=a,this.skipRendering=o===0,this.needsSwap=!this.skipRendering;let d=this.getFullscreenMaterial();if(d.setShaderParts(e).setDefines(n).setUniforms(i),d.extensions={},s.size>0)for(let f of s)d.extensions[f]=!0;this.needsUpdate=!1}recompile(r){this.updateMaterial(),r!==void 0&&this.verifyResources(r)}getDepthTexture(){return this.getFullscreenMaterial().uniforms.depthBuffer.value}setDepthTexture(r,e=Kr){let t=this.getFullscreenMaterial();t.uniforms.depthBuffer.value=r,t.depthPacking=e,t.needsUpdate=!0;for(let n of this.effects)n.setDepthTexture(r,e)}render(r,e,t,n,i){let s=this.getFullscreenMaterial(),o=s.uniforms.time.value+n;this.needsUpdate&&this.recompile(r);for(let a of this.effects)a.update(r,e,n);(!this.skipRendering||this.renderToScreen)&&(s.uniforms.inputBuffer.value=e.texture,s.uniforms.time.value=o<=this.maxTime?o:this.minTime,r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera))}setSize(r,e){this.getFullscreenMaterial().setSize(r,e);for(let t of this.effects)t.setSize(r,e)}initialize(r,e,t){for(let n of this.effects)n.initialize(r,e,t),n.addEventListener("change",i=>this.handleEvent(i));if(this.updateMaterial(),this.verifyResources(r),t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}dispose(){super.dispose();for(let r of this.effects)r.dispose()}handleEvent(r){switch(r.type){case"change":this.needsUpdate=!0;break}}};var aF=class extends Wr{constructor({width:r=nr.AUTO_SIZE,height:e=nr.AUTO_SIZE,renderTarget:t,luminanceRange:n,colorOutput:i}={}){super("LuminancePass");this.setFullscreenMaterial(new I3(i,n)),this.needsSwap=!1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,format:i?zt:Qd,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1),this.resolution=new nr(this,r,e)}get texture(){return this.renderTarget.texture}render(r,e,t,n,i){let s=this.getFullscreenMaterial();s.uniforms.inputBuffer.value=e.texture,r.setRenderTarget(this.renderToScreen?null:this.renderTarget),r.render(this.scene,this.camera)}setSize(r,e){let t=this.resolution;t.base.set(r,e),this.renderTarget.setSize(t.width,t.height)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},lF=class extends Wr{constructor(r,e){super("MaskPass",r,e);this.needsSwap=!1,this.clearPass=new ig(!1,!1,!0),this.inverse=!1}get clear(){return this.clearPass.enabled}set clear(r){this.clearPass.enabled=r}render(r,e,t,n,i){let s=r.getContext(),o=r.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverse?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clear&&(this.renderToScreen?c.render(r,null):(c.render(r,e),c.render(r,t))),this.renderToScreen?(r.setRenderTarget(null),r.render(a,l)):(r.setRenderTarget(e),r.render(a,l),r.setRenderTarget(t),r.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}};var Xr=class extends Wr{constructor(r,e="inputBuffer"){super("ShaderPass");this.setFullscreenMaterial(r),this.uniform=null,this.setInput(e)}setInput(r){let e=this.getFullscreenMaterial();if(this.uniform=null,e!==null){let t=e.uniforms;t!==void 0&&t[r]!==void 0&&(this.uniform=t[r])}}render(r,e,t,n,i){this.uniform!==null&&e!==null&&(this.uniform.value=e.texture),r.setRenderTarget(this.renderToScreen?null:t),r.render(this.scene,this.camera)}initialize(r,e,t){if(t!==void 0&&t!==At){let n=this.getFullscreenMaterial();n.defines.FRAMEBUFFER_PRECISION_HIGH="1"}}},dM=class{constructor(r=null,{depthBuffer:e=!0,stencilBuffer:t=!1,alpha:n=!1,multisampling:i=0,frameBufferType:s}={}){this.renderer=r,this.inputBuffer=null,this.outputBuffer=null,this.renderer!==null&&(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(e,t,s,i),this.outputBuffer=this.inputBuffer.clone()),this.copyPass=new Xr(new sM),this.alpha=n,this.depthTexture=null,this.passes=[],this.autoRenderToScreen=!0}get multisampling(){return this.inputBuffer instanceof Zr?this.inputBuffer.samples:0}set multisampling(r){let e=this.inputBuffer,t=this.multisampling;t>0&&r>0?(this.inputBuffer.samples=r,this.outputBuffer.samples=r):t!==r&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,r),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getRenderer(){return this.renderer}replaceRenderer(r,e=!0){let t=this.renderer;if(t!==null&&t!==r){let n=t.getSize(new O),i=r.getSize(new O),s=t.domElement.parentNode;this.renderer=r,this.renderer.autoClear=!1,n.equals(i)||this.setSize(),e&&s!==null&&(s.removeChild(t.domElement),s.appendChild(r.domElement))}return t}createDepthTexture(){let r=this.depthTexture=new so;return this.inputBuffer.depthTexture=r,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(r.format=Ks,r.type=Ys):r.type=Wo,r}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let r of this.passes)r.setDepthTexture(null)}}createBuffer(r,e,t,n){let i=this.renderer,s=i.getContext(),o=i.getDrawingBufferSize(new O),l={format:!(this.alpha||s.getContextAttributes().alpha)&&t===At?Nt:zt,minFilter:$e,magFilter:$e,stencilBuffer:e,depthBuffer:r,type:t},c=n>0?new Zr(o.width,o.height,l):new bt(o.width,o.height,l);return n>0&&(c.samples=n),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}addPass(r,e){let t=this.passes,n=this.renderer,i=n.getDrawingBufferSize(new O),s=n.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(r.setSize(i.width,i.height),r.initialize(n,s,o),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),r.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,r):t.push(r),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),r.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let a=this.createDepthTexture();for(r of t)r.setDepthTexture(a)}else r.setDepthTexture(this.depthTexture)}removePass(r){let e=this.passes,t=e.indexOf(r);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){let s=(a,l)=>a||l.needsDepthTexture;e.reduce(s,!1)||(r.getDepthTexture()===this.depthTexture&&r.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(r.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){let r=this.passes;this.deleteDepthTexture(),r.length>0&&(this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!1),this.passes=[])}render(r){let e=this.renderer,t=this.copyPass,n=this.inputBuffer,i=this.outputBuffer,s=!1,o,a,l;for(let c of this.passes)c.enabled&&(c.render(e,n,i,r,s),c.needsSwap&&(s&&(t.renderToScreen=c.renderToScreen,o=e.getContext(),a=e.state.buffers.stencil,a.setFunc(o.NOTEQUAL,1,4294967295),t.render(e,n,i,r,s),a.setFunc(o.EQUAL,1,4294967295)),l=n,n=i,i=l),c instanceof lF?s=!0:c instanceof G3&&(s=!1))}setSize(r,e,t){let n=this.renderer;if(r===void 0||e===void 0){let s=n.getSize(new O);r=s.width,e=s.height}else n.setSize(r,e,t);let i=n.getDrawingBufferSize(new O);this.inputBuffer.setSize(i.width,i.height),this.outputBuffer.setSize(i.width,i.height);for(let s of this.passes)s.setSize(i.width,i.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let r of this.passes)r.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose()}};var cF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,fM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,resolutionScale:n=.5,intensity:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE,kernelSize:a=kd.LARGE}={}){super("BloomEffect",cF,{blendFunction:r,uniforms:new Map([["map",new Ae(null)],["intensity",new Ae(i)]])});this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.blurPass=new cM({resolutionScale:n,width:s,height:o,kernelSize:a}),this.blurPass.resolution.resizable=this,this.luminancePass=new aF({renderTarget:this.renderTarget,colorOutput:!0}),this.luminancePass.resolution=this.resolution,this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t}get texture(){return this.renderTarget.texture}get luminanceMaterial(){return this.luminancePass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get width(){return this.resolution.width}set width(r){this.resolution.width=r}get height(){return this.resolution.height}set height(r){this.resolution.height=r}get dithering(){return this.blurPass.dithering}set dithering(r){this.blurPass.dithering=r}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(r){this.blurPass.kernelSize=r}get distinction(){return console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead."),1}set distinction(r){console.warn(this.name,"The distinction field has been removed, use luminanceMaterial.threshold and luminanceMaterial.smoothing instead.")}get intensity(){return this.uniforms.get("intensity").value}set intensity(r){this.uniforms.get("intensity").value=r}getResolutionScale(){return this.resolution.scale}setResolutionScale(r){this.resolution.scale=r}update(r,e,t){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(r,e,n),this.blurPass.render(r,n,n)):this.blurPass.render(r,e,n)}setSize(r,e){this.blurPass.setSize(r,e),this.renderTarget.setSize(this.resolution.width,this.resolution.height)}initialize(r,e,t){this.blurPass.initialize(r,e,t),!e&&t===At&&(this.renderTarget.texture.format=Nt),t!==void 0&&(this.renderTarget.texture.type=t)}};var uF="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",pM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,brightness:e=0,contrast:t=0}={}){super("BrightnessContrastEffect",uF,{blendFunction:r,uniforms:new Map([["brightness",new Ae(e)],["contrast",new Ae(t)]])})}},hF="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float sum=inputColor.r+inputColor.g+inputColor.b;outputColor=vec4(vec3(sum/3.0),inputColor.a);}",mM=class extends Mr{constructor(r=ut.NORMAL){super("ColorAverageEffect",hF,{blendFunction:r})}};var dF=`varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 color=inputColor; -#ifdef ALPHA -vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;color.r=ra.x;color.b=ba.x;color.a=max(max(ra.y,ba.y),inputColor.a); -#else -color.r=texture2D(inputBuffer,vUvR).r;color.b=texture2D(inputBuffer,vUvB).b; -#endif -outputColor=color;}`,fF="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vUvR=uv+offset;vUvB=uv-offset;}",gM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,offset:e=new O(.001,5e-4)}={}){super("ChromaticAberrationEffect",dF,{vertexShader:fF,blendFunction:r,attributes:ir.CONVOLUTION,uniforms:new Map([["offset",new Ae(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(r){this.uniforms.get("offset").value=r}initialize(r,e,t){e?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA")}};var pF=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; -#else -uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; -#endif -uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,yM=class extends Mr{constructor(r,{blendFunction:e=ut.NORMAL,focusDistance:t=0,focalLength:n=.1,bokehScale:i=1,width:s=nr.AUTO_SIZE,height:o=nr.AUTO_SIZE}={}){super("DepthOfFieldEffect",pF,{blendFunction:e,attributes:ir.DEPTH,uniforms:new Map([["nearColorBuffer",new Ae(null)],["farColorBuffer",new Ae(null)],["nearCoCBuffer",new Ae(null)],["scale",new Ae(1)]])});this.camera=r,this.renderTarget=new bt(1,1,{minFilter:$e,magFilter:$e,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.format=Nt,this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new Xr(new x3(r));let a=this.circleOfConfusionMaterial;a.uniforms.focusDistance.value=t,a.uniforms.focalLength.value=n,this.blurPass=new cM({width:s,height:o,kernelSize:kd.MEDIUM}),this.blurPass.resolution.resizable=this,this.maskPass=new Xr(new D3(this.renderTargetCoC.texture));let l=this.maskPass.getFullscreenMaterial();l.maskFunction=aM.MULTIPLY,l.colorChannel=iM.GREEN,this.bokehNearBasePass=new Xr(new Ud(!1,!0)),this.bokehNearFillPass=new Xr(new Ud(!0,!0)),this.bokehFarBasePass=new Xr(new Ud(!1,!1)),this.bokehFarFillPass=new Xr(new Ud(!0,!1)),this.bokehScale=i,this.target=null}get circleOfConfusionMaterial(){return this.cocPass.getFullscreenMaterial()}get resolution(){return this.blurPass.resolution}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(r){[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].map(t=>t.getFullscreenMaterial().uniforms.scale).forEach(t=>{t.value=r}),this.maskPass.getFullscreenMaterial().uniforms.strength.value=r,this.uniforms.get("scale").value=r}calculateFocusDistance(r){let e=this.camera,t=e.far-e.near,n=e.position.distanceTo(r);return Math.min(Math.max(n/t,0),1)}setDepthTexture(r,e=Kr){let t=this.circleOfConfusionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){let n=this.renderTarget,i=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked,a=this.bokehFarBasePass,l=this.bokehFarFillPass,c=a.getFullscreenMaterial().uniforms,u=l.getFullscreenMaterial().uniforms,h=this.bokehNearBasePass,d=this.bokehNearFillPass,f=h.getFullscreenMaterial().uniforms,p=d.getFullscreenMaterial().uniforms;if(this.target!==null){let m=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.uniforms.focusDistance.value=m}this.cocPass.render(r,null,i),this.blurPass.render(r,i,s),this.maskPass.render(r,e,o),c.cocBuffer.value=u.cocBuffer.value=i.texture,a.render(r,o,n),l.render(r,n,this.renderTargetFar),f.cocBuffer.value=p.cocBuffer.value=s.texture,h.render(r,e,n),d.render(r,n,this.renderTargetNear)}setSize(r,e){let t=this.resolution,n=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];n.push(this.renderTargetCoC,this.renderTargetMasked),n.forEach(a=>a.setSize(r,e));let i=t.width,s=t.height;n=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],n.forEach(a=>a.setSize(i,s)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(a=>a.getFullscreenMaterial().setTexelSize(1/i,1/s))}initialize(r,e,t){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(i=>i.initialize(r,e,t)),this.blurPass.initialize(r,e,At),!e&&t===At&&(this.renderTargetNear.texture.type=Nt),t!==void 0&&(this.renderTarget.texture.type=t,this.renderTargetNear.texture.type=t,this.renderTargetFar.texture.type=t,this.renderTargetMasked.texture.type=t)}};var P$=new M,D$=new me;var mF="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",vM=class extends Mr{constructor({blendFunction:r=ut.NORMAL,hue:e=0,saturation:t=0}={}){super("HueSaturationEffect",mF,{blendFunction:r,uniforms:new Map([["hue",new Ae(new M)],["saturation",new Ae(t)]])});this.setHue(e)}setHue(r){let e=Math.sin(r),t=Math.cos(r);this.uniforms.get("hue").value.set(2*t,-Math.sqrt(3)*e-t,Math.sqrt(3)*e-t).addScalar(1).divideScalar(3)}};var O$=new fe;var gF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); -#ifdef PREMULTIPLY -outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); -#else -outputColor=vec4(noise,inputColor.a); -#endif -}`,xM=class extends Mr{constructor({blendFunction:r=ut.SCREEN,premultiply:e=!1}={}){super("NoiseEffect",gF,{blendFunction:r});this.premultiply=e}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(r){this.premultiply!==r&&(r?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}};var yF="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",bM=class extends Mr{constructor(r=30){super("PixelationEffect",yF,{uniforms:new Map([["active",new Ae(!1)],["d",new Ae(new O)]])});this.resolution=new O,this.granularity=r}getGranularity(){return this.granularity}setGranularity(r){r=Math.floor(r),r%2>0&&(r+=1);let e=this.uniforms;e.get("active").value=r>0,e.get("d").value.set(r,r).divide(this.resolution),this.granularity=r}setSize(r,e){this.resolution.set(r,e),this.setGranularity(this.granularity)}};var G$=Math.PI*.5,U$=new M,k$=new M;var wM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70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FCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",vF="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",xF="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",MM=class extends Mr{constructor(r,e,t=Uo.HIGH,n=Vd.COLOR){super("SMAAEffect",vF,{vertexShader:xF,blendFunction:ut.NORMAL,attributes:ir.CONVOLUTION|ir.DEPTH,uniforms:new Map([["weightMap",new Ae(null)]])});this.renderTargetEdges=new bt(1,1,{minFilter:$e,stencilBuffer:!1,depthBuffer:!1,format:Nt}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.renderTargetWeights.texture.format=zt,this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new ig(!0,!1,!1),this.clearPass.overrideClearColor=new fe(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Xr(new T3(new O,n)),this.weightsPass=new Xr(new O3);let i=new xt(r);i.name="SMAA.Search",i.magFilter=Pt,i.minFilter=Pt,i.format=zt,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!0;let s=new xt(e);s.name="SMAA.Area",s.magFilter=$e,s.minFilter=$e,s.format=zt,s.generateMipmaps=!1,s.needsUpdate=!0,s.flipY=!1;let o=this.weightsPass.getFullscreenMaterial();o.uniforms.searchTexture.value=i,o.uniforms.areaTexture.value=s,this.applyPreset(t)}get edgeDetectionMaterial(){return this.edgeDetectionPass.getFullscreenMaterial()}get colorEdgesMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.getFullscreenMaterial()}setEdgeDetectionThreshold(r){this.edgeDetectionPass.getFullscreenMaterial().setEdgeDetectionThreshold(r)}setOrthogonalSearchSteps(r){this.weightsPass.getFullscreenMaterial().setOrthogonalSearchSteps(r)}applyPreset(r){let e=this.edgeDetectionMaterial,t=this.weightsMaterial;switch(r){case Uo.LOW:e.setEdgeDetectionThreshold(.15),t.setOrthogonalSearchSteps(4),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.MEDIUM:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(8),t.diagonalDetection=!1,t.cornerRounding=!1;break;case Uo.HIGH:e.setEdgeDetectionThreshold(.1),t.setOrthogonalSearchSteps(16),t.setDiagonalSearchSteps(8),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break;case Uo.ULTRA:e.setEdgeDetectionThreshold(.05),t.setOrthogonalSearchSteps(32),t.setDiagonalSearchSteps(16),t.setCornerRounding(25),t.diagonalDetection=!0,t.cornerRounding=!0;break}}setDepthTexture(r,e=Kr){let t=this.edgeDetectionMaterial;t.uniforms.depthBuffer.value=r,t.depthPacking=e}update(r,e,t){this.clearPass.render(r,this.renderTargetEdges),this.edgeDetectionPass.render(r,e,this.renderTargetEdges),this.weightsPass.render(r,this.renderTargetEdges,this.renderTargetWeights)}setSize(r,e){let t=this.edgeDetectionPass.getFullscreenMaterial(),n=this.weightsPass.getFullscreenMaterial();this.renderTargetEdges.setSize(r,e),this.renderTargetWeights.setSize(r,e),n.uniforms.resolution.value.set(r,e),n.uniforms.texelSize.value.set(1/r,1/e),t.uniforms.texelSize.value.copy(n.uniforms.texelSize.value)}dispose(){let r=this.weightsPass.getFullscreenMaterial().uniforms;r.searchTexture.value.dispose(),r.areaTexture.value.dispose(),super.dispose()}static get searchImageDataURL(){return wM}static get areaImageDataURL(){return SM}},Uo={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3};var bF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#ifdef ESKIL -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#else -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#endif -outputColor=vec4(color,inputColor.a);}`,AM=class extends Mr{constructor(r={}){let e=Object.assign({blendFunction:ut.NORMAL,eskil:!1,offset:.5,darkness:.5},r);super("VignetteEffect",bF,{blendFunction:e.blendFunction,uniforms:new Map([["offset",new Ae(e.offset)],["darkness",new Ae(e.darkness)]])});this.eskil=e.eskil}get eskil(){return this.defines.has("ESKIL")}set eskil(r){this.eskil!==r&&(r?this.defines.set("ESKIL","1"):this.defines.delete("ESKIL"),this.setChanged())}},j$=[new Float32Array(3),new Float32Array(3)],W$=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],J$=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];var X$=[new Float32Array(2),new Float32Array(2)];var q$=new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),Y$=[new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125])],K$=[new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4])],Q$=[new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3])];var Z$=new Map([[Hn(0,0,0,0),new Float32Array([0,0,0,0])],[Hn(0,0,0,1),new Float32Array([0,0,0,1])],[Hn(0,0,1,0),new Float32Array([0,0,1,0])],[Hn(0,0,1,1),new Float32Array([0,0,1,1])],[Hn(0,1,0,0),new Float32Array([0,1,0,0])],[Hn(0,1,0,1),new Float32Array([0,1,0,1])],[Hn(0,1,1,0),new Float32Array([0,1,1,0])],[Hn(0,1,1,1),new Float32Array([0,1,1,1])],[Hn(1,0,0,0),new Float32Array([1,0,0,0])],[Hn(1,0,0,1),new Float32Array([1,0,0,1])],[Hn(1,0,1,0),new Float32Array([1,0,1,0])],[Hn(1,0,1,1),new Float32Array([1,0,1,1])],[Hn(1,1,0,0),new Float32Array([1,1,0,0])],[Hn(1,1,0,1),new Float32Array([1,1,0,1])],[Hn(1,1,1,0),new Float32Array([1,1,1,0])],[Hn(1,1,1,1),new Float32Array([1,1,1,1])]]);function ag(r,e,t){return r+(e-r)*t}function Hn(r,e,t,n){let i=ag(r,e,1-.25),s=ag(t,n,1-.25);return ag(i,s,1-.125)}var _M=class extends fn{load(r=()=>{},e=null){arguments.length===4?(r=arguments[1],e=arguments[3]):(arguments.length===3||typeof arguments[0]!="function")&&(r=arguments[1],e=null);let t=this.manager,n=new yo;return new Promise((i,s)=>{let o=new Image,a=new Image;n.onError=l=>{t.itemError(l),e!==null?(e(`Failed to load ${l}`),i()):s(`Failed to load ${l}`)},n.onLoad=()=>{let l=[o,a];r(l),i(l)},o.addEventListener("error",l=>{n.itemError("smaa-search")}),a.addEventListener("error",l=>{n.itemError("smaa-area")}),o.addEventListener("load",()=>{t.itemEnd("smaa-search"),n.itemEnd("smaa-search")}),a.addEventListener("load",()=>{t.itemEnd("smaa-area"),n.itemEnd("smaa-area")}),t.itemStart("smaa-search"),t.itemStart("smaa-area"),n.itemStart("smaa-search"),n.itemStart("smaa-area"),o.src=wM,a.src=SM})}};var hn=class{constructor(e,t){this.enabled=!1;this.effect=new e(t),Object.defineProperty(this,"opacity",{enumerable:!0,set(n){this.effect.blendMode.opacity.value=n},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(n){this.effect.blendMode.setBlendFunction(Number(n))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=ut.NORMAL}toJSON(){let e=["constructor","effect","subscriptions"],t=Ue({},this),n=Object.getPrototypeOf(this),i=Object.getOwnPropertyNames(n);for(let s of i){let o=Object.getOwnPropertyDescriptor(n,s);o&&typeof o.get=="function"&&(t[s]=this[s])}return e.forEach(s=>delete t[s]),t}};var ru=class extends hn{constructor(){super(fM);this.blendFunction=ut.SCREEN}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};var su=class extends hn{constructor(){super(pM)}set contrast(e){this.effect.uniforms.get("contrast").value=e}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(e){this.effect.uniforms.get("brightness").value=e}get brightness(){return this.effect.uniforms.get("brightness").value}};var ou=class extends hn{constructor(){super(gM);this.effect.offset=new O(.01,.01)}set offset(e){this.effect.offset.set(e[0]/1e3,e[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}};var au=class extends hn{constructor(){super(mM)}};var lu=class extends hn{constructor(){super(vM);this._hue=0}set hue(e){this._hue=e,this.effect.setHue(e)}get hue(){return this._hue}set saturation(e){this.effect.uniforms.get("saturation").value=e}get saturation(){return this.effect.uniforms.get("saturation").value}};var cu=class extends hn{constructor(){super(xM);this.blendFunction=ut.OVERLAY}};var uu=class extends hn{constructor(){super(AM)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};var hu=class extends hn{constructor(e){super(yM,e)}set focalLength(e){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=e}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(e){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=e}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(e){this.effect.bokehScale=e}};var du=class extends hn{constructor(){super(bM)}get granularity(){return this.effect.getGranularity()}set granularity(e){this.effect.setGranularity(e)}};function TM(r,e){return e&&e.enabled&&r.push(e.effect),r}var fu=class{constructor(){this._scene=new An;this._camera=new Sr;this.effects=new Map;this.loadingManager=new yo;this.smaaImageLoader=new _M(this.loadingManager);this.renderPass=new sg;this._renderToScreen=!0;this.clock=new Ep,this.enabled=!1,this.debug=!1,this.effects.set("bloom",new ru),this.effects.set("chromaticAberration",new ou),this.effects.set("vignette",new uu),this.effects.set("noise",new cu),this.effects.set("colorAverage",new au),this.effects.set("hueSaturation",new lu),this.effects.set("brightnessContrast",new su),this.effects.set("depthOfField",new hu),this.effects.set("pixelation",new du)}get scene(){return this._scene}set scene(e){this._scene=e,this._initPasses()}get camera(){return this._camera}set camera(e){this._camera=e,this._initPasses()}_initSmaa(){let e=this.effectComposer.passes.length;this.smaaImageLoader.load(([t,n])=>{if(!this.effectComposer)return;let i=new MM(t,n,Uo.ULTRA,Vd.COLOR);i.edgeDetectionMaterial.setPredicationMode(oM.DEPTH),i.edgeDetectionMaterial.setEdgeDetectionThreshold(.05),i.edgeDetectionMaterial.setPredicationThreshold(.002),i.edgeDetectionMaterial.setPredicationScale(1),this.effectComposer.addPass(new Hd(this.camera,i),e)})}_initPasses(){if(!(!this.effectComposer||!this.renderer))if(this.effectComposer.removeAllPasses(),this.renderPass=new sg(this.scene,this.camera),this.enabled){this.effectComposer.addPass(this.renderPass),this._initSmaa();let e=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(TM,[]),t=[this.effects.get("pixelation")].reduce(TM,[]);t.length>0&&this.effectComposer.addPass(new Hd(this.camera,...t)),this.effectComposer.addPass(new Hd(this.camera,...e))}else this.effectComposer.addPass(this.renderPass)}reinit(){!this.renderer||(this.effectComposer=new dM(this.renderer),this._initPasses())}init({renderer:e,camera:t,scene:n}){this.renderer=e,this.scene=n,this.camera=t,this._initSavePass(),this.reinit()}_initSavePass(){if(this._savePass)return;let e=new O;this.renderer.getDrawingBufferSize(e);let t=this.renderer.capabilities.isWebGL2?Zr:bt;this._rt=new t(e.x,e.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:di,wrapT:di}),this._savePass=new lM(this._rt,!1),this._savePass.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(e){var n,i;let t=this.effectComposer;!t||(e===!0?(((n=this.renderer)==null?void 0:n.capabilities.isWebGL2)&&(t.multisampling=0),t.removePass(this._savePass),t.passes[t.passes.length-1].renderToScreen=!0,t.autoRenderToScreen=!0):(((i=this.renderer)==null?void 0:i.capabilities.isWebGL2)&&(t.multisampling=4),t.autoRenderToScreen=!1,t.passes[t.passes.length-1].renderToScreen=!1,this._savePass.renderToScreen=!1,t.addPass(this._savePass)),this._renderToScreen=e)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}fromJSON(e){e&&(Object.keys(e).forEach(t=>{let n=e[t],i=this.effects.get(t);Object.keys(n).forEach(s=>{i[s]=n[s]})}),this.enabled=e.enabled)}toJSON(){let e={};return this.effects.forEach((t,n)=>{e[n]=t.toJSON()},e),Ue({enabled:this.enabled},e)}render(){var e;(e=this.effectComposer)==null||e.render(this.clock.getDelta())}setScissor(e,t,n,i){if(!this.effectComposer||!this.renderer)return;e instanceof Qe?(this.effectComposer.inputBuffer.scissor.set(e.x,e.y,e.z,e.w),this.effectComposer.outputBuffer.scissor.set(e.x,e.y,e.z,e.w)):(this.effectComposer.inputBuffer.scissor.set(e,t,n,i),this.effectComposer.outputBuffer.scissor.set(e,t,n,i));let s=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(s),this.effectComposer.outputBuffer.scissor.multiplyScalar(s),this.renderer.setScissor(e,t,n,i)}setScissorTest(e){!this.effectComposer||!this.renderer||(this.effectComposer.inputBuffer.scissorTest=e,this.effectComposer.outputBuffer.scissorTest=e,this.renderer.setScissorTest(e))}setViewport(e,t,n,i){!this.effectComposer||(e instanceof Qe?(this.effectComposer.inputBuffer.viewport.copy(e),this.effectComposer.outputBuffer.viewport.copy(e)):(this.effectComposer.inputBuffer.viewport.set(e,t,n,i),this.effectComposer.outputBuffer.viewport.set(e,t,n,i)))}resize(e,t){var n,i;if((n=this.effectComposer)==null||n.setSize(e,t),this._rt){let s=((i=this.renderer)==null?void 0:i.getPixelRatio())||window.devicePixelRatio;this._rt.setSize(e*s,t*s)}}};var EM;(function(e){function r(t){new Qe(t.r/255,t.g/255,t.b/255,t.a)}e.getThreeVector4=r})(EM||(EM={}));var jd;(function(t){function r(n,i){n.setRGB(i.r/255,i.g/255,i.b/255)}t.setThreeColor=r;function e(n){return new fe(n.r/255,n.g/255,n.b/255).getHex()}t.getHex=e})(jd||(jd={}));var zs=class extends Ld(An){constructor(){super();this.objectType="Scene";this.alpha=1;this.backupFog=new hs(16777215,.1,2e3);this.fogUseBGColor=!1;this.directionalLightState=!0;this.ambientLightState=!0;this.wireframeState=!1;this._color=new fe(1644825);this.canvas={mode:1,preset:"fullscreen",size:{width:512,height:512},editorSize:{width:1,height:1},color:[0,0,0,.5]};this.name="Untitled",this.postprocessing=new fu}get color(){return this._color}set color(e){this.fogUseBGColor===!0&&this.backupFog.color.copy(e),this._color.copy(e)}get enableFog(){return this.fog!==null}set enableFog(e){this.fog=e===!0?this.backupFog:null}init(e,t){this.camera=new Sr(e,t),this.camera.setDefault(),this.camera.orthoCamera.near=-5e4,this.camera.perspCamera.near=50,this.camera.orthoCamera.far=1e5,this.camera.perspCamera.far=1e5,this.camera.updateProjectionMatrix(),this.camera.position.set(0,0,Sr.DefaultTargetOffset),this.camera.lookAt(new M(0,0,-1)),this.add(this.camera),this.canvas.size.width=e,this.canvas.size.height=t,this.ambientLight=new uc(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.add(this.ambientLight),this.directionalLight=new Fr(16777215,.75),this.directionalLight.name="Default Directional Light",this.directionalLight.position.set(85e4,13e5,1e6),this.activeCamera=this.camera,this.activeCamera.add(this.directionalLight)}initFromObjectLoader(e){return this.traverse(t=>{t.uuid===e.ambientLight?this.ambientLight=t:t.uuid===e.directionalLight?this.directionalLight=t:(t.uuid===e.activeCamera&&(this.activeCamera=t),t.uuid===e.camera&&(this.camera=t,this.camera.setDefault()))}),this}raycast(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&((ai(s)||Hh(s)&&s.enableHelper&&s.objectHelper.parent)&&e.intersectObject(s,!1,t),n(s))};return n(this),t}traverseEntity(e){for(let t of this.children)ei(t)&&this.camera!==t&&t.traverseEntity(e)}updateFog(e){this.enableFog=e.enabled,this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.color):jd.setThreeColor(this.backupFog.color,e.color),this.backupFog.near=e.near,this.backupFog.far=e.far}toJSON(e){var i,s,o,a,l;let t=super.toJSON(e),n=t.object;return n.objectType="Scene",n.activeCamera=(i=this.activeCamera)==null?void 0:i.uuid,n.camera=(s=this.camera)==null?void 0:s.uuid,n.directionalLight=(o=this.directionalLight)==null?void 0:o.uuid,n.ambientLight=(a=this.ambientLight)==null?void 0:a.uuid,n.color=this.color.toArray(),n.alpha=this.alpha,this.background instanceof xt?n.background=this.background.toJSON(e):this.background instanceof fe&&(n.background=this.background.toArray()),this.environment!==null&&(n.environment=this.environment.toJSON(e)),this.enableFog===!0&&(n.enableFog=!0,this.fogUseBGColor===!0&&(n.fogUseBGColor=!0),this.fog!==null&&(n.fog=this.fog.toJSON())),this.directionalLightState===!0&&(n.directionalLightState=!0),this.ambientLightState===!0&&(n.ambientLightState=!0),this.wireframeState===!0&&(n.wireframeState=!0),n.canvas={mode:this.canvas.mode,preset:this.canvas.preset,editorSize:{width:window.innerWidth,height:window.innerHeight},color:this.canvas.color},this.canvas.mode!==1&&(n.canvas.size={width:this.canvas.size.width,height:this.canvas.size.height}),n.postprocessing=(l=this.postprocessing)==null?void 0:l.toJSON(),t}fromJSON(e){var n,i,s,o,a;super.fromJSON(e),this.postprocessing=new fu,this.color.fromArray(e.color),this.alpha=e.alpha,e.background!==void 0&&Array.isArray(e.background)&&(this.background=new fe().fromArray(e.background)),e.fog!==void 0&&(e.fog.type==="FogExp2"?this.backupFog=new io(e.fog.color,e.fog.density):this.backupFog=new hs(e.fog.color,e.fog.near,e.fog.far)),this.fogUseBGColor=(n=e.fogUseBGColor)!=null?n:!1,this.enableFog=(i=e.enableFog)!=null?i:!1,this.directionalLightState=(s=e.directionalLightState)!=null?s:!1,this.ambientLightState=(o=e.ambientLightState)!=null?o:!1,this.wireframeState=(a=e.wireframeState)!=null?a:!1;let t=e.canvas;return this.canvas.mode=t.mode,this.canvas.preset=t.preset,t.size&&(this.canvas.size={width:t.size.width,height:t.size.height}),this.canvas.editorSize=t.editorSize?{width:t.editorSize.width,height:t.editorSize.height}:{width:window.innerWidth,height:window.innerHeight},t.color&&(this.canvas.color=[...t.color]),this.postprocessing.fromJSON(e.postprocessing),this}dispose(){this.traverseEntity(e=>{"geometry"in e&&e.geometry.dispose(),"material"in e&&(e.material instanceof Array?e.material.forEach(t=>t.dispose()):e.material.dispose())})}};var lg=class extends je{constructor(e="",t){super(t);this.nodeType="Attribute";this.name=e}getAttributeType(e){return typeof this.type=="number"?e.getConstructorFromLength(this.type):this.type}getType(e){let t=this.getAttributeType(e);return e.getTypeByFormat(t)}generate(e,t,n,i,s){i=this.getAttributeType(e);let o=e.getAttribute(this.name,i),a=e.isShader("vertex")?this.name:o.varying.name;return e.format(a,this.getType(e),t)}toJSON(e){let t=super.toJSON(e);return t.nodeType=this.nodeType,t.name=this.name,t}fromJSON(e,t){return super.fromJSON(e,t),e.scope&&(this.scope=e.scope),e.name&&(this.name=e.name),this}};var cg=class extends ze{constructor(e="",t=0){super(e);this.nodeType="Varying";this.value=t}getType(e){return e.getTypeByFormat(this.type)}generate(e,t,n,i,s){let o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)}copy(e){return super.copy(e),this.value=e.value,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.value&&(t.value=this.value)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.value&&(this.value=e.value),this}};var ug=class extends Ct{constructor(e){super("m4");this.nodeType="Matrix4";this.value=e!=null?e:new me}generateReadonly(e,t,n,i,s,o){return e.format("mat4("+this.value.elements.join(", ")+")",i,t)}copy(e){return super.copy(e),this.elements=e.elements,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.elements=this.value.elements.concat()),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.elements&&(this.elements=e.elements),this}get elements(){return this.value.elements}set elements(e){this.value.fromArray(e)}};var Ar;(function(l){l.EQUAL="==",l.NOT_EQUAL="!=",l.GREATER=">",l.GREATER_EQUAL=">=",l.LESS="<",l.LESS_EQUAL="<=",l.AND="&&",l.OR="||"})(Ar||(Ar={}));var hg=class extends je{constructor(e=new ze,t=new ze,n=hg.GREATER,i=new ze,s=new ze){super();this.nodeType="Cond";this.a=e,this.b=t,this.op=n,this.ifNode=i,this.elseNode=s}getType(e){if(this.ifNode){let t=this.ifNode.getType(e),n=this.elseNode.getType(e);return e.getTypeLength(n)>e.getTypeLength(t)?n:t}return"b"}getCondType(e){return e.getTypeLength(this.b.getType(e))>e.getTypeLength(this.a.getType(e))?this.b.getType(e):this.a.getType(e)}generate(e,t){let n=this.getType(e),i=this.getCondType(e),s=this.a.build(e,i),o=this.b.build(e,i),a;if(this.type=n,this.ifNode){let l=this.ifNode.build(e,n),c=this.elseNode.build(e,n);a="( "+[s,this.op,o,"?",l,":",c].join(" ")+" )"}else a="( "+s+" "+this.op+" "+o+" )";return e.format(a,this.getType(e),t)}copy(e){return super.copy(e),this.a.copy(e.a),this.b.copy(e.b),this.op=e.op,this.ifNode.copy(e.ifNode),this.elseNode.copy(e.elseNode),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.a=this.a.toJSON(e).uuid,t.b=this.b.toJSON(e).uuid,t.op=this.op,this.ifNode&&(t.ifNode=this.ifNode.toJSON(e).uuid),this.elseNode&&(t.elseNode=this.elseNode.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.a&&(this.a=t.getNode(e.a)),e.b&&(this.b=t.getNode(e.b)),e.op&&(this.op=e.op),e.ifNode&&(this.ifNode=t.getNode(e.ifNode)),e.elseNode&&(this.elseNode=t.getNode(e.elseNode)),this}},rr=hg;rr.EQUAL=Ar.EQUAL,rr.NOT_EQUAL=Ar.NOT_EQUAL,rr.GREATER=Ar.GREATER,rr.GREATER_EQUAL=Ar.GREATER_EQUAL,rr.LESS=Ar.LESS,rr.LESS_EQUAL=Ar.LESS_EQUAL,rr.AND=Ar.AND,rr.OR=Ar.OR;var Tl=class extends Te{constructor(e){super();this.nodeType="MaxMIPLevel";this.texture=e,this.maxMIPLevel=0}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),t.maxMIPLevel=this.maxMIPLevel),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel!==void 0&&(this.maxMIPLevel=e.maxMIPLevel),this}};Object.defineProperties(Tl.prototype,{value:{get:function(){if(this.maxMIPLevel===0){let r=this.texture.value.image;Array.isArray(r)&&(r=r[0]),this.maxMIPLevel=r!==void 0?Math.log(Math.max(r.width,r.height))*Math.LOG2E:0}return this.maxMIPLevel},set:function(){}}});var dg=class extends je{constructor(e=new ze,t){super("f");this.nodeType="SpecularMIPLevel";this.roughness=e,this.texture=t}setTexture(e){return this.texture=e,this}generate(e,t){var n;if(e.isShader("fragment")){this.maxMIPLevel=(n=this.maxMIPLevel)!=null?n:new Tl,this.maxMIPLevel.texture=this.texture;let i=e.include(dg.Nodes.getSpecularMIPLevel);return e.format(i+"( "+this.roughness.build(e,"f")+", "+this.maxMIPLevel.build(e,"f")+" )",this.type,t)}else return console.warn("SpecularMIPLevelNode is not compatible with "+e.shader+" shader."),e.format("0.0",this.type,t)}copy(e){return super.copy(e),this.roughness=e.roughness,e.texture?this.texture?this.texture.copy(e.texture):this.texture=e.texture.clone():this.texture=void 0,e.maxMIPLevel?this.maxMIPLevel?this.maxMIPLevel.copy(e.maxMIPLevel):this.maxMIPLevel=e.maxMIPLevel.clone():this.maxMIPLevel=void 0,this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),this.texture&&(t.texture=this.texture.toJSON(e).uuid),this.roughness&&(t.roughness=this.roughness.toJSON(e).uuid),this.maxMIPLevel&&(t.maxMIPLevel=this.maxMIPLevel.toJSON(e).uuid)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.roughness&&(this.roughness=t.getNode(e.roughness)),e.texture&&(this.texture=t.getNode(e.texture)),e.maxMIPLevel&&(this.maxMIPLevel=t.getNode(e.maxMIPLevel)),this}},Wd=dg;Wd.Nodes=function(){return{getSpecularMIPLevel:new Le(["float getSpecularMIPLevel( const in float roughness, const in float maxMIPLevelScalar ) {"," float sigma = PI * roughness * roughness / ( 1.0 + roughness );"," float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );"," return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );","}"].join(` -`))}}();var NM={Int:it,Float:Te,Bool:mc,Vector2:In,Vector3:Un,Vector4:yc,Matrix3:zr,Matrix4:ug,FloatArray:Ba,Vector4Array:Ra,Normal:mn,Position:_n,Reflect:Qi,UV:bo,Attribute:lg,Const:rt,Struct:Ao,Varying:cg,SpecularMIPLevel:Wd,MaxMIPLevel:Tl,ColorSpace:Bt,Noise:Wa,TextureCubeUV:_o,TextureCube:vc,Operator:Yn,Math:Ye,Cond:rr,Fresnel:Ga,Rainbow:ka,Transmission:Va,Depth:qa,Blend:Xa,Raw:Qa,CubeTexture:xc,Texture:kn,CustomTexture:za,VertexDisplacement:Mo,CustomNormal:Ha,Gradient:ja,Matcap:Ya,Expression:yt,Color:ct,Phong:wc,Basic:bc,Lambert:Sc,Standard:Tc,Toon:Ac};var Jd=class{constructor(){this._nodes={};this._dataNodes={};this._textures={};this.uuid=Ee.generateUUID()}init(e,t){this._dataNodes=e,this._textures=t}clear(){this._nodes={},this._dataNodes={},this._textures={}}getNode(e){let t=this._nodes[e];return t||(t=this.createNode(e)),t}getNodeData(e){return this._dataNodes[e]}getTexture(e){let t=this._textures[e];return t||new bi}createNode(e){let t=this._dataNodes[e];if(!t)throw new Error("Failed to create Node from uuid: "+e+", its data does not seem to exist");let n=NM[t.nodeType];if(!n)throw new Error("Failed to create Node from uuid: "+e+" and nodeType: "+t.nodeType+", constructor for this not is not registered");let i=new n().fromJSON(t,this);return this._nodes[e]=i,i}};function CM(r){wF(r.geometries),SF(r.interactionStates),LM(r.object),MF(r.materials)}function wF(r){var e;if(r!==void 0){for(let t of r)if(((e=t.userData)==null?void 0:e.type)!==void 0){let n=t.userData.parameters;"extrudeDepth"in n||Object.assign(n,{extrudeDepth:0}),"extrudeBevelSize"in n||Object.assign(n,{extrudeBevelSize:0}),"extrudeBevelSegments"in n||Object.assign(n,{extrudeBevelSegments:1})}}}function SF(r){if(r!==void 0){for(let e of r)if(e.quaternion!==void 0){let t=new Tt().fromArray(e.quaternion);Object.assign(e,{rotation:new On().setFromQuaternion(t).toArray()})}}}function LM(r){var e,t,n,i;if(((e=r.userData)==null?void 0:e.type)===void 0)if(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera"){let s=r;Object.assign(r,{objectType:"CombinedCamera",cameraType:s.type,isDefaultCamera:!0,hiddenMatrix:new me().toArray(),name:"Default Camera",far:1e5,zoomOrtho:s.zoom,zoomPersp:1,nearOrtho:-5e4,nearPersp:50}),delete r.type,s.typeCamera!==void 0&&(Object.assign(r,{cameraType:s.typeCamera}),delete r.typeCamera)}else r.type==="Scene"?(Object.assign(r,{objectType:r.type}),delete r.type):r.type==="HemisphereLight"?Object.assign(r,{isDefaultAmbientLight:!0}):r.type==="DirectionalLight"&&Object.assign(r,{isDefaultDirectionalLight:!0});if(r.userData!==void 0){let s=r.userData;s.type!==void 0&&(Object.assign(r,{objectType:s.type}),delete s.type),s.interaction!==void 0&&(Object.assign(r,{interaction:s.interaction}),delete s.interaction),s.isDefaultAmbientLight===!0?(Object.assign(r,{isDefaultAmbientLight:!0}),delete s.isDefaultAmbientLight):s.isDefaultDirectionalLight===!0?(Object.assign(r,{isDefaultDirectionalLight:!0}),delete s.isDefaultDirectionalLight):s.isDefaultCamera===!0&&(Object.assign(r,{isDefaultCamera:!0}),delete s.isDefaultCamera),Object.assign(r,{raycastLock:s.lock,scaleLock:s.scaleLock,hiddenMatrix:(n=(t=s.hiddenMatrix)==null?void 0:t.elements)!=null?n:new me().toArray()}),delete s.lock,delete s.scaleLock,delete s.hiddenMatrix,delete s.isEntity}if(((i=r.interaction)==null?void 0:i.events)!==void 0){for(let s of r.interaction.events)if(s.targets!==void 0)for(let o of s.targets)o.springControls!==void 0&&(Object.assign(o,{springParameters:{mass:o.springControls[0],stiffness:o.springControls[1],damping:o.springControls[2],velocity:o.springControls[3]}}),delete o.springControls)}if(r.children!==void 0)for(let s of r.children)LM(s)}function MF(r){if(r!==void 0)for(let e of r){let n=e.userData.layers.head;for(;n;){for(let i in n.uniforms){let s=`f${n.id}_tex`,o=`f${n.id}_texture`;i===s&&(n.uniforms[o]=n.uniforms[s],delete n.uniforms[s])}n=n.next}}}function IM(r){PM(r.object,r.object)}function PM(r,e){var t;if(r.type==="HemisphereLight"||r.isDefaultAmbientLight===!0?e.ambientLight=r.uuid:((t=r.userData)==null?void 0:t.isDefaultDirectionalLight)===!0||r.isDefaultDirectionalLight===!0?e.directionalLight=r.uuid:r.isDefaultCamera===!0&&(e.camera=r.uuid,e.activeCamera=r.uuid,Object.assign(r,{name:"Default Camera"})),r.children!==void 0)for(let n of r.children)PM(n,e)}function DM(r){AF(r.object)}function AF(r){var e,t,n,i,s,o,a;if(r.objectType==="Scene"){let l=r.userData,c=(e=l.rgb)!=null?e:{r:25,g:25,b:25},u=(t=l.fogColor)!=null?t:{r:25,g:25,b:25};Object.assign(r,{color:[c.r/255,c.g/255,c.b/255],alpha:l.alpha,enableFog:l.fogEnable,fogUseBGColor:l.fogUseBGColor,fog:{color:new fe().setRGB(u.r/255,u.g/255,u.b/255).getHex(),near:l.fogNear,far:l.fogFar},directionalLightState:l.directionalLightState,ambientLightState:l.ambientLightState,shadowsState:l.shadowsState,wireframeState:l.wireframeState,canvas:{mode:(n=l.canvasMode)!=null?n:1,size:{width:(s=(i=l.canvasCustomSize)==null?void 0:i.width)!=null?s:512,height:(a=(o=l.canvasCustomSize)==null?void 0:o.height)!=null?a:512}}}),delete l.rgb,delete l.alpha,delete l.fogEnable,delete l.fogUseBGColor,delete l.fogColor,delete l.fogNear,delete l.fogFar,delete l.directionalLightState,delete l.ambientLightState,delete l.shadowsState,delete l.wireframeState,delete l.canvasMode,delete l.canvasFullScreen,delete l.canvasCustomSize}}function RM(r){return{uuid:Ee.generateUUID(),type:"b",value:r,nodeType:"Bool"}}function Si(r,e){let t=new fe().set(r);return{uuid:Ee.generateUUID(),type:"c",r:t.r,g:t.g,b:t.b,value:r,alpha:e==null?void 0:e.uuid,nodeType:"Color"}}function BM(r,e){return{uuid:Ee.generateUUID(),type:"f[]",size:r,value:e,nodeType:"FloatArray"}}function mt(r){return{uuid:Ee.generateUUID(),type:"f",value:r,nodeType:"Float"}}function an(r){return{uuid:Ee.generateUUID(),type:"i",value:r,nodeType:"Int"}}function El(r){let{x:e,y:t}=r;return{uuid:Ee.generateUUID(),type:"v2",x:e,y:t,nodeType:"Vector2"}}function fg(r){let{x:e,y:t,z:n}=r;return{uuid:Ee.generateUUID(),type:"v3",x:e,y:t,z:n,nodeType:"Vector3"}}function OM(r,e){return{uuid:Ee.generateUUID(),type:"v4[]",size:r,value:e,nodeType:"Vector4Array"}}function FM(r){return{uuid:Ee.generateUUID(),type:"m3",elements:r.elements,nodeType:"Matrix3"}}function zM(r,e){return{uuid:Ee.generateUUID(),type:"v4",value:r,uv:e.uuid,project:!1,nodeType:"Texture"}}function GM(r){return{uuid:Ee.generateUUID(),type:"v2",index:r,nodeType:"UV"}}function pg(r,e){let t={uuid:Ee.generateUUID(),type:"v3",nodeType:"Blend",a:r==null?void 0:r.uuid,b:e.uuid};return"mode"in e&&(t.mode=e.mode),t}function UM(r,e){let t=r.uniforms,n=r.id,i=mt(t[`f${n}_alpha`].value),s=an(t[`f${n}_mode`].value);return[i,s].forEach(o=>e[o.uuid]=o),Object.assign(r,{uniforms:{[`f${n}_alpha`]:i.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomTexture",alpha:i.uuid,mode:s.uuid}}function mg(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value,s);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),o}function kM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=fg(t[`f${n}_cnormal`].value);return[o,s,i].forEach(a=>e[a.uuid]=a),Object.assign(r,{uniforms:{[`f${n}_cnormal`]:o.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"CustomNormal",cnormal:o.uuid,alpha:s.uuid,mode:i.uuid}}function VM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_near`].value),a=mt(t[`f${n}_far`].value),l=mt(t[`f${n}_isVector`].value),c=fg(t[`f${n}_origin`].value),u=Si(t[`f${n}_colorA`].value),h=Si(t[`f${n}_colorB`].value);return[o,a,l,c,u,h,s,i].forEach(d=>e[d.uuid]=d),Object.assign(r,{uniforms:{[`f${n}_near`]:o.uuid,[`f${n}_far`]:a.uuid,[`f${n}_isVector`]:l.uuid,[`f${n}_origin`]:c.uuid,[`f${n}_colorA`]:u.uuid,[`f${n}_colorB`]:h.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Depth",near:o.uuid,far:a.uuid,isVector:l.uuid,origin:c.uuid,colorA:u.uuid,colorB:h.uuid,alpha:s.uuid,mode:i.uuid}}function HM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=Si(t[`f${n}_color`].value),a=mt(t[`f${n}_bias`].value),l=mt(t[`f${n}_scale`].value),c=mt(t[`f${n}_intensity`].value),u=mt(t[`f${n}_factor`].value);return[o,a,l,c,u,s,i].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_color`]:o.uuid,[`f${n}_bias`]:a.uuid,[`f${n}_scale`]:l.uuid,[`f${n}_intensity`]:c.uuid,[`f${n}_factor`]:u.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Fresnel",color:o.uuid,bias:a.uuid,scale:l.uuid,intensity:c.uuid,factor:u.uuid,alpha:s.uuid,mode:i.uuid}}function jM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=an(t[`f${n}_gl_type`].value),a=an(t[`f${n}_num`].value),l=RM(t[`f${n}_smooth`].value),c=OM(10,t[`f${n}_colors`].value),u=BM(10,t[`f${n}_steps`].value),h=El(t[`f${n}_offset`].value),d=El(t[`f${n}_morph`].value),f=mt(t[`f${n}_angle`].value);return[o,a,l,c,u,h,d,f,s,i].forEach(p=>e[p.uuid]=p),Object.assign(r,{uniforms:{[`f${n}_gl_type`]:o.uuid,[`f${n}_num`]:a.uuid,[`f${n}_smooth`]:l.uuid,[`f${n}_colors`]:c.uuid,[`f${n}_steps`]:u.uuid,[`f${n}_offset`]:h.uuid,[`f${n}_morph`]:d.uuid,[`f${n}_angle`]:f.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Gradient",gl_type:o.uuid,num:a.uuid,smooth:l.uuid,colors:c.uuid,steps:u.uuid,offset:h.uuid,morph:d.uuid,angle:f.uuid,alpha:s.uuid,mode:i.uuid}}function WM(r,e){let t=r.uniforms,n=r.id,i=Ee.generateUUID(),s=an(t[`f${n}_mode`].value),o=mt(t[`f${n}_alpha`].value),a=mt(t[`f${n}_crop`].value),l=GM(0),c=zM(t[`f${n}_texture`].value,l),u=FM(t[`f${n}_mat`].value);return[c,l,u,a,o,s].forEach(h=>e[h.uuid]=h),Object.assign(r,{uniforms:{[`f${n}_texture`]:c.uuid,[`f${n}_mat`]:u.uuid,[`f${n}_crop`]:a.uuid,[`f${n}_alpha`]:o.uuid,[`f${n}_mode`]:s.uuid}}),{uuid:i,type:"v3",nodeType:"CustomTexture",texture:c.uuid,crop:a.uuid,alpha:o.uuid,mode:s.uuid}}function JM(r,e){let t=r.uniforms,n=r.id,i=an(t[`f${n}_mode`].value),s=mt(t[`f${n}_alpha`].value),o=mt(t[`f${n}_scale`].value),a=mt(t[`f${n}_move`].value),l=El(t[`f${n}_fA`].value),c=El(t[`f${n}_fB`].value),u=El(t[`f${n}_distortion`].value),h=Si(t[`f${n}_colorA`].value),d=Si(t[`f${n}_colorB`].value),f=Si(t[`f${n}_colorC`].value),p=Si(t[`f${n}_colorD`].value),m=an(t[`f${n}_intA`].value),v=an(t[`f${n}_intB`].value),g=an(t[`f${n}_intC`].value),y=an(t[`f${n}_intD`].value);return[o,a,l,c,u,h,d,f,p,m,v,g,y,s,i].forEach(x=>e[x.uuid]=x),Object.assign(r,{uniforms:{[`f${n}_scale`]:o.uuid,[`f${n}_move`]:a.uuid,[`f${n}_fA`]:l.uuid,[`f${n}_fB`]:c.uuid,[`f${n}_distortion`]:u.uuid,[`f${n}_colorA`]:h.uuid,[`f${n}_colorB`]:d.uuid,[`f${n}_colorC`]:f.uuid,[`f${n}_colorD`]:p.uuid,[`f${n}_intA`]:m.uuid,[`f${n}_intB`]:v.uuid,[`f${n}_intC`]:g.uuid,[`f${n}_intD`]:y.uuid,[`f${n}_alpha`]:s.uuid,[`f${n}_mode`]:i.uuid}}),{uuid:Ee.generateUUID(),type:"v3",nodeType:"Noise",scale:o.uuid,move:a.uuid,fA:l.uuid,fB:c.uuid,distortion:u.uuid,colorA:h.uuid,colorB:d.uuid,colorC:f.uuid,colorD:p.uuid,intA:m.uuid,intB:v.uuid,intC:g.uuid,intD:y.uuid,alpha:s.uuid,mode:i.uuid}}function gg(r,e,t){let n=e.uniforms,i=e.id,s=mt(n[`f${i}_alpha`].value),o=an(n[`f${i}_mode`].value);return[s,o].forEach(a=>t[a.uuid]=a),Object.assign(e,{uniforms:{[`f${i}_alpha`]:s.uuid,[`f${i}_mode`]:o.uuid}}),{uuid:Ee.generateUUID(),type:"basic",nodeType:"Basic",shadingAlpha:s.uuid,shadingBlend:o.uuid}}function XM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"phong",nodeType:"Phong",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function qM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.emissive)!=null?c:0),o=mt((u=r.emissiveIntensity)!=null?u:1),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[o,s,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"lambert",nodeType:"Lambert",emissiveIntensity:o.uuid,emissive:s.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function YM(r,e,t){var c,u;let n=e.uniforms,i=e.id,s=Si((c=r.specular)!=null?c:69905),o=mt((u=r.shininess)!=null?u:30),a=mt(n[`f${i}_alpha`].value),l=an(n[`f${i}_mode`].value);return[s,o,a,l].forEach(h=>t[h.uuid]=h),Object.assign(e,{uniforms:{[`f${i}_alpha`]:a.uuid,[`f${i}_mode`]:l.uuid}}),{uuid:Ee.generateUUID(),type:"toon",nodeType:"Toon",specular:s.uuid,shininess:o.uuid,shadingAlpha:a.uuid,shadingBlend:l.uuid}}function KM(r,e,t){var u,h,d;let n=e.uniforms,i=e.id,s=mt((u=r.roughness)!=null?u:.3),o=mt((h=r.metalness)!=null?h:0),a=mt((d=r.reflectivity)!=null?d:.5),l=mt(n[`f${i}_alpha`].value),c=an(n[`f${i}_mode`].value);return[s,o,a,l,c].forEach(f=>t[f.uuid]=f),Object.assign(e,{uniforms:{[`f${i}_alpha`]:l.uuid,[`f${i}_mode`]:c.uuid}}),{uuid:Ee.generateUUID(),type:"standard",nodeType:"Standard",roughness:s.uuid,metalness:o.uuid,reflectivity:a.uuid,shadingAlpha:l.uuid,shadingBlend:c.uuid}}var QM=new me,_F=["RectangleGeometry","TriangleGeometry","PolygonGeometry","StarGeometry"];function ZM(r){let e={};NF(r.materials,e),EF(r.interactionStates,e),TF(r.geometries,r.object),Object.keys(e).length&&(r.nodes=IF(e))}function $M(r,e){let t=r.geometry;if(t&&t===e)return r;let n=r.children;if(n)for(let i=0,s=n.length;i0){i.width+=s*2,i.height+=s*2,i.extrudeDepth+=s*2;let o=$M(e,n.uuid);if(o!==void 0){let a=new Ke;QM.fromArray(o.matrix),a.applyMatrix4(QM),a.position.z-=s,a.updateMatrix(),o.matrix=a.matrix.toArray()}}}}}function EF(r,e){if(r!==void 0){for(let t of r)if(t.material)if(Array.isArray(t.material))for(let n of t.material)for(let i of n.layersList)pu(i,e);else for(let n of t.material.layersList)pu(n,e)}}function NF(r,e){if(r!==void 0)for(let t of r){let{beforeLayers:n,lightingLayer:i,afterLayers:s}=CF(t.userData.layers);if(!i){console.error("Material upgrade: could not find a ligthing layer");continue}let o=LF(t,i,e);if(e[o.uuid]=o,n.length>0){let a=pu(n[0],e);e[a.uuid]=a;for(let l=1,c=n.length;l0){let a;for(let l of s){let c=pu(l,e),u=pg(a,c);e[u.uuid]=u,e[c.uuid]=c,a=u}o.afterColor=a==null?void 0:a.uuid}Object.assign(t,{type:"ShaderMaterial",wireframeLinecap:"",wireframeLinejoin:"",vertex:o==null?void 0:o.uuid,fragment:o==null?void 0:o.uuid}),delete t.color,delete t.emissive,delete t.specular,delete t.shininess,delete t.roughness,delete t.metalness}}function CF(r){let e=[],t=[],n,i=r.head;for(;i;){if(i.type==="light"){n=i,i=i.next;break}e.push(i),i=i.next}for(;i;)t.unshift(i),i=i.next;return{beforeLayers:e,lightingLayer:n,afterLayers:t}}function LF(r,e,t){let n,i;switch(r.userData.type){case"BasicMaterial":n=gg(r,e,t),i="BasicNodeMaterial";break;case"PhongMaterial":n=XM(r,e,t),i="PhongNodeMaterial";break;case"LambertMaterial":n=qM(r,e,t),i="LambertNodeMaterial";break;case"ToonMaterial":n=YM(r,e,t),i="ToonNodeMaterial";break;case"PhysicalMaterial":n=KM(r,e,t),i="StandardNodeMaterial";break;default:console.warn(`Material upgrade: could not find a properly material node to ${r.userData.type}`),n=gg(r,e,t),i="BasicNodeMaterial"}return Object.assign(r.userData,{nodeType:i}),n}function pu(r,e){switch(r.type){case"light":return UM(r,e);case"color":return mg(r,e);case"depth":return VM(r,e);case"fresnel":return HM(r,e);case"gradient":return jM(r,e);case"noise":return JM(r,e);case"normal":return kM(r,e);case"texture":return WM(r,e);default:return console.warn(`Material upgrade: could not find a properly "layer" node to ${r.type}`),mg(r,e)}}function IF(r){let e=[];for(let t in r)e.push(r[t]);return e}function yg(r){let e=r.metadata;return console.info(`File format version ${e==null?void 0:e.version}`),(e==null?void 0:e.version)===void 0?(console.warn("Unknow file version"),!1):((e.version<=1.1||e.version===4.5)&&(CM(r),e.version=1.2,console.warn("File upgraded from v1.1 or inferior to v1.2")),e.version===1.2&&(IM(r),e.version=1.3,console.warn("File upgraded from v1.2 to v1.3")),e.version===1.3&&(DM(r),e.version=1.4,console.warn("File upgraded from v1.3 to v1.4")),e.version===1.4&&(ZM(r),e.version=1.5,console.warn("File upgraded from v1.4 to v1.5")),!0)}var nA=Cg(tA()),iA=new me,PF=new me,DF=new me,RF=new me,Nl=class extends Vn{constructor(e=Qn.create({}),t=new Ci){super(e,t);this.objectType="SubdivObject";this.resized=!1;this.newlyPasted=!1;this.matrixWorldRigid=new me;this.scaleMatrix=new me;this.hiddenMatrixOld=new me;this.isNegativeDeterminant=!1;this.isUniformScaling=!0;this.castShadow=!0,this.receiveShadow=!0,this.forceComputeSize=!1,this.subdivPointer=Qn.activeSubdivPtr}toJSON(e){let t=super.toJSON(e);return t.object.objectType="SubdivObject",t}updateGeometry(e){let t=this.geometry,n=Uc[t.userData.type],i=this.objectType==="SubdivObject"?Object.assign({},t.userData,{geometry:t,subdivPointer:this.subdivPointer,smoothShading:this.smoothShading}):t.userData,s=n.build(n.normalizeInputs(e,i));this.geometry.dispose(),this.geometry=s}clone(e){var a,l;if(this.resized){this.resized=!1;let c;this.geometry.userData.parameters.subdivisions>0?c=this.geometry.originalGeometry:c=this.geometry,Qn.allocate(c),this.subdivPointer=Qn.activeSubdivPtr}let t=this.material.clone(),n=Qn.clone(Ue({},this.geometry.userData.parameters),this.subdivPointer,this.smoothShading),i=(a=this.geometry.originalGeometry)!=null?a:this.geometry,s=(l=n.originalGeometry)!=null?l:n;s.boundingSphere=i.boundingSphere.clone();let o=new Nl(n,t).copy(this,e);return o.subdivPointer=Qn.activeSubdivPtr,o}raycast(e,t){let n=this.geometry.originalGeometry;if(n){let i=this.geometry;this.geometry=n,Vn.prototype.raycast.call(this,e,t),this.geometry=i}else Vn.prototype.raycast.call(this,e,t)}applySVDScaling(){let e=this.matrixWorld.elements,t=[[e[0],e[4],e[8]],[e[1],e[5],e[9]],[e[2],e[6],e[10]]],{u:n,v:i,q:s}=(0,nA.SVD)(t);this.isNegativeDeterminant=this.matrixWorld.determinant()<0,this.isUniformScaling=s.every(h=>Math.abs(s[0]-h)<.01);let o,a,l=iA.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),c=PF.set(i[0][0],i[0][1],i[0][2],0,i[1][0],i[1][1],i[1][2],0,i[2][0],i[2][1],i[2][2],0,0,0,0,1),u=DF.copy(c).transpose();if(o=RF.makeScale(s[0],s[1],s[2]).multiply(u).premultiply(c),a=l.multiply(u),!this.isUniformScaling){this.geometry.applyMatrix4(o);let h=this.geometry.originalGeometry;h?(h.applyMatrix4(o),h.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}return{scaleMatrix:o,matrixWorldRigid:a}}revertSVDScaling(e){let t=this.geometry.originalGeometry;t?Qn.getTopologicalMesh(t):Qn.getTopologicalMesh(this.geometry);let n=e.elements,i=[n[0],n[5],n[10]];if(!i.every(o=>Math.abs(i[0]-o)<.01)){let o=iA.copy(this.scaleMatrix).invert();this.geometry.applyMatrix4(o),t?(t.applyMatrix4(o),t.getAttribute("positionWASM").applyMatrix4(o)):this.geometry.getAttribute("positionWASM").applyMatrix4(o),this.resized=!0}}};var vg=class{constructor(){this._buffers=[]}parse(e){var n;let t=new we;if(this._vertexData=e.vertexData,this._loadBuffers(this._vertexData.buffers),t.uuid=e.uuid,this._vertexData.accessors)for(let i=0,s=this._vertexData.accessors.length;i{let a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(let l in t.attributeTypes){let c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}let n=JSON.stringify(t);if(xg.has(e)){let l=xg.get(e);if(l.key===n)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i,s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(i=l,new Promise((c,u)=>{i._callbacks[s]={resolve:c,reject:u},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),xg.set(e,{key:n,promise:a}),a}_createGeometry(e){let t=new we;e.index&&t.setIndex(new Re(e.index.array,1));for(let n=0;n{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{let i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);let s=FF.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{let p=t(h,d,f,c),m=p.attributes.map(v=>v.array.buffer);p.index&&m.push(p.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:p},m)}catch(p){console.error(p),self.postMessage({type:"error",id:a.id,error:p.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){let u=c.attributeIDs,h=c.attributeTypes,d,f,p=a.GetEncodedGeometryType(l);if(p===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(p===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in u){let g=self[h[v]],y,x;if(c.useUniqueIDs)x=u[v],y=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[v]]),x===-1)continue;y=a.GetAttribute(d,x)}m.attributes.push(i(o,a,d,v,g,y))}return p===o.TRIANGULAR_MESH&&(m.index=n(o,a,d)),o.destroy(d),m}function n(o,a,l){let u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);let f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function i(o,a,l,c,u,h){let d=h.num_components(),p=l.num_points()*d,m=p*u.BYTES_PER_ELEMENT,v=s(o,u),g=o._malloc(m);a.GetAttributeDataArrayForAllPoints(l,h,v,m,g);let y=new u(o.HEAPF32.buffer,g,p).slice();return o._free(g),{name:c,array:y,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}function Cl(r){let e;return r instanceof Array?(e={},r.forEach(t=>{e[t.uuid]=t})):e=r,e}function rA(r,e){return r[e]===void 0&&console.warn("ObjectLoader > getGeometry: undefined geometry",e),r[e]}function sA(r,e){if(e!==void 0){if(e instanceof Array){let t=[];for(let n=0,i=e.length;n getMaterial: undefined material",s),t.push(r[s])}return t}return r[e]===void 0&&console.warn("ObjectLoader > getMaterial: undefined material",e),r[e]}}var wg=class extends gx(Ap){constructor(){super(...arguments);this.path="";this.resourcePath=""}async loadFromFile(e){var s;let t=await LS(e,this.manager,Ds.TEXT),{object:n,materials:i}=this.parse(JSON.parse(t));return n.name=(s=e.name.split(".").shift())!=null?s:e.name,this.manager.itemEnd(e.name),{scene:n,materials:i}}load(e,t,n,i){let s=this.path===""?Ei.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let o=new Xn(this.manager);o.setPath(this.path),o.load(e,a=>{let l=null;try{l=JSON.parse(a)}catch(u){i!==void 0&&i(u),console.warn(`ObjectLoader > load: can't parse ${e}.`),console.error(u);return}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry"){console.error("ObjectLoader: Can't load "+e);return}this.parse(l,t)},n,i)}parse(e,t){var d;if(yg(e)===!1)return console.error("File can not be parser"),{object:new zs,materials:{}};let n={},i=this.parseGeometries(e.geometries),s=this.loader.parseImages(e.images,()=>{t!==void 0&&t(u)}),o=this.parseTextures(e.textures,s),a=new Jd;a.init(Cl((d=e.nodes)!=null?d:[]),Cl(o));let l=Cl(this.loader.parseMaterials(e.materials,o)),c=this.customParseMaterials(l,e.materials,a),u=this.parseObject(e.object,i,c,n);this.upgradeNoise(u);let h=this.parseInteractionStates(e.interactionStates,a);return this.parseInteractions(e.object,n,h),(e.images===void 0||e.images.length===0)&&t!==void 0&&t(u),{object:u,materials:c}}upgradeNoise(e){e.traverseEntity(t=>{var n;if(t.type==="Mesh"){let i=t,s=i.material;if(!s.userData)return;let o=(n=s.userData.layers)==null?void 0:n.head;for(;o;){if(o.type===lt.NOISE&&o.uniforms[`f${o.id}_size`].value.equals(new M(-1,-1,-1))&&(i.geometry.boundingBox||i.geometry.computeBoundingBox(),i.geometry.boundingBox)){let a=o.uniforms[`f${o.id}_scale`].value,{x:l,y:c,z:u}=i.geometry.boundingBox.max,h=Math.max(l,Math.max(c,u))/(a*a);o.uniforms[`f${o.id}_size`].value.x=h,o.uniforms[`f${o.id}_size`].value.y=h,o.uniforms[`f${o.id}_size`].value.z=h}o=o.next}}})}parseGeometries(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}async parseAsync(e){var h;if(yg(e)===!1)return console.error("File can not be parser"),new zs;let t=new Jd,n={},i=await this.parseGeometriesAsync(e.geometries),s=this.loader.parseImages(e.images,()=>{}),o=this.parseTextures(e.textures,s);t.init(Cl((h=e.nodes)!=null?h:[]),Cl(o));let a=Cl(this.loader.parseMaterials(e.materials,o)),l=this.customParseMaterials(a,e.materials,t),c=await this.parseObjectAsync(e.object,i,l,n),u=this.parseInteractionStates(e.interactionStates,t);return this.parseInteractions(e.object,n,u),c}async parseGeometriesAsync(e){var n,i;let t={};if(e!==void 0)for(let s=0,o=e.length;s{this.gltfLoader.parse(JSON.stringify(a.gltf),"",d)}),h=[];u.scene.traverse(d=>{let f=d;f.isMesh&&h.push(f.geometry)}),h.length===1?l=h[0]:(h=Jm(h,d=>d.userData.groupIndex),l=tl.mergeBufferGeometries(h,!0),l.groups.forEach((d,f)=>{d.materialIndex=h[f].userData.materialIndex}))}else l=this.loader.parseGeometries([a])[a.uuid];l.userData={};let c=Object.assign({},a.userData,{geometry:l});l=Lo.create(c);break;default:l=kc(a.userData)}l.uuid=a.uuid,a.name!==void 0&&(l.name=a.name),t[a.uuid]=l}catch(c){console.warn("ObjectLoader > parseGeometries: error parsing geometry of type .",(i=a.userData)==null?void 0:i.type),console.error(c)}}return t}parseTextures(e,t){let n=this.loader.parseTextures(e,t);return Object.keys(n).forEach(i=>{let s=new bi().copy(n[i]);s.uuid=i,n[i]=s}),n}customParseMaterials(e,t,n){let i={};if(t!==void 0)for(let s=0,o=t.length;s{}).catch(()=>{});break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=this.parseObject(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}async parseObjectAsync(e,t,n,i){let s;if(e.geometry!==void 0){let o=rA(t,e.geometry),a=sA(n,e.material);if(o){switch(e.objectType){case"Mesh2D":s=new Ml(o,a).fromJSON(e);break;case"Mesh3D":s=new Al(o,a).fromJSON(e);break;case"NonParametric":s=new Fd(o,a).fromJSON(e);break;case"TextFrame":s=new Os(o,a);try{await s.fromJSONasync(e)}catch(l){console.log(l)}break;case"VectorObject":s=new Ps(o,a).fromJSON(e);break;case"SubdivObject":s=new Nl(o,a).fromJSON(e),s.subdivPointer=o.subdivPointer;break;default:console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}a||(s.name+=" (Recovered)")}else s=new Pi().fromJSON(e),s.name+=" (Recovered)",console.warn("An empty object is created instead")}else switch(e.objectType){case"Scene":s=new zs().fromJSON(e);break;case"CombinedCamera":s=new Sr().fromJSON(e);break;case"LightDirectional":s=new Rd().fromJSON(e);break;case"LightPoint":s=new Bd().fromJSON(e);break;case"LightSpot":s=new Od().fromJSON(e);break;case"EmptyObject":s=new Pi().fromJSON(e);break;default:if(e.type==="HemisphereLight"||e.type==="DirectionalLight")s=this.loader.parseObject(e,t,n);else{console.warn("ObjectLoader > parseObject: unsupported object type",e.objectType);return}}if(ei(s)&&(i[e.uuid]=s),e.children!==void 0)for(let o of e.children){let a=await this.parseObjectAsync(o,t,n,i);a!==void 0&&s.add(a)}return s instanceof zs&&s.initFromObjectLoader(e),s}parseInteractionStates(e,t){let n={};if(e!==void 0)for(let i=0,s=e.length;i{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseDownEvent()};this._onMouseUp=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._handleMouseUpEvent()};this._onMouseMove=e=>{this._raycaster.setFromCamera(this._getPointer(e.clientX,e.clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent()};this._onTouchStart=e=>{e.touches.length===1&&(e.preventDefault(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseDownEvent(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onTouchEnd=()=>{this._handleMouseUpEvent(),this._handleMouseHoverEvent(!0)};this._onTouchMove=e=>{e.touches.length===1&&(e.preventDefault(),e.stopPropagation(),this._raycaster.setFromCamera(this._getPointer(e.touches[0].clientX,e.touches[0].clientY),this._camera),this._camera.getWorldDirection(this._normal),this._normal.negate(),this._handleMouseHoverEvent(),this._handleLookAtEvent(),this._handleFollowEvent())};this._onKeyDown=e=>{this._handleKeyDownEvent(e.key)};this._onKeyUp=e=>{this._handleKeyUpEvent(e.key)};this._domElement=e,this._scene=t,this._camera=n,this._app=i}activate(){this.isEnable=!0,this._scene.traverseEntity(e=>{if(e.interaction!==void 0){e.interaction.start();for(let t of e.interaction.events){let n=t.type;this._enableEvent[n]=!0,(n===Ze.KEY_DOWN||n===Ze.KEY_UP||n===Ze.START||n===Ze.LOOK_AT||n===Ze.FOLLOW)&&(this._map[n]===void 0&&(this._map[n]=[]),this._map[n].push(e))}}}),this._enableEvent[Ze.START]!==void 0&&this._handleStartEvent(),this._enableEvent[Ze.MOUSE_DOWN]!==void 0&&(this._domElement.addEventListener("pointerdown",this._onMouseDown,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1)),this._enableEvent[Ze.MOUSE_UP]!==void 0&&(this._domElement.addEventListener("pointerup",this._onMouseUp,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1)),(this._enableEvent[Ze.MOUSE_HOVER]!==void 0||this._enableEvent[Ze.LOOK_AT]!==void 0||this._enableEvent[Ze.FOLLOW]!==void 0)&&(this._domElement.addEventListener("pointermove",this._onMouseMove,!1),this._domElement.addEventListener("touchstart",this._onTouchStart,!1),this._domElement.addEventListener("touchend",this._onTouchEnd,!1),this._domElement.addEventListener("touchmove",this._onTouchMove,!1)),this._enableEvent[Ze.KEY_DOWN]!==void 0&&document.addEventListener("keydown",this._onKeyDown,!1),this._enableEvent[Ze.KEY_UP]!==void 0&&document.addEventListener("keyup",this._onKeyUp,!1)}deactivate(){this._scene.traverseEntity(e=>{e.interaction!==void 0&&e.interaction.end(),e.interaction.cache=void 0}),this._domElement.removeEventListener("pointerdown",this._onMouseDown),this._domElement.removeEventListener("pointerup",this._onMouseUp),this._domElement.removeEventListener("pointermove",this._onMouseMove),this._domElement.removeEventListener("touchstart",this._onTouchStart),this._domElement.removeEventListener("touchend",this._onTouchEnd),this._domElement.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keyup",this._onKeyUp),this._enableEvent={},this._map={},this.isEnable=!1}reset(){this._scene.traverseEntity(e=>{e.interaction.start()}),this._handleStartEvent()}_getPointer(e,t){let n=this._domElement.getBoundingClientRect();return{x:(e-n.left)/n.width*2-1,y:-((t-n.top)/n.height)*2+1}}_handleStartEvent(){var e;(e=this._map[Ze.START])==null||e.forEach(t=>{var n;(n=t.interactionCache.start)==null||n.dispatch()})}_handleMouseDownEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseDown)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseUpEvent(){var t;let e=this._raycastMesh(this._raycaster);for(let n=0,i=e.length;n{var a;o instanceof Pi&&((a=o.interactionCache.mouseUp)==null||a.dispatch())}),!s.interactionCache.follow)break}}_handleMouseHoverEvent(e=!1){var t,n;if(this._enableEvent[Ze.MOUSE_HOVER]!==void 0){let i;if(!e){let o=this._raycastMesh(this._raycaster).find(a=>!a.object.interactionCache.follow);i=o?o.object:void 0}if(this._prevObject!==i){this._prevObject!==void 0&&((t=this._prevObject.interactionCache.mouseHover)==null||t.dispatchReverse()),i!==void 0&&((n=i.interactionCache.mouseHover)==null||n.dispatch());let s=[];i==null||i.traverseAncestors(l=>{l instanceof Pi&&l.interactionCache.mouseHover&&s.push(l)}),this._prevAncestors.filter(l=>{var c;return s.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatchReverse(),!0)});let o=s.filter(l=>{var c;return this._prevAncestors.includes(l)?!1:((c=l.interactionCache.mouseHover)==null||c.dispatch(),!0)}),a=this._prevAncestors.filter(l=>s.includes(l));this._prevAncestors=[...a,...o]}this._prevObject=i}}_handleLookAtEvent(){var e;(e=this._map[Ze.LOOK_AT])==null||e.forEach(t=>{var i;let n=(i=t.interactionCache.lookAt)==null?void 0:i.distance;n!==void 0&&(this._plane.set(this._normal,-n),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.lookAt(this._intersection))}),this._app.skipRender=!1}_handleFollowEvent(){var e;(e=this._map[Ze.FOLLOW])==null||e.forEach(t=>{this._plane.setFromNormalAndCoplanarPoint(this._normal,t.getWorldPosition(this._position)),this._raycaster.ray.intersectPlane(this._plane,this._intersection),t.interaction.follow(this._intersection)}),this._app.skipRender=!1}_handleKeyDownEvent(e){var t;(t=this._map[Ze.KEY_DOWN])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyDown)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_handleKeyUpEvent(e){var t;(t=this._map[Ze.KEY_UP])==null||t.forEach(n=>{var s;let i=(s=n.interactionCache.keyUp)==null?void 0:s.find(o=>o.key===e);i==null||i.dispatch()})}_raycastMesh(e){let t=[],n=i=>{for(let s of i.children)ei(s)&&!s.raycastLock&&s.visible&&(wS(s)&&e.intersectObject(s,!1,t),n(s))};return n(this._scene),t}};var Mg=class{constructor(e,t,n,i,s){this._aspect=1;this._renderer=e,this._camera=t,this._frameSize=new O().copy(n),this._editorSize=new O().copy(i),this._aspect=t.aspect,this._fov=s!=null?s:t.fov}set frameSize(e){this._frameSize.copy(e)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let e=this._frameSize.x,t=this._frameSize.y,n=this._editorSize.x,i=this._editorSize.y,s=0,o=0,a=e,l=t;et){let i=zF(e,1080,2160,1,15)/100;n*=e/t,n*=1-i}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y)}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t),this._camera.updateProjectionMatrix())}};function zF(r,e,t,n,i){return(r-e)/(t-e)*(i-n)+n}var ko;(function(t){t[t.FULLSCREEN=1]="FULLSCREEN",t[t.CUSTOM=2]="CUSTOM"})(ko||(ko={}));var GF=class{constructor(){this._needsTransmission=!0;this._viewportMode=1;this._viewportWidth=window.innerWidth;this._viewportHeight=window.innerHeight;this.skipRender=!0;this.render=()=>{var t;requestAnimationFrame(this.render);let e=Ls.isAllAnimationsEnded;if(!(this.skipRender&&(e===void 0||e))){if(!this._renderer){console.error("Application::render >>> tried to renderer without a renderer");return}this._controls&&(this._controls.enableDamping||this._controls.autoRotate)?this.skipRender=!this._controls.update():this.skipRender=!0,this._playmode&&!this._playmode.isEnable&&this._playmode.activate(),this._scene&&this._camera&&(this._renderer.autoClear=!1,this._needsTransmission&&this.renderTransmissionTarget(),((t=this._scene.postprocessing)==null?void 0:t.enabled)?(this._renderer.autoClear=!1,this._scene.postprocessing.render()):(this._renderer.autoClear=!0,this._renderer.render(this._scene,this._camera)))}};this.resize=()=>{var e,t,n,i;this.skipRender=!1,!!this._renderer&&(this._viewportMode===1&&(this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._frameView&&(this._frameView.frameSize=new O(this._viewportWidth,this._viewportHeight))),(e=this._frameView)==null||e.updateRenderer(),((t=this._scene)==null?void 0:t.postprocessing)&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._viewportMode!==1&&((n=this._frameView)==null||n.updateViewport()),this._camera&&((i=this._frameView)==null||i.updateCamera(),this._camera.cameraType==="PerspectiveCamera"&&this._viewportMode===1&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()))};window.addEventListener("resize",Wm(this.resize,200))}async load(e){let n=await(await fetch(e,{credentials:"include",mode:"no-cors"})).json();await this.start(n)}async start(e){this._editorData=e.editor,this._needsTransmission=e.needsTransmission!==void 0?e.needsTransmission:!0;let n=await new wg().parseAsync(e);this._scene=n,this._camera=this._scene.activeCamera,this.init(),this.resize(),this.render()}renderTransmissionTarget(){!this._renderer||!this._transmissionRenderTarget||!this._scene||!this._camera||(this._renderer.setRenderTarget(this._transmissionRenderTarget),this._renderer.clear(),this._camera.layers.enable(0),this._camera.layers.disable(3),this._renderer.render(this._scene,this._camera),this._renderer.setRenderTarget(null),this._camera.layers.enable(3))}init(){var n,i,s,o;let e=document.getElementById("canvas3d");if(!this._scene||!this._camera)return;((n=this._scene.postprocessing)==null?void 0:n.enabled)?(this._renderer=new wt({canvas:e,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._scene.postprocessing.init({renderer:this._renderer,camera:this._camera,scene:this._scene})):this._renderer=new wt({canvas:e,antialias:!0,alpha:!0,stencil:!0,depth:!0,powerPreference:"high-performance"}),this._needsTransmission&&(this._transmissionRenderTarget=new bt(2048,2048,{generateMipmaps:!0,minFilter:Ai,magFilter:$e,wrapS:Zt,wrapT:Zt}),this._transmissionRenderTarget.depthTexture=new so(2048,2048),this._scene.traverseEntity(a=>{if(!(!(a instanceof Vn)||!this._transmissionRenderTarget)&&!Array.isArray(a.material)){let l=a.material.userData.layers.getLayersOfType(lt.TRANSMISSION);for(let c of l)c.uniforms[`f${c.id}_transmissionSamplerMap`].value=this._transmissionRenderTarget.texture,c.uniforms[`f${c.id}_transmissionDepthMap`].value=this._transmissionRenderTarget.depthTexture}})),this._viewportMode=(i=this._scene.canvas.mode)!=null?i:1,this._viewportWidth=(s=this._scene.canvas.size.width)!=null?s:window.innerWidth,this._viewportHeight=(o=this._scene.canvas.size.height)!=null?o:window.innerHeight,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(this._viewportWidth,this._viewportHeight),this._scene.postprocessing&&this._scene.postprocessing.resize(this._viewportWidth,this._viewportHeight),this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=qd,this._renderer.setClearColor(this._scene.color,this._scene.alpha),this._frameView=new Mg(this._renderer,this._camera,new O(this._viewportWidth,this._viewportHeight),new O(this._scene.canvas.editorSize.width,this._scene.canvas.editorSize.height)),!0&&(this._controls=new Gp(this._camera,this._renderer.domElement),this._editorData&&(this._controls.fromJSON(this._editorData.orbitControls),this._controls.useKeyEvents=!1),this._controls.addEventListener("change",()=>this.skipRender=!1),this._controls.addEventListener("start",()=>this.skipRender=!1)),this._playmode=new Sg(this._renderer.domElement,this._scene,this._camera,this)}};ui.FONTS_PATH="_assets/_fonts/";export{GF as Application}; diff --git a/site/spline/design/value_light/scene.json b/site/spline/design/value_light/scene.json deleted file mode 100644 index fe7327e44..000000000 --- a/site/spline/design/value_light/scene.json +++ /dev/null @@ -1 +0,0 @@ -{"object":{"uuid":"B6BEBD25-292C-4ECC-9729-2C0233CBC257","objectType":"Scene","name":"Untitled","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"layers":1,"children":[{"uuid":"950B644B-0874-4AB4-8E13-C75872A15555","objectType":"Mesh3D","name":"Cube","matrix":[0.9647988483708523,0.2501733769353302,0.08109539848256787,0,2.498001805406605e-16,0.30836049114984276,-0.9512695766699522,0,-0.26298893927743905,0.9177837920613917,0.29750584674443664,0,-132.1635384266761,-51.1373856647624,-495.86793449695807,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"D91BDAE0-CA29-4D50-B8F0-7F8C28F2F6C8","selectedState":0,"states":["BC58F3BD-3CD5-4903-BCE1-C32002D556A2","71CFA7D6-3621-4E22-B4C1-AA0E70477794"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":10000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"950B644B-0874-4AB4-8E13-C75872A15555","state":"71CFA7D6-3621-4E22-B4C1-AA0E70477794"}]}]},"geometry":"5274D67D-12C1-4D74-8411-7ECB575B0313","material":"D25809D2-238E-48BA-9030-56406A16D1CF"},{"uuid":"C86B2A7B-3B2F-4DE3-93C3-9F31FA3AA6AF","objectType":"Mesh3D","name":"Pyramid","matrix":[0.921222240059181,0.3129380918188313,-0.23112623197968907,0,-0.15216225389559598,0.8366046839787403,0.5262501793199195,0,0.3580450152002586,-0.44962468063221667,0.8183162063998398,0,29.837735321981295,174.88806212317647,343.15660199269524,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"16A2F995-29A3-4EAE-8C55-D6BD90F7B6DB","selectedState":0,"states":["9F8D0167-E3AC-4D02-AC9B-AFF3DCBDED1F","3C323F54-4B75-4F4C-B824-5D44E6A2C87B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"C86B2A7B-3B2F-4DE3-93C3-9F31FA3AA6AF","state":"3C323F54-4B75-4F4C-B824-5D44E6A2C87B"}]}]},"geometry":"1F9B7F64-562E-48B5-AA8D-AB049BCF5A7F","material":"34F6388C-DCDF-418E-BB8D-1F9CE90E8466"},{"uuid":"9A1BE607-5F7C-4A48-A391-2F9D0D53C052","objectType":"Mesh3D","name":"Sphere","matrix":[0.7102640395405213,0.0018619098245032384,-0.7039328998046519,0,-0.014548138389689462,0.9998217460169199,-0.012034444776121977,0,0.7037850139104808,0.018788546603729236,0.7101645194682319,0,-333.61962033438857,62.4305143567372,-274.8879842740688,1],"castShadow":true,"receiveShadow":true,"layers":1,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A6F8889C-7FF0-418E-87C4-2671CD4AF81C","selectedState":0,"states":["14EA539B-8A15-4CC1-893E-755FC9F429FB","DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":10},"object":"9A1BE607-5F7C-4A48-A391-2F9D0D53C052","state":"DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5"}]}]},"geometry":"B93FB9F3-1D56-4D51-A5D0-2C905080D2E9","material":"BC5888BF-B190-4383-BA01-AAE17067AADA"},{"uuid":"44B84140-AEF9-4DCA-B7C8-6596C10F4DBD","objectType":"EmptyObject","name":"Empty Object","matrix":[1.0000000000000187,-1.2246467991473764e-16,2.4492935982947523e-16,0,1.224646799147353e-16,1,1.2246467991473535e-16,0,-2.4492935982947523e-16,-1.224646799147376e-16,1.0000000000000187,0,8.228765814177173e-16,209.99207679614122,8.228765814177175e-16,1],"layers":1,"children":[{"uuid":"DAEA5101-78CB-4EEB-8C78-098C5E5B73C8","objectType":"Mesh3D","name":"Cylinder 5","matrix":[0.9063077870366493,-0.4226182617406996,0,0,0.42261826174069905,0.9063077870366482,0,0,0,0,1,0,0,203.27277959150527,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-203.27277959150527,0,1],"interaction":{"uuid":"903A6D0C-5FF4-46F4-A91C-5D8D0FED70F1"},"geometry":"9294E6E3-BE82-4FDE-8D84-9B3B9D0873AA","material":"558F61DF-3FB0-4DDC-9F29-D99391BE9C07"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"717F2892-231C-463E-A420-52DE8C0266A6","selectedState":0,"states":["28C6E18F-BD7B-413E-B4ED-F42B470C1036","60958BAD-DABC-41F6-B777-52A02438E644"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"44B84140-AEF9-4DCA-B7C8-6596C10F4DBD","state":"60958BAD-DABC-41F6-B777-52A02438E644"}]}]},"enableHelper":true},{"uuid":"E3AFEE9D-EDBC-4D54-86F7-76B07F6EDAE0","objectType":"EmptyObject","name":"Empty Object 2","matrix":[1.0000000000000264,-1.2246467991473855e-16,-7.498798913309486e-33,0,1.2246467991473532e-16,1,1.2246467991473532e-16,0,-7.498798913309486e-33,-1.2246467991473855e-16,1.0000000000000264,0,0,153.05834378711734,0,1],"layers":1,"children":[{"uuid":"CD4B4889-F6DC-4394-87D2-E5594286D1EC","objectType":"Mesh3D","name":"Cylinder 6","matrix":[0.9848077530122072,0.1736481776669305,0,0,-0.1736481776669303,0.9848077530122061,0,0,0,0,1.0000000000000027,0,0,153.05834378711734,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-153.05834378711734,0,1],"interaction":{"uuid":"C801B051-9433-4377-9522-842DA765958E"},"geometry":"15CDDD19-C630-4301-A0D3-7344F369BBBF","material":"59AF4ABF-6168-480C-9890-21FFBB028CAD"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A4871482-3E26-457D-8E3F-41187D48225A","selectedState":0,"states":["307C44B4-30D0-4E0B-B608-EBE4C807AA0B","D31CB886-58BE-48A1-A431-1DF575DCAC6E"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"E3AFEE9D-EDBC-4D54-86F7-76B07F6EDAE0","state":"D31CB886-58BE-48A1-A431-1DF575DCAC6E"}]}]},"enableHelper":true},{"uuid":"9B504F2D-F8FA-438A-97FD-2F4C12D25CCF","objectType":"EmptyObject","name":"Empty Object 3","matrix":[1.000000000000036,-1.2246467991473976e-16,2.4492935982947947e-16,0,1.224646799147353e-16,1,1.2246467991473535e-16,0,-2.4492935982947947e-16,-1.224646799147397e-16,1.000000000000036,0,0,115.09081537009483,0,1],"layers":1,"children":[{"uuid":"2B6095AC-DDB5-4792-AA4A-012696E82814","objectType":"Mesh3D","name":"Cylinder 4","matrix":[0.9848077530122069,-0.17364817766693033,0,0,0.17364817766693014,0.9848077530122058,0,0,0,0,1.0000000000000027,0,0,115.09081537009482,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,-115.09081537009483,0,1],"interaction":{"uuid":"45093491-6F28-40B2-85F3-DAE0EA9345A7"},"geometry":"A9EE3835-2150-421D-A9F6-9E7DB6177DBB","material":"899A47F3-E0F6-46D2-833B-B9C348E27135"}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"94153E49-39FE-43BD-A82B-DE30BE8251D2","selectedState":0,"states":["83EC61E5-EF47-4AEB-BA00-B0133D85C366","25749767-B480-4A5B-9EAA-2B33D9EF0B84"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":2},"object":"9B504F2D-F8FA-438A-97FD-2F4C12D25CCF","state":"25749767-B480-4A5B-9EAA-2B33D9EF0B84"}]}]},"enableHelper":true},{"uuid":"258ECED6-2FB9-4861-89DF-7012F5101209","objectType":"Mesh3D","name":"Cylinder 3","matrix":[0.939692620785907,0.3420201433256685,0,0,-0.3420201433256685,0.939692620785907,0,0,0,0,1,0,-4.079219866531334e-15,129.78775382679308,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"A57F85C9-6398-4DF1-A5C1-DACBC30A085B","selectedState":0,"states":["9C36471C-D54D-40ED-B233-7308B35AE9BF","78C26B35-2E45-4B25-BBC0-902DC72A3D6B"],"events":[{"type":2,"ui":{"isCollapsed":false},"targets":[{"easing":6,"duration":1000,"delay":0,"cubicControls":[0.5,0.05,0.1,0.3],"springParameters":{"mass":1,"stiffness":80,"damping":10,"velocity":3},"object":"258ECED6-2FB9-4861-89DF-7012F5101209","state":"78C26B35-2E45-4B25-BBC0-902DC72A3D6B"}]}]},"geometry":"C04F3942-5D98-4AD6-A3E7-ED464E0855B7","material":"30B2E26E-31CD-46DB-9FB3-EA1A74B4CF27"},{"uuid":"4B96348E-A91F-4323-8817-5B291CD09604","objectType":"Mesh3D","name":"Cylinder 2","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,12.599699723028607,0,1],"castShadow":true,"receiveShadow":true,"layers":8,"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B662A976-6DE3-49C5-B575-B36820A82CBD"},"geometry":"C687EB7E-087A-44CC-A5FD-F0404363FE2D","material":"36E0FCF7-A3F7-44C4-8529-979039F9C3C9"},{"uuid":"3B695796-4617-4F45-BF86-E0B33A41DF6B","objectType":"CombinedCamera","name":"Default Camera","matrix":[0.7198070142279037,-2.7755575615628914e-17,-0.694174230484185,0,-0.29809388936183223,0.903103811757994,-0.309101178117,0,0.6269113935744398,0.4294222923745129,0.6500604582793605,0,100.98753019467836,513.4827575958948,1101.7264851735074,1],"layers":9,"children":[{"uuid":"E3F6D54D-4262-4F48-815D-87A431E15474","type":"DirectionalLight","name":"Default Directional Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,850000,1300000,1000000,1],"color":16777215,"intensity":0.16,"shadow":{"camera":{"uuid":"A365B353-F1AA-4566-BF6A-A7B546E473F0","type":"OrthographicCamera","layers":1,"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}}}],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"interaction":{"uuid":"B2468481-CBDD-4F0F-B576-73B5F8EA49C6"},"enableHelper":false,"cameraType":"OrthographicCamera","targetOffset":999.9999999999989,"isUpVectorFlipped":false,"angleOffsetFromUp":0,"left":-1031,"right":1031,"top":585,"bottom":-585,"zoomOrtho":0.5987369392383788,"nearOrtho":-50000,"far":50000,"aspect":1.7623931623931623,"fov":45,"focus":10,"filmGauge":35,"filmOffset":0,"zoomPersp":1,"nearPersp":50},{"uuid":"36878CE4-1A1A-40E5-B27A-7718B3714A24","type":"HemisphereLight","name":"Default Ambient Light","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,1],"color":13882323,"intensity":1.05,"groundColor":8553090}],"activeCamera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","camera":"3B695796-4617-4F45-BF86-E0B33A41DF6B","directionalLight":"E3F6D54D-4262-4F48-815D-87A431E15474","ambientLight":"36878CE4-1A1A-40E5-B27A-7718B3714A24","color":[1,1,1],"alpha":1,"directionalLightState":true,"ambientLightState":true,"canvas":{"mode":1,"editorSize":{"width":2062,"height":1170},"color":[0,0,0,0.5]},"postprocessing":{"enabled":false,"bloom":{"enabled":false,"opacity":1,"blendFunction":16,"intensity":1,"luminanceThreshold":0.9,"luminanceSmoothing":0.025,"blurScale":1,"kernelSize":3},"chromaticAberration":{"enabled":false,"opacity":1,"blendFunction":13,"offset":[10,10]},"vignette":{"enabled":false,"opacity":1,"blendFunction":13,"eskil":false,"darkness":0.5,"offset":0.5},"noise":{"enabled":false,"opacity":1,"blendFunction":14},"colorAverage":{"enabled":false,"opacity":1,"blendFunction":13},"hueSaturation":{"enabled":false,"opacity":1,"blendFunction":13,"_hue":0,"hue":0,"saturation":0},"brightnessContrast":{"enabled":false,"opacity":1,"blendFunction":13,"contrast":0,"brightness":0},"depthOfField":{"enabled":false,"opacity":1,"blendFunction":13,"focalLength":0.1,"focusDistance":0,"bokehScale":1},"pixelation":{"enabled":false,"opacity":1,"blendFunction":13,"granularity":30}}},"metadata":{"version":1.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"5274D67D-12C1-4D74-8411-7ECB575B0313","userData":{"parameters":{"width":30,"widthSegments":1,"heightSegments":1,"depthSegments":1,"cornerRadius":8,"cornerSegments":8,"height":30,"depth":30},"type":"CubeGeometry"}},{"uuid":"1F9B7F64-562E-48B5-AA8D-AB049BCF5A7F","userData":{"parameters":{"width":61,"radialSegments":4,"heightSegments":1,"cornerRadius":8,"cornerSegments":8,"openEnded":false,"height":45,"depth":61},"type":"PyramidGeometry"}},{"uuid":"B93FB9F3-1D56-4D51-A5D0-2C905080D2E9","userData":{"parameters":{"width":38,"widthSegments":64,"heightSegments":64,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793,"height":38,"depth":38},"type":"SphereGeometry"}},{"uuid":"9294E6E3-BE82-4FDE-8D84-9B3B9D0873AA","userData":{"parameters":{"width":130,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.9,"height":24,"depth":130,"radiusTop":65,"radiusBottom":65},"type":"CylinderGeometry"}},{"uuid":"15CDDD19-C630-4301-A0D3-7344F369BBBF","userData":{"parameters":{"width":200,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.92,"height":28,"depth":200,"radiusTop":100,"radiusBottom":100},"type":"CylinderGeometry"}},{"uuid":"A9EE3835-2150-421D-A9F6-9E7DB6177DBB","userData":{"parameters":{"width":290,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0.92,"height":28,"depth":290,"radiusTop":145,"radiusBottom":145},"type":"CylinderGeometry"}},{"uuid":"C04F3942-5D98-4AD6-A3E7-ED464E0855B7","userData":{"parameters":{"width":420,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":350,"cornerRadius":4,"cornerSegments":8,"hollow":0.93,"height":36,"depth":420,"radiusTop":210,"radiusBottom":210},"type":"CylinderGeometry"}},{"uuid":"C687EB7E-087A-44CC-A5FD-F0404363FE2D","userData":{"parameters":{"width":76,"radialSegments":64,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":360,"cornerRadius":4,"cornerSegments":8,"hollow":0,"height":400,"depth":76,"radiusTop":38,"radiusBottom":38},"type":"CylinderGeometry"}}],"materials":[{"uuid":"D25809D2-238E-48BA-9030-56406A16D1CF","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":3,"uuid":"526CB8BC-C5E7-4CDA-9A99-EFEB6AC7A484","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"89AE8E1B-E767-48F5-8414-22EC53E938B3","f0_alpha":"E50F18AC-A061-4CCF-9CB1-20ADB91949BF","f0_mode":"D6C3B553-240C-45E0-9E6F-E11C67319648"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"DDFF3B0A-F31F-4795-A665-794C58489DF5","f1_mode":"AB80B9EF-C8AD-45FE-A5BE-E66304DEDE9F","f1_shininess":"7B21D4AC-2C79-438F-B40F-BBF9BA834FAB","f1_specular":"A94A2B06-26FF-4D3E-A6E1-23CBE3355004"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"FD83EA31-CEEE-4352-91A1-FA8AA79E258B","f2_bias":"BAA2B25C-0853-4153-A61A-913C275F85FB","f2_scale":"1FFE06D7-E70E-455F-84C8-058A79C861E8","f2_intensity":"23CD25F0-9EB8-4A57-B4B0-9AFD3639EA31","f2_factor":"92B72705-886E-4E70-93F8-1B1CCB3B6F89","f2_alpha":"058E6296-51AC-4536-9A8C-DCCDEFB1050C","f2_mode":"368F9C5A-F65A-4B2D-8F46-AA30F1CA9365"}}}}}},"glslVersion":null,"defines":{"PHONG":1},"extensions":{"derivatives":true},"vertex":"0613579F-C35A-4023-BFE5-8223C5E4A363","fragment":"0613579F-C35A-4023-BFE5-8223C5E4A363"},{"uuid":"34F6388C-DCDF-418E-BB8D-1F9CE90E8466","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":3,"uuid":"526CB8BC-C5E7-4CDA-9A99-EFEB6AC7A484","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"81B0FBEE-8281-43CB-81C6-12453CD13D10","f0_alpha":"A7A8A706-9B76-445B-A915-E7E8CEB3FD54","f0_mode":"B2DB2C46-9D4E-4653-9D99-F4DAAFDB0051"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"8657DB01-E0AC-4ECF-8B2D-DE0B8A82A681","f1_mode":"4AED0B2F-BD44-47F0-9CCC-33B130182159","f1_shininess":"2561331E-63A8-4B6C-9914-DE3E1AC307DF","f1_specular":"387BA37D-7F97-441D-89EE-53440A41D8DC"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"C001D778-1AF0-41A9-8075-6F315F852C37","f2_bias":"8B2F59C0-3A72-4BEA-AA6E-F25F725E848C","f2_scale":"A52C9481-DEC3-44E2-BBF8-977E2B29FA09","f2_intensity":"BC7C0D29-0B19-4BA6-A89B-CC1B200C18AD","f2_factor":"5BF6DC98-FDFA-4D4B-A8EC-8387EA522DB9","f2_alpha":"F2EE8A47-55E5-4055-815C-E37265B15B94","f2_mode":"641A69D4-67BC-4F73-8640-0BC4D5D30A5D"}}}}}},"glslVersion":null,"defines":{"PHONG":1},"extensions":{"derivatives":true},"vertex":"6A712968-51A9-4239-ADDE-1D477BDB87C0","fragment":"6A712968-51A9-4239-ADDE-1D477BDB87C0"},{"uuid":"BC5888BF-B190-4383-BA01-AAE17067AADA","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":3,"uuid":"526CB8BC-C5E7-4CDA-9A99-EFEB6AC7A484","head":{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"84923B9E-164F-4D21-B381-CE6587B2A307","f0_alpha":"ABA8CF37-6DC6-4606-9A5E-247CBCAA8F24","f0_mode":"9802FEDD-1C3E-4EC1-8866-665848E1E33D"},"next":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"1B82467C-B528-4BC3-AC5E-2C8935DBE0D1","f1_mode":"B913E685-4179-41F5-A77B-B0C45C5DBA9F","f1_shininess":"27388DD0-CAEA-45BB-B2CE-3E3203210B08","f1_specular":"A4940268-F99E-4D1C-BE77-7E8BC70233DD"},"next":{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"69321E9E-FEDA-4C3C-B352-38B86C936232","f2_bias":"677A54BE-E14B-407D-858C-09E03F46C782","f2_scale":"1C4F18EC-3AD1-4FF3-9994-F853585E658C","f2_intensity":"36CBC744-30E6-45D0-AE2C-698342A22472","f2_factor":"C49D3A13-0075-49E1-858D-2270B5BEACCA","f2_alpha":"65DAA689-25F9-43D1-9CAF-DDB6F25C351E","f2_mode":"CC8282CE-886F-4E14-81F6-B7DB3FF15A50"}}}}}},"glslVersion":null,"defines":{"PHONG":1},"extensions":{"derivatives":true},"vertex":"6BF15563-47C7-414B-AA9B-C89D429B5777","fragment":"6BF15563-47C7-414B-AA9B-C89D429B5777"},{"uuid":"558F61DF-3FB0-4DDC-9F29-D99391BE9C07","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"85D3BC74-33F5-488B-8B57-183ABC86A5EF","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"7EA264C7-71F4-4ED0-865C-6C54E9FC5CF1","f1_mode":"7188159C-7059-47D5-B50E-4E334AF078C3","f1_shininess":"ABD1597C-BD10-4D9D-BCAC-1ADFF0EE1F3A","f1_specular":"10E3486D-3D4E-4548-9B85-5AEB081B5527"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"45C61DEF-0F6A-42C0-AA2F-319A15D506D1","f2_ior":"4698B968-6FFD-420E-A6FF-17F5467AB2D8","f2_roughness":"185129A1-57D4-4F55-B943-A769D38331D6","f2_transmissionSamplerSize":"D31D4156-737F-4739-BA8A-42527B900D56","f2_transmissionSamplerMap":"2A69F391-C374-4AA5-AD24-0863926158EA","f2_transmissionDepthMap":"B5BC25B7-6C2C-4B28-B3F2-C3E5D67F4426","f2_aspectRatio":"5D178FE1-3731-425E-BFDE-A69F17348ECD","f2_alpha":"5EC64A7D-AD82-42E7-A51B-2D0888A442AB","f2_mode":"EDEE4CFE-30D5-420A-8C03-D13279B6AE04"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"8E934677-DA55-4196-A401-AA134FC8EAA2","f4_far":"56E9191A-5B3F-4915-BC24-2611647FA0B6","f4_isVector":"01F93527-F34F-476B-94A2-FE4680C9E1ED","f4_isWorldSpace":"2CCF293D-69E5-4A65-87AD-269B5F6B1651","f4_origin":"EDAC64BD-34DE-48F6-886C-526FA0BD15A3","f4_colorA":"19D04065-12F2-4CCF-B395-71539FA99A4C","f4_colorB":"45E9C0BC-3746-43EC-814C-B431EF1D012A","f4_alpha":"0F325D1C-D3F7-40DC-B724-61FC44CFCC82","f4_mode":"2112446E-20ED-477C-A8DA-AF264B10497C"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"98CC315E-4DE1-4C94-A107-4F1A9AB0E8C3","f3_bias":"FDE56E27-E61F-4F17-9E90-B15F511379E1","f3_scale":"6FC02389-7977-44D5-9559-B4B6409C9143","f3_intensity":"B44A4EAF-7973-4451-B5C9-574409606811","f3_factor":"2629FEC6-D7E8-40BB-B55F-2DE6C05EB03D","f3_alpha":"A78D6508-A6FD-4CE6-9682-9BC54F81E1F1","f3_mode":"0C07548D-2B01-45EA-B9CC-C87AFF51856F"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"7133BC6B-7D0B-47CA-8558-4BC35835D7A5","fragment":"7133BC6B-7D0B-47CA-8558-4BC35835D7A5"},{"uuid":"59AF4ABF-6168-480C-9890-21FFBB028CAD","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"FCFB4E34-3B05-479A-BA68-59B33901C3B5","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0E95E98D-0406-4C2F-835A-00E0BB396B12","f1_mode":"CF648295-4407-4325-B65A-AACB1FFA63FE","f1_shininess":"8F05E0AE-A9F1-42D4-BD7C-D404800D1610","f1_specular":"A2217AC5-F659-432E-9AD1-5C26E2CD71F9"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8063481F-9ADE-40AB-B9B4-4E88B23AC97A","f2_ior":"EB673A07-F696-4B06-85D3-9B822C18AD92","f2_roughness":"1FD8DA1F-D5FA-4DE6-9382-309010BE637E","f2_transmissionSamplerSize":"82E0F7AF-BF80-428E-99CA-4B2D176268AF","f2_transmissionSamplerMap":"502889AA-2671-4696-88E6-BA58EB8FCA3B","f2_transmissionDepthMap":"650F3016-4457-432A-B6B0-7D274F174844","f2_aspectRatio":"BACB2C4F-16D4-4E58-A040-25277C4B60C1","f2_alpha":"21C63DF7-69E3-4283-969B-DD9F4447C8BE","f2_mode":"086BF03A-3629-42F5-8E74-D8A8B87ACB01"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"9A970DA8-9573-484A-9B99-E50C59D779EB","f4_far":"B7C9393C-01F6-48D7-B973-5A173132FDD9","f4_isVector":"75454374-339C-4EB4-BFEF-C83FFA405FF6","f4_isWorldSpace":"16FFEA42-9911-4779-8F18-D85C4F3CCE02","f4_origin":"B4621C04-9E7B-4BC9-BFB3-516D153427AF","f4_colorA":"5AF33F6F-2D34-4ED7-9A49-8C5526181091","f4_colorB":"16E3E94F-850B-4C1C-B39A-122A2C307A54","f4_alpha":"A8C37B6A-BB6B-46E0-919D-9B428CF91C64","f4_mode":"961763ED-D111-4960-8B49-DD285CD33DE6"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"727E8982-D8FA-4BBE-9AAB-05D17F42E950","f3_bias":"73C52938-B2DB-45B1-B96F-6335852F1546","f3_scale":"63656EC1-C09B-4867-BBD5-A85B75794786","f3_intensity":"026A0CDC-51EB-41F3-BFE6-A6300073DC43","f3_factor":"13A946F9-9611-4F71-8B3D-5B0D401110DC","f3_alpha":"B5B2428A-6294-4367-A611-3D5E1247ACB0","f3_mode":"3D729AF1-EAF4-4634-8203-6644E5F51383"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"9DDD18E4-19DE-407D-976B-D4357825D6F4","fragment":"9DDD18E4-19DE-407D-976B-D4357825D6F4"},{"uuid":"899A47F3-E0F6-46D2-833B-B9C348E27135","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"FCFB4E34-3B05-479A-BA68-59B33901C3B5","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"3AC33494-A00C-4596-9B47-87EC5C087754","f1_mode":"A17ED5E9-E311-434F-82D3-0F0714B4F042","f1_shininess":"88E53EB1-0772-47CE-8680-EF1CC95D8E36","f1_specular":"9D2128E5-5051-4E7B-AEA8-E489558CDDD9"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"8D329116-B553-4415-92F9-848A56A299B4","f2_ior":"3F77F8A1-0619-4E96-81BA-FA76E4B5A512","f2_roughness":"EF31439C-FD1F-4471-86FB-064EE4CD34CD","f2_transmissionSamplerSize":"AA794956-BFD7-4F7B-8B5B-098B0BF5BF75","f2_transmissionSamplerMap":"E74D120D-297E-406D-AFCB-9E98307EF4ED","f2_transmissionDepthMap":"9AE2EDCE-1942-4876-9521-3473DFADEAF5","f2_aspectRatio":"871F8A6C-55EE-48FD-AFC5-DB46C1D691D4","f2_alpha":"2853B03D-ED8E-489F-9669-25490BECA6D0","f2_mode":"4F2FFC8F-BE9D-474D-9A0F-364F3A4AEE1F"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"D34F1186-33FA-4C64-8A71-2927F4DA5F39","f4_far":"58082F32-FF2C-4A74-BD27-AD99BE370E32","f4_isVector":"6DDE8B9C-FE79-4651-B69C-A4F6FBF819D9","f4_isWorldSpace":"2587B0BC-1F6F-4BF5-B456-3513E6A3CF15","f4_origin":"CFFBA6EE-47F0-49DF-B2A3-818868565163","f4_colorA":"464E7BC8-2E26-44BC-963D-369F74889019","f4_colorB":"D6B73F6D-A70B-4EA0-B2F7-20748C0FD912","f4_alpha":"707F8DDE-8EEC-4E8B-84AF-1AF73BB93CE2","f4_mode":"D4EDF1FF-669E-402E-9ABF-111C9A761242"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"14693A23-B842-4A15-9F94-34594E1B5FEB","f3_bias":"441D2F10-79D5-4C46-801F-8FD6ECFC07E6","f3_scale":"B922806D-FCDB-4775-970B-79B4C038CFA1","f3_intensity":"39F27D09-B7CB-4374-A77A-EC295451ADF7","f3_factor":"C3A5B73F-C46E-44AA-BFA6-2BAA0A8C3405","f3_alpha":"80B15F6F-5A1F-44C7-B011-CA3092E9EC3E","f3_mode":"80BA7A4E-A1B7-44A1-A44E-05BD1E6AFF13"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"C91715F8-C49C-4A0F-9B8D-DE59410ECA76","fragment":"C91715F8-C49C-4A0F-9B8D-DE59410ECA76"},{"uuid":"30B2E26E-31CD-46DB-9FB3-EA1A74B4CF27","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"08A4DC83-43F4-4A7E-87DF-7C3E39E15ADD","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"06B2C305-79AE-4595-A4DD-2F02DE8279F8","f1_mode":"201AECEA-F873-4CEE-A859-59D0841FA6FC","f1_shininess":"22C31676-6862-4B87-AD0D-1E46941CA78B","f1_specular":"57D296E1-9AAC-4C27-8419-8304B360517A"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"313A1466-A105-4FCD-8BA4-59ED91DD0AE9","f2_ior":"C14171E5-1371-4386-A9E5-13D6701727E8","f2_roughness":"77CEDB05-6CA0-4FDB-A458-ECCCACDC3B41","f2_transmissionSamplerSize":"39D36811-F12D-4FA9-BBA0-61C6EFECC018","f2_transmissionSamplerMap":"EDFB7028-DA8A-465D-8A67-D3D04CBBB22B","f2_transmissionDepthMap":"73A4B930-11B9-460A-AFBE-332D43838886","f2_aspectRatio":"EA4D4EBA-4E12-4DD0-90D0-2522FAA38D0F","f2_alpha":"CE1C084A-2706-4656-BE4E-2503422E2C74","f2_mode":"2A75F996-F4F3-453C-8A39-B50F3B6EE02D"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"3C7E575F-4BC5-4310-8D3F-47884449D43A","f4_far":"7A999A0F-2DB6-4822-9748-0306765F169F","f4_isVector":"B7B1D442-2543-444F-8C4B-84ABA4CB8436","f4_isWorldSpace":"C90066F8-511B-4B67-905B-B117813574B1","f4_origin":"E94ED7D3-445E-4240-9772-5ADF7F910720","f4_colorA":"C1A7B71F-050C-423D-B78D-9EFE8FFC0A84","f4_colorB":"2F2FA8E2-3B2F-46F8-8425-FB981AF9DAED","f4_alpha":"D3BF3A9F-1A54-417F-95B8-5D8B2711C767","f4_mode":"24F078FE-2EA3-4F0E-B92A-A5ADC7F07CC7"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"F7B69A82-5DD5-4F0C-ADE9-F77971E18BCC","f3_bias":"54C0249F-3C10-414D-9011-8D3A607BD3C7","f3_scale":"7B99B840-2211-4516-B976-E36BF6348A06","f3_intensity":"C7849E0E-2AF7-409D-9F82-77A34623449D","f3_factor":"448D4A9C-FCED-47FF-B746-4818043C05E5","f3_alpha":"C38BD11C-EC9B-460F-ACF2-412512058AA3","f3_mode":"602A72B6-DCEF-4EFB-A2A1-8FBC2921A3D2"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"251482DA-E119-49C6-9251-F2B54EACC554","fragment":"251482DA-E119-49C6-9251-F2B54EACC554"},{"uuid":"36E0FCF7-A3F7-44C4-8529-979039F9C3C9","type":"ShaderMaterial","transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"dithering":true,"wireframeLinecap":"","wireframeLinejoin":"","userData":{"type":"PhongMaterial","category":"Phong","nodeType":"PhongNodeMaterial","layers":{"id":5,"uuid":"0409F9D5-64B6-4DC0-B746-494EBD755751","head":{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"D1610997-AD7B-46F0-8B28-6A425E9F591D","f1_mode":"FB1D70A1-5C68-4092-910F-A4FAE13D1B99","f1_shininess":"939E2849-53B4-4785-88AB-EC28175687A1","f1_specular":"F478B4F3-0F24-465A-9FA0-698693C78415"},"next":{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"97FC1ED8-C9C2-45A9-BE43-AFCEA65AAE34","f2_ior":"CE37161D-71A8-4C11-B123-36F59B7ECDA9","f2_roughness":"0E2E935B-56BD-4059-9D8D-F2CDDC8075FA","f2_transmissionSamplerSize":"D56C4F5D-8772-44E3-93E6-319462EFF8C6","f2_transmissionSamplerMap":"09C2C057-DAE7-417C-AFF7-4E939F66D7BF","f2_transmissionDepthMap":"1815C1A3-62E3-419D-8E6B-CFB9C15FACC5","f2_aspectRatio":"CC056B07-F3FB-45DF-A4D6-68CAEAE9C4E0","f2_alpha":"6115599A-82EA-4A3B-8A61-42443BF44062","f2_mode":"6DA3D72E-5861-481C-B2BD-878BF969969E"},"next":{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"C11CA0E3-52E8-4794-B6C8-6E4CCC8E27BE","f4_far":"B2672A2B-5949-4339-BC58-A22C7DA2C82B","f4_isVector":"6DC49C31-303A-4502-8B04-11162A372281","f4_isWorldSpace":"9A68A3DA-9E5D-4294-BF60-B35184AF1707","f4_origin":"88A90F92-322D-480C-855E-939DC901CC75","f4_colorA":"363B3273-4DB3-41A1-9789-6C59B8BD4C24","f4_colorB":"E4436B8F-B34A-48F1-8440-EF1C2BA2F6FB","f4_alpha":"ECFB6211-4B64-48CF-803A-ACDE47F42332","f4_mode":"B8EDD030-E150-4773-B31C-31797F1A3235"},"next":{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"76B794EB-261A-4DE5-9021-D1C6D95F45CE","f3_bias":"4D6376AE-3A05-4DFD-A858-8A277ED9F665","f3_scale":"6D290AF5-8209-4551-BE5A-B89BA10B551A","f3_intensity":"552EF6AA-2259-4D21-92BA-B2A21C60228D","f3_factor":"CEE2CE48-6DDC-43F2-9A63-19771B62A08B","f3_alpha":"805260BC-F0C7-44CF-BCCD-1FADDAD1908F","f3_mode":"259C5F30-4C5F-4A19-B6B9-B792098F410F"}}}}}}},"glslVersion":null,"defines":{"PHONG":1,"NUM_SAMPLES":30,"GRAD_MAX":10},"extensions":{"derivatives":true,"shaderTextureLOD":true},"vertex":"D4254CF6-451B-423B-B2AC-4694CB4A19C9","fragment":"D4254CF6-451B-423B-B2AC-4694CB4A19C9"}],"textures":[{"uuid":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"B3453CFD-9E61-4814-B360-24937593A53D"},{"uuid":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","name":"","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1026,"type":1012,"encoding":3000,"minFilter":1003,"magFilter":1003,"anisotropy":1,"flipY":false,"premultiplyAlpha":false,"unpackAlignment":4,"image":"ED04A1D9-6DDF-4E52-8415-7A09937A6712"}],"images":[{"uuid":"B3453CFD-9E61-4814-B360-24937593A53D","url":{}},{"uuid":"ED04A1D9-6DDF-4E52-8415-7A09937A6712","url":{}}],"interactionStates":[{"uuid":"BC58F3BD-3CD5-4903-BCE1-C32002D556A2","name":"Base State","position":[-132.1635384266761,-51.1373856647624,-495.86793449695807],"rotation":[-1.2573272724375641,-0.2661188930565406,-2.5891426069016284e-16,"XYZ"],"scale":[0.999999999999998,1.000000000000001,0.9999999999999923],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":30,"height":30,"depth":30},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"8A7BCB47-B798-43B9-BF2F-DE61DD019F36","f0_alpha":"BD95C577-BD73-492D-AF54-0B0DE9CD3ED5","f0_mode":"7E13A867-BDE8-48ED-9F50-C28559EEBD44"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"10151949-6954-4C39-B584-B82A8014BF53","f1_mode":"EB16A10C-2641-40CC-BD8E-F99FA55E1D01","f1_shininess":"172F7515-1B76-4119-BA50-A03181E56CE9","f1_specular":"DF34EFA8-E80F-4EB5-A85A-FA0935F74826"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"3A842432-F0A6-486C-80A5-D54BF3922336","f2_bias":"C8ADB999-DE45-4640-B7EF-E522B028303A","f2_scale":"255E100A-0262-4331-A6BC-6A4888B4073D","f2_intensity":"347ACF6F-2A26-4847-814E-5A69B7C7D6F2","f2_factor":"C1D2DAFA-FCF5-4BF6-8BA7-56CA88712EF8","f2_alpha":"D4FBACD8-ED06-4756-8CEA-47C8B3082CC4","f2_mode":"659141BF-18DA-4377-92D7-81013220DA6F"}}]}},{"uuid":"71CFA7D6-3621-4E22-B4C1-AA0E70477794","name":"State 1","position":[-132.1635384266761,-51.1373856647624,-495.86793449695807],"rotation":[-1.5872191416320136,-1.2040861197618644,1.537887162294093,"XYZ"],"scale":[1.0000000000000038,1.0000000000000109,0.9999999999999971],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":40,"height":40,"depth":40},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BA3467C7-BAAE-440E-9108-7CC0D46F0D24","f0_alpha":"543E3328-9ED0-456A-B38A-571850D66A5A","f0_mode":"27AC3756-817D-42CD-BB8B-BC2628C7707F"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E70188AD-66EF-4A61-9E59-0A436ABF5A97","f1_mode":"51CC54FD-9007-4DA2-96D8-51142E051C21","f1_shininess":"ED7FB6C3-0314-4CE0-BB42-9A7E3F5248BE","f1_specular":"BCA6A89E-7207-4399-AAEA-2E12E43E0EF9"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"D1A03582-C022-411B-9EBD-69A8D401B1B5","f2_bias":"8464B75F-B408-4DB0-9096-8BE70D5700D0","f2_scale":"2E04EF20-D020-4198-BB74-8A856DD6822B","f2_intensity":"33E9EA37-C425-4DFE-9012-E4A1D55E9435","f2_factor":"7BFD8229-DD64-4072-900C-3A73F543C7FA","f2_alpha":"6529EA3A-2324-47D2-BBD5-1775167C84AC","f2_mode":"6C4B3A6F-4960-41E6-914F-0F214342ABE5"}}]}},{"uuid":"9F8D0167-E3AC-4D02-AC9B-AFF3DCBDED1F","name":"Base State","position":[29.837735321981295,174.88806212317647,343.15660199269524],"rotation":[0.502421637412679,0.36617325636721515,0.16369631063246787,"XYZ"],"scale":[0.9999999999999978,1.0000000000000016,1.0000000000000007],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":61,"height":45,"depth":61},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"B928B6B0-4BF4-4789-B77B-BCE5FB17FD92","f0_alpha":"13B7170F-693C-4D35-BE9F-59E570763FE8","f0_mode":"32A41814-2C1B-4C6A-BAB2-7503183A8C65"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"E7884315-9008-4A38-A485-7FFF43373F66","f1_mode":"FD856366-A342-4751-9DDD-C5F8B525F173","f1_shininess":"485D142F-E456-4933-BD2A-72E1D3FCCCB8","f1_specular":"D814DA35-3809-4D11-924E-E30D3B8B4881"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"AD16CFDB-883D-479E-98C7-2589BD6A6048","f2_bias":"47B04EE5-B12A-49F4-A73D-CE82445F52D4","f2_scale":"63185767-21B0-42A3-82AD-8925D657E96D","f2_intensity":"A395279A-0365-4276-B635-BA7725C63813","f2_factor":"37E995F8-0364-4CE9-9F33-4B81999A1724","f2_alpha":"85C070E6-1CE4-49CC-8B1A-114F212CBF92","f2_mode":"2C03394B-03DC-41DB-8D3C-BEF7223BB4BD"}}]}},{"uuid":"3C323F54-4B75-4F4C-B824-5D44E6A2C87B","name":"State 1","position":[29.844518132183396,174.8507694921833,343.13314377626017],"rotation":[-0.10974678314739215,0.05016625548815775,1.178569242773016,"XYZ"],"scale":[1.0000000000000002,1.0000000000000047,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":75,"height":55,"depth":75},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"CAB727DA-26D1-4632-B9DE-4ED44AFCA1C3","f0_alpha":"00BB0D73-4056-4E9F-A3AC-0CFD7BE6F05C","f0_mode":"AEB19076-5DAD-4F84-A8A1-2226E7CA9BD6"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"0CB30A76-AFE4-42F8-AD52-8CD9540A370B","f1_mode":"3597A449-C9AA-4626-BCAC-E111E0A28E47","f1_shininess":"15664F5D-457C-4813-A582-CE1D24212F9C","f1_specular":"DA526FEC-EDF1-4C87-BA66-3216B17661C8"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"075C09DA-782C-482E-B2BD-922DC17C5063","f2_bias":"51F0E167-F67E-497F-8EA6-4B7F5827EAAC","f2_scale":"AE6C1C84-A3C2-4A7A-94C9-D75412DC0D27","f2_intensity":"4D27FCD4-09A9-4B77-90E2-53EBED8C56EB","f2_factor":"475AD723-ACDC-489E-820F-0D1CEF6ED3FA","f2_alpha":"A96C87B3-5F3E-4479-9BF9-6B271BEAC753","f2_mode":"8878E430-01FC-4463-B9BC-2D2E531EF267"}}]}},{"uuid":"14EA539B-8A15-4CC1-893E-755FC9F429FB","name":"Base State","position":[-333.61962033438857,62.4305143567372,-274.8879842740688],"rotation":[-0.026450441036634055,0.7807114405723217,0.020479854778938232,"XYZ"],"scale":[0.9999999999999998,0.9999999999999987,1.0000000000000004],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":38,"height":38,"depth":38},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"BDAE18FB-1AFD-4D8D-BFF7-A6D61EFDA4D4","f0_alpha":"21310CC8-E003-402C-9475-CB0E4920AF06","f0_mode":"16EC2003-E18F-4DF4-A750-BD838B2909B1"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"6284BE03-2A60-45A7-8E61-CC63B71E159F","f1_mode":"FD542482-159A-4116-A005-6F64B369B8AB","f1_shininess":"466C33EC-8121-4E86-A1F0-445AC1C8ECBD","f1_specular":"F1BB6A1F-32AF-433B-8C28-F242E8406B0D"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"C2C8AD2E-E3EC-4F52-AF08-3A0B004FF5D9","f2_bias":"977D1819-5930-41EC-9E7C-86BA0DF92D42","f2_scale":"0ED18A1D-471E-4B7C-B0C7-679989B39421","f2_intensity":"C21C4AD9-FF37-44F8-BBE4-461C9880E9A8","f2_factor":"D1975D5C-10D9-477C-AFD8-62375931DDE6","f2_alpha":"62107FE0-09D0-4402-9C93-BF6CB64CF235","f2_mode":"1F209056-9C31-40AD-92D7-77123A321CA2"}}]}},{"uuid":"DA36A9DD-1B5E-4A72-8AD1-A36ABA0D8FC5","name":"State 1","position":[-333.61962033438857,62.4305143567372,-274.8879842740688],"rotation":[-0.026450441036634055,0.7807114405723217,0.020479854778938232,"XYZ"],"scale":[0.9999999999999998,0.9999999999999987,1.0000000000000004],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":53,"height":53,"depth":53},"material":{"layersList":[{"id":0,"type":"color","defines":{},"uniforms":{"f0_color":"182F7A23-FB0A-4C98-950E-A5F0A92A163D","f0_alpha":"5BB060A5-D81C-4CC2-B19E-C61EC499E93E","f0_mode":"A1DB2DF1-CA89-4F2A-B8CE-5587F7D6B1D1"}},{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"453EC575-3931-4038-95D5-24A6B6EBD545","f1_mode":"A32CBAB1-E319-4505-BF93-6D5447767A72","f1_shininess":"7D34C018-E5FF-4899-B65E-EAFA9C27E4AD","f1_specular":"5DC54CF8-66FA-4266-88D5-ED3A346784C6"}},{"id":2,"type":"fresnel","defines":{},"uniforms":{"f2_color":"87DD833F-D385-4410-AB3D-43F90B3610EC","f2_bias":"4A024D30-365B-4C47-B742-2D0C20CDF418","f2_scale":"C4C84375-D82C-4D01-960F-009F63B4E6AC","f2_intensity":"88E70DF7-6396-4C6A-991A-75907EC13545","f2_factor":"D529463E-82FF-47BA-9559-5C4E62AC68C5","f2_alpha":"030FCE0A-5326-43E5-A15D-B03F2D0C60CD","f2_mode":"F1C5040A-CF5E-4AA0-8188-458ABDB22774"}}]}},{"uuid":"28C6E18F-BD7B-413E-B4ED-F42B470C1036","name":"Base State","position":[8.228765814177173e-16,209.99207679614122,8.228765814177175e-16],"rotation":[1.224646799147353e-16,-2.4492935982947064e-16,-1.224646799147353e-16,"XYZ"],"scale":[1.0000000000000187,1,1.0000000000000187],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"60958BAD-DABC-41F6-B777-52A02438E644","name":"State 1","position":[8.228765814177173e-16,209.99207679614122,8.228765814177175e-16],"rotation":[-3.141592653589793,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.0000000000000318,1,1.0000000000000318],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"307C44B4-30D0-4E0B-B608-EBE4C807AA0B","name":"Base State","position":[0,153.05834378711734,0],"rotation":[1.2246467991473532e-16,-7.498798913309288e-33,-1.2246467991473532e-16,"XYZ"],"scale":[1.0000000000000264,1,1.0000000000000264],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"D31CB886-58BE-48A1-A431-1DF575DCAC6E","name":"State 1","position":[0,153.05834378711734,0],"rotation":[-3.141592653589793,1.2246467991473532e-16,-3.141592653589793,"XYZ"],"scale":[1.0000000000000355,1,1.0000000000000355],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"83EC61E5-EF47-4AEB-BA00-B0133D85C366","name":"Base State","position":[0,115.09081537009483,0],"rotation":[1.224646799147353e-16,-2.4492935982947064e-16,-1.224646799147353e-16,"XYZ"],"scale":[1.000000000000036,1,1.000000000000036],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"25749767-B480-4A5B-9EAA-2B33D9EF0B84","name":"State 1","position":[0,115.09081537009483,0],"rotation":[-3.141592653589793,0.08726646259971674,-3.141592653589793,"XYZ"],"scale":[1.0000000000000506,1,1.0000000000000506],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"9C36471C-D54D-40ED-B233-7308B35AE9BF","name":"Base State","position":[-4.079219866531334e-15,129.78775382679308,0],"rotation":[0,0,0.3490658503988662,"XYZ"],"scale":[0.9999999999999986,0.9999999999999986,1],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":420,"height":36,"depth":420},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"96165FFC-AACC-4116-9ECA-1AC5613CB9E2","f1_mode":"1FC152A8-357F-43D1-AE5F-DCAE99256AB2","f1_shininess":"D8073CF0-AE9F-4695-BF3F-1FBA62AF9D9E","f1_specular":"1F143F2B-A124-42E4-8116-88AEAAC2431F"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"17C283BD-9ACD-4C6F-8C0C-D6F4AB2C39CD","f2_ior":"E11A4249-8C29-4242-8A3D-E9CE2471BD1E","f2_roughness":"0482F9D2-542D-4D66-BD9E-2BCBDF9B3742","f2_transmissionSamplerSize":"0F883881-760E-4DF8-934A-40704B86ADAE","f2_aspectRatio":"9D655B10-697B-420A-8CA9-87BC5C518E18","f2_alpha":"6CC6B692-C43C-40E8-BB38-F704381C56F0","f2_mode":"3F265BEB-2D6B-458C-8F16-DA203EEA4EB3"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"52D4EABA-B824-4355-B0C6-91F768F33716","f4_far":"96DA9698-8D92-4969-8A99-12543282F324","f4_isVector":"F6EDAF8B-018E-44AE-B552-CA5E4752A8D4","f4_isWorldSpace":"42F405AB-C8DD-4C9B-9FF1-14E081B82B3A","f4_origin":"A4F66088-6F3A-4A85-85F3-C8AE1A381926","f4_colorA":"B17AB7D1-E955-4503-8B75-96545B54597A","f4_colorB":"7D7B2090-DB08-4587-A4D7-E0C5A1C2BB12","f4_alpha":"DCBEFFB9-9FDE-41FB-80C0-BA224473E67B","f4_mode":"701C6761-5DD8-4435-9598-451ED3A1F2C1"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"10EACED7-3E6E-4109-AF88-47C9ADB40F97","f3_bias":"CD948738-959A-4FE4-A4A4-7FAE5C8A8964","f3_scale":"E899863E-C401-45B8-BC12-8DF856238AEB","f3_intensity":"09610B96-DC77-4693-A357-4BD79E381C0B","f3_factor":"FF7BE623-76DD-4B93-928F-CC1957A17521","f3_alpha":"9C15C6F6-B747-480C-88CF-787ED132C91A","f3_mode":"3F6BE5C4-EED1-4529-866E-278E3F2C7787"}}]}},{"uuid":"78C26B35-2E45-4B25-BBC0-902DC72A3D6B","name":"State 1","position":[-4.079219866531334e-15,129.78775382679308,0],"rotation":[-3.141592653589793,1.1507915602278503e-16,2.792526803190927,"XYZ"],"scale":[1.000000000000053,0.999999999999999,1.0000000000000613],"hiddenMatrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":{"width":420,"height":36,"depth":420},"material":{"layersList":[{"id":1,"type":"light","defines":{},"uniforms":{"f1_alpha":"42D6FE80-1564-48AF-9E44-E840FF2EE16F","f1_mode":"8CD06069-BE47-49D9-BFB4-D3AF9B076EBB","f1_shininess":"72B8C12D-06E0-4795-9179-ED50CC2870A3","f1_specular":"30FD1A6B-AD9C-4B9E-AACC-08A087F78FFA"}},{"id":2,"type":"transmission","defines":{},"uniforms":{"f2_thickness":"0F108852-FA6C-47D5-84DD-4745B7BCF0CC","f2_ior":"3E603996-1E6C-4555-AB66-B6B552D54D49","f2_roughness":"BDA7F323-7B98-4757-A3A5-DDA68B849CB7","f2_transmissionSamplerSize":"C5B17CF2-D279-4AAC-B58F-AEE55DC63566","f2_aspectRatio":"7273CF3A-320D-44C5-AFC0-A3A7E8A59796","f2_alpha":"A3A82D63-A6EC-4FA6-B7F5-EC1E48C4039C","f2_mode":"BCF14C5C-C0BA-49A0-AFF7-EC0B53DACD81"}},{"id":4,"type":"depth","defines":{},"uniforms":{"f4_near":"2331EC1B-1E63-4B15-B33D-6F973F91CE1D","f4_far":"F18B4472-0095-42EF-B65C-0DA6221AC458","f4_isVector":"6D083AC8-6A5D-4F25-A281-755CD2871F90","f4_isWorldSpace":"837DE60D-D16A-47F5-9C42-6896C601F380","f4_origin":"38C4830A-2E5D-411D-A69E-A6649B7F81B7","f4_colorA":"DD24024F-4730-4C35-87C6-F03EB9950DD6","f4_colorB":"100233E0-6F8C-4C01-BA6A-AF9C2A117808","f4_alpha":"893080D1-53E9-4D73-BCEB-2F5CBDFEE270","f4_mode":"179AC920-CE63-43B7-8BFD-8052A4E56D37"}},{"id":3,"type":"fresnel","defines":{},"uniforms":{"f3_color":"BF25FD85-A638-49E1-9DE9-388A9CE85125","f3_bias":"61DE709E-31E6-4DA3-A430-EB4F86EED2AF","f3_scale":"8D3E28A7-5E1A-4727-B7F6-DBDC452031D8","f3_intensity":"EFBC2D73-33A9-4732-BEC5-7FDE112F2A64","f3_factor":"E3F010C8-F253-4C55-9117-B63535A4CE7B","f3_alpha":"9ABBDF83-94CA-49B2-AF74-FB060F8E6FBC","f3_mode":"66278409-A2BD-4164-BA9E-9A501D7A253A"}}]}}],"nodes":[{"uuid":"8A7BCB47-B798-43B9-BF2F-DE61DD019F36","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"FB9F0FA9-2E52-4F88-9BF4-E02C4194C485","nodeType":"Color"},{"uuid":"FB9F0FA9-2E52-4F88-9BF4-E02C4194C485","type":"f","value":1,"nodeType":"Float"},{"uuid":"BD95C577-BD73-492D-AF54-0B0DE9CD3ED5","type":"f","value":1,"nodeType":"Float"},{"uuid":"7E13A867-BDE8-48ED-9F50-C28559EEBD44","type":"i","value":0,"nodeType":"Int"},{"uuid":"10151949-6954-4C39-B584-B82A8014BF53","type":"f","value":1,"nodeType":"Float"},{"uuid":"EB16A10C-2641-40CC-BD8E-F99FA55E1D01","type":"i","value":0,"nodeType":"Int"},{"uuid":"172F7515-1B76-4119-BA50-A03181E56CE9","type":"f","value":11,"nodeType":"Float"},{"uuid":"DF34EFA8-E80F-4EB5-A85A-FA0935F74826","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"3A842432-F0A6-486C-80A5-D54BF3922336","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"C8ADB999-DE45-4640-B7EF-E522B028303A","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"255E100A-0262-4331-A6BC-6A4888B4073D","type":"f","value":1,"nodeType":"Float"},{"uuid":"347ACF6F-2A26-4847-814E-5A69B7C7D6F2","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"C1D2DAFA-FCF5-4BF6-8BA7-56CA88712EF8","type":"f","value":1,"nodeType":"Float"},{"uuid":"D4FBACD8-ED06-4756-8CEA-47C8B3082CC4","type":"f","value":1,"nodeType":"Float"},{"uuid":"659141BF-18DA-4377-92D7-81013220DA6F","type":"i","value":0,"nodeType":"Int"},{"uuid":"BA3467C7-BAAE-440E-9108-7CC0D46F0D24","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"0A9DDC61-C82E-4E21-9E02-D10F47B0690D","nodeType":"Color"},{"uuid":"0A9DDC61-C82E-4E21-9E02-D10F47B0690D","type":"f","value":1,"nodeType":"Float"},{"uuid":"543E3328-9ED0-456A-B38A-571850D66A5A","type":"f","value":1,"nodeType":"Float"},{"uuid":"27AC3756-817D-42CD-BB8B-BC2628C7707F","type":"i","value":0,"nodeType":"Int"},{"uuid":"E70188AD-66EF-4A61-9E59-0A436ABF5A97","type":"f","value":1,"nodeType":"Float"},{"uuid":"51CC54FD-9007-4DA2-96D8-51142E051C21","type":"i","value":0,"nodeType":"Int"},{"uuid":"ED7FB6C3-0314-4CE0-BB42-9A7E3F5248BE","type":"f","value":11,"nodeType":"Float"},{"uuid":"BCA6A89E-7207-4399-AAEA-2E12E43E0EF9","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"D1A03582-C022-411B-9EBD-69A8D401B1B5","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"8464B75F-B408-4DB0-9096-8BE70D5700D0","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"2E04EF20-D020-4198-BB74-8A856DD6822B","type":"f","value":1,"nodeType":"Float"},{"uuid":"33E9EA37-C425-4DFE-9012-E4A1D55E9435","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"7BFD8229-DD64-4072-900C-3A73F543C7FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"6529EA3A-2324-47D2-BBD5-1775167C84AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"6C4B3A6F-4960-41E6-914F-0F214342ABE5","type":"i","value":0,"nodeType":"Int"},{"uuid":"89AE8E1B-E767-48F5-8414-22EC53E938B3","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"E50F18AC-A061-4CCF-9CB1-20ADB91949BF","nodeType":"Color"},{"uuid":"E50F18AC-A061-4CCF-9CB1-20ADB91949BF","type":"f","value":1,"nodeType":"Float"},{"uuid":"D6C3B553-240C-45E0-9E6F-E11C67319648","type":"i","value":0,"nodeType":"Int"},{"uuid":"DDFF3B0A-F31F-4795-A665-794C58489DF5","type":"f","value":1,"nodeType":"Float"},{"uuid":"AB80B9EF-C8AD-45FE-A5BE-E66304DEDE9F","type":"i","value":0,"nodeType":"Int"},{"uuid":"7B21D4AC-2C79-438F-B40F-BBF9BA834FAB","type":"f","value":11,"nodeType":"Float"},{"uuid":"A94A2B06-26FF-4D3E-A6E1-23CBE3355004","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"FD83EA31-CEEE-4352-91A1-FA8AA79E258B","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"BAA2B25C-0853-4153-A61A-913C275F85FB","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"1FFE06D7-E70E-455F-84C8-058A79C861E8","type":"f","value":1,"nodeType":"Float"},{"uuid":"23CD25F0-9EB8-4A57-B4B0-9AFD3639EA31","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"92B72705-886E-4E70-93F8-1B1CCB3B6F89","type":"f","value":1,"nodeType":"Float"},{"uuid":"058E6296-51AC-4536-9A8C-DCCDEFB1050C","type":"f","value":1,"nodeType":"Float"},{"uuid":"368F9C5A-F65A-4B2D-8F46-AA30F1CA9365","type":"i","value":0,"nodeType":"Int"},{"uuid":"0613579F-C35A-4023-BFE5-8223C5E4A363","type":"phong","color":"89AE8E1B-E767-48F5-8414-22EC53E938B3","specular":"A94A2B06-26FF-4D3E-A6E1-23CBE3355004","shininess":"7B21D4AC-2C79-438F-B40F-BBF9BA834FAB","shadingAlpha":"DDFF3B0A-F31F-4795-A665-794C58489DF5","shadingBlend":"AB80B9EF-C8AD-45FE-A5BE-E66304DEDE9F","afterColor":"F0E5F440-94DA-4081-BBBE-AADFBE7E9001","alpha":"AA87E7F8-AF2B-437E-9080-D1AEF50D902B","nodeType":"Phong"},{"uuid":"F0E5F440-94DA-4081-BBBE-AADFBE7E9001","type":"v3","a":"D2D8DF2E-561E-4E14-937C-703357211C8B","b":"94914A9F-D690-4091-8E4F-47A9897B5AFD","alpha":"EB5D05A2-1C21-44D1-977F-1EBFEA99699B","mode":"368F9C5A-F65A-4B2D-8F46-AA30F1CA9365","nodeType":"Blend"},{"uuid":"D2D8DF2E-561E-4E14-937C-703357211C8B","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"94914A9F-D690-4091-8E4F-47A9897B5AFD","type":"v3","color":"FD83EA31-CEEE-4352-91A1-FA8AA79E258B","bias":"BAA2B25C-0853-4153-A61A-913C275F85FB","scale":"1FFE06D7-E70E-455F-84C8-058A79C861E8","intensity":"23CD25F0-9EB8-4A57-B4B0-9AFD3639EA31","factor":"92B72705-886E-4E70-93F8-1B1CCB3B6F89","alpha":"058E6296-51AC-4536-9A8C-DCCDEFB1050C","mode":"368F9C5A-F65A-4B2D-8F46-AA30F1CA9365","calpha":"g94914A9FD69040918E4F47A9897B5AFD_calpha","nodeType":"Fresnel"},{"uuid":"EB5D05A2-1C21-44D1-977F-1EBFEA99699B","type":"f","src":"g94914A9FD69040918E4F47A9897B5AFD_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"AA87E7F8-AF2B-437E-9080-D1AEF50D902B","type":"f","value":1,"nodeType":"Float"},{"uuid":"B928B6B0-4BF4-4789-B77B-BCE5FB17FD92","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"C4D06215-164B-4C0C-A297-D1881465350E","nodeType":"Color"},{"uuid":"C4D06215-164B-4C0C-A297-D1881465350E","type":"f","value":1,"nodeType":"Float"},{"uuid":"13B7170F-693C-4D35-BE9F-59E570763FE8","type":"f","value":1,"nodeType":"Float"},{"uuid":"32A41814-2C1B-4C6A-BAB2-7503183A8C65","type":"i","value":0,"nodeType":"Int"},{"uuid":"E7884315-9008-4A38-A485-7FFF43373F66","type":"f","value":1,"nodeType":"Float"},{"uuid":"FD856366-A342-4751-9DDD-C5F8B525F173","type":"i","value":0,"nodeType":"Int"},{"uuid":"485D142F-E456-4933-BD2A-72E1D3FCCCB8","type":"f","value":11,"nodeType":"Float"},{"uuid":"D814DA35-3809-4D11-924E-E30D3B8B4881","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"AD16CFDB-883D-479E-98C7-2589BD6A6048","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"47B04EE5-B12A-49F4-A73D-CE82445F52D4","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"63185767-21B0-42A3-82AD-8925D657E96D","type":"f","value":1,"nodeType":"Float"},{"uuid":"A395279A-0365-4276-B635-BA7725C63813","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"37E995F8-0364-4CE9-9F33-4B81999A1724","type":"f","value":1,"nodeType":"Float"},{"uuid":"85C070E6-1CE4-49CC-8B1A-114F212CBF92","type":"f","value":1,"nodeType":"Float"},{"uuid":"2C03394B-03DC-41DB-8D3C-BEF7223BB4BD","type":"i","value":0,"nodeType":"Int"},{"uuid":"CAB727DA-26D1-4632-B9DE-4ED44AFCA1C3","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"ECA720E1-96E7-4DE9-AD4A-073F3474A1CC","nodeType":"Color"},{"uuid":"ECA720E1-96E7-4DE9-AD4A-073F3474A1CC","type":"f","value":1,"nodeType":"Float"},{"uuid":"00BB0D73-4056-4E9F-A3AC-0CFD7BE6F05C","type":"f","value":1,"nodeType":"Float"},{"uuid":"AEB19076-5DAD-4F84-A8A1-2226E7CA9BD6","type":"i","value":0,"nodeType":"Int"},{"uuid":"0CB30A76-AFE4-42F8-AD52-8CD9540A370B","type":"f","value":1,"nodeType":"Float"},{"uuid":"3597A449-C9AA-4626-BCAC-E111E0A28E47","type":"i","value":0,"nodeType":"Int"},{"uuid":"15664F5D-457C-4813-A582-CE1D24212F9C","type":"f","value":11,"nodeType":"Float"},{"uuid":"DA526FEC-EDF1-4C87-BA66-3216B17661C8","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"075C09DA-782C-482E-B2BD-922DC17C5063","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"51F0E167-F67E-497F-8EA6-4B7F5827EAAC","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"AE6C1C84-A3C2-4A7A-94C9-D75412DC0D27","type":"f","value":1,"nodeType":"Float"},{"uuid":"4D27FCD4-09A9-4B77-90E2-53EBED8C56EB","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"475AD723-ACDC-489E-820F-0D1CEF6ED3FA","type":"f","value":1,"nodeType":"Float"},{"uuid":"A96C87B3-5F3E-4479-9BF9-6B271BEAC753","type":"f","value":1,"nodeType":"Float"},{"uuid":"8878E430-01FC-4463-B9BC-2D2E531EF267","type":"i","value":0,"nodeType":"Int"},{"uuid":"81B0FBEE-8281-43CB-81C6-12453CD13D10","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"A7A8A706-9B76-445B-A915-E7E8CEB3FD54","nodeType":"Color"},{"uuid":"A7A8A706-9B76-445B-A915-E7E8CEB3FD54","type":"f","value":1,"nodeType":"Float"},{"uuid":"B2DB2C46-9D4E-4653-9D99-F4DAAFDB0051","type":"i","value":0,"nodeType":"Int"},{"uuid":"8657DB01-E0AC-4ECF-8B2D-DE0B8A82A681","type":"f","value":1,"nodeType":"Float"},{"uuid":"4AED0B2F-BD44-47F0-9CCC-33B130182159","type":"i","value":0,"nodeType":"Int"},{"uuid":"2561331E-63A8-4B6C-9914-DE3E1AC307DF","type":"f","value":11,"nodeType":"Float"},{"uuid":"387BA37D-7F97-441D-89EE-53440A41D8DC","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"C001D778-1AF0-41A9-8075-6F315F852C37","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"8B2F59C0-3A72-4BEA-AA6E-F25F725E848C","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"A52C9481-DEC3-44E2-BBF8-977E2B29FA09","type":"f","value":1,"nodeType":"Float"},{"uuid":"BC7C0D29-0B19-4BA6-A89B-CC1B200C18AD","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"5BF6DC98-FDFA-4D4B-A8EC-8387EA522DB9","type":"f","value":1,"nodeType":"Float"},{"uuid":"F2EE8A47-55E5-4055-815C-E37265B15B94","type":"f","value":1,"nodeType":"Float"},{"uuid":"641A69D4-67BC-4F73-8640-0BC4D5D30A5D","type":"i","value":0,"nodeType":"Int"},{"uuid":"6A712968-51A9-4239-ADDE-1D477BDB87C0","type":"phong","color":"81B0FBEE-8281-43CB-81C6-12453CD13D10","specular":"387BA37D-7F97-441D-89EE-53440A41D8DC","shininess":"2561331E-63A8-4B6C-9914-DE3E1AC307DF","shadingAlpha":"8657DB01-E0AC-4ECF-8B2D-DE0B8A82A681","shadingBlend":"4AED0B2F-BD44-47F0-9CCC-33B130182159","afterColor":"7EE9ECB0-4DA0-457D-9277-EC4430DD6C7F","alpha":"917643EC-E7E1-4655-A6ED-E92AE240060E","nodeType":"Phong"},{"uuid":"7EE9ECB0-4DA0-457D-9277-EC4430DD6C7F","type":"v3","a":"63FEE16C-FAE8-40C0-9040-88E49EF5B5EB","b":"0925D01D-B5F1-4B9A-9CE9-8F0972AFF02A","alpha":"9074066B-28A8-4855-8916-0D3A8B1C762A","mode":"641A69D4-67BC-4F73-8640-0BC4D5D30A5D","nodeType":"Blend"},{"uuid":"63FEE16C-FAE8-40C0-9040-88E49EF5B5EB","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0925D01D-B5F1-4B9A-9CE9-8F0972AFF02A","type":"v3","color":"C001D778-1AF0-41A9-8075-6F315F852C37","bias":"8B2F59C0-3A72-4BEA-AA6E-F25F725E848C","scale":"A52C9481-DEC3-44E2-BBF8-977E2B29FA09","intensity":"BC7C0D29-0B19-4BA6-A89B-CC1B200C18AD","factor":"5BF6DC98-FDFA-4D4B-A8EC-8387EA522DB9","alpha":"F2EE8A47-55E5-4055-815C-E37265B15B94","mode":"641A69D4-67BC-4F73-8640-0BC4D5D30A5D","calpha":"g0925D01DB5F14B9A9CE98F0972AFF02A_calpha","nodeType":"Fresnel"},{"uuid":"9074066B-28A8-4855-8916-0D3A8B1C762A","type":"f","src":"g0925D01DB5F14B9A9CE98F0972AFF02A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"917643EC-E7E1-4655-A6ED-E92AE240060E","type":"f","value":1,"nodeType":"Float"},{"uuid":"BDAE18FB-1AFD-4D8D-BFF7-A6D61EFDA4D4","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"758BF4B8-C310-4C0D-B159-894DA90A9414","nodeType":"Color"},{"uuid":"758BF4B8-C310-4C0D-B159-894DA90A9414","type":"f","value":1,"nodeType":"Float"},{"uuid":"21310CC8-E003-402C-9475-CB0E4920AF06","type":"f","value":1,"nodeType":"Float"},{"uuid":"16EC2003-E18F-4DF4-A750-BD838B2909B1","type":"i","value":0,"nodeType":"Int"},{"uuid":"6284BE03-2A60-45A7-8E61-CC63B71E159F","type":"f","value":1,"nodeType":"Float"},{"uuid":"FD542482-159A-4116-A005-6F64B369B8AB","type":"i","value":0,"nodeType":"Int"},{"uuid":"466C33EC-8121-4E86-A1F0-445AC1C8ECBD","type":"f","value":11,"nodeType":"Float"},{"uuid":"F1BB6A1F-32AF-433B-8C28-F242E8406B0D","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"C2C8AD2E-E3EC-4F52-AF08-3A0B004FF5D9","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"977D1819-5930-41EC-9E7C-86BA0DF92D42","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"0ED18A1D-471E-4B7C-B0C7-679989B39421","type":"f","value":1,"nodeType":"Float"},{"uuid":"C21C4AD9-FF37-44F8-BBE4-461C9880E9A8","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"D1975D5C-10D9-477C-AFD8-62375931DDE6","type":"f","value":1,"nodeType":"Float"},{"uuid":"62107FE0-09D0-4402-9C93-BF6CB64CF235","type":"f","value":1,"nodeType":"Float"},{"uuid":"1F209056-9C31-40AD-92D7-77123A321CA2","type":"i","value":0,"nodeType":"Int"},{"uuid":"182F7A23-FB0A-4C98-950E-A5F0A92A163D","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"76D10076-ECDF-4BBD-9698-1A806D9A480B","nodeType":"Color"},{"uuid":"76D10076-ECDF-4BBD-9698-1A806D9A480B","type":"f","value":1,"nodeType":"Float"},{"uuid":"5BB060A5-D81C-4CC2-B19E-C61EC499E93E","type":"f","value":1,"nodeType":"Float"},{"uuid":"A1DB2DF1-CA89-4F2A-B8CE-5587F7D6B1D1","type":"i","value":0,"nodeType":"Int"},{"uuid":"453EC575-3931-4038-95D5-24A6B6EBD545","type":"f","value":1,"nodeType":"Float"},{"uuid":"A32CBAB1-E319-4505-BF93-6D5447767A72","type":"i","value":0,"nodeType":"Int"},{"uuid":"7D34C018-E5FF-4899-B65E-EAFA9C27E4AD","type":"f","value":11,"nodeType":"Float"},{"uuid":"5DC54CF8-66FA-4266-88D5-ED3A346784C6","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"87DD833F-D385-4410-AB3D-43F90B3610EC","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"4A024D30-365B-4C47-B742-2D0C20CDF418","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"C4C84375-D82C-4D01-960F-009F63B4E6AC","type":"f","value":1,"nodeType":"Float"},{"uuid":"88E70DF7-6396-4C6A-991A-75907EC13545","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"D529463E-82FF-47BA-9559-5C4E62AC68C5","type":"f","value":1,"nodeType":"Float"},{"uuid":"030FCE0A-5326-43E5-A15D-B03F2D0C60CD","type":"f","value":1,"nodeType":"Float"},{"uuid":"F1C5040A-CF5E-4AA0-8188-458ABDB22774","type":"i","value":0,"nodeType":"Int"},{"uuid":"84923B9E-164F-4D21-B381-CE6587B2A307","type":"c","r":0.9254901960784314,"g":0.9568627450980393,"b":1,"value":15529215,"alpha":"ABA8CF37-6DC6-4606-9A5E-247CBCAA8F24","nodeType":"Color"},{"uuid":"ABA8CF37-6DC6-4606-9A5E-247CBCAA8F24","type":"f","value":1,"nodeType":"Float"},{"uuid":"9802FEDD-1C3E-4EC1-8866-665848E1E33D","type":"i","value":0,"nodeType":"Int"},{"uuid":"1B82467C-B528-4BC3-AC5E-2C8935DBE0D1","type":"f","value":1,"nodeType":"Float"},{"uuid":"B913E685-4179-41F5-A77B-B0C45C5DBA9F","type":"i","value":0,"nodeType":"Int"},{"uuid":"27388DD0-CAEA-45BB-B2CE-3E3203210B08","type":"f","value":11,"nodeType":"Float"},{"uuid":"A4940268-F99E-4D1C-BE77-7E8BC70233DD","type":"c","r":0.23921568627450981,"g":0.23921568627450981,"b":0.23921568627450981,"value":4013373,"nodeType":"Color"},{"uuid":"69321E9E-FEDA-4C3C-B352-38B86C936232","type":"c","r":1,"g":1,"b":1,"value":16777215,"nodeType":"Color"},{"uuid":"677A54BE-E14B-407D-858C-09E03F46C782","type":"f","value":0.32,"nodeType":"Float"},{"uuid":"1C4F18EC-3AD1-4FF3-9994-F853585E658C","type":"f","value":1,"nodeType":"Float"},{"uuid":"36CBC744-30E6-45D0-AE2C-698342A22472","type":"f","value":1.6,"nodeType":"Float"},{"uuid":"C49D3A13-0075-49E1-858D-2270B5BEACCA","type":"f","value":1,"nodeType":"Float"},{"uuid":"65DAA689-25F9-43D1-9CAF-DDB6F25C351E","type":"f","value":1,"nodeType":"Float"},{"uuid":"CC8282CE-886F-4E14-81F6-B7DB3FF15A50","type":"i","value":0,"nodeType":"Int"},{"uuid":"6BF15563-47C7-414B-AA9B-C89D429B5777","type":"phong","color":"84923B9E-164F-4D21-B381-CE6587B2A307","specular":"A4940268-F99E-4D1C-BE77-7E8BC70233DD","shininess":"27388DD0-CAEA-45BB-B2CE-3E3203210B08","shadingAlpha":"1B82467C-B528-4BC3-AC5E-2C8935DBE0D1","shadingBlend":"B913E685-4179-41F5-A77B-B0C45C5DBA9F","afterColor":"B790BB7A-4BB4-4193-82CF-CE0891FE81D2","alpha":"C92C5EAD-C12F-4F16-A717-8508BBFF1EC3","nodeType":"Phong"},{"uuid":"B790BB7A-4BB4-4193-82CF-CE0891FE81D2","type":"v3","a":"F4957D36-2E4D-4F1C-8699-5BE97324FECF","b":"621267BA-E170-449B-BC8B-C5FF58E39AC8","alpha":"F9A2B54B-A0C6-42D3-9EF4-2AB70B2B2EE1","mode":"CC8282CE-886F-4E14-81F6-B7DB3FF15A50","nodeType":"Blend"},{"uuid":"F4957D36-2E4D-4F1C-8699-5BE97324FECF","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"621267BA-E170-449B-BC8B-C5FF58E39AC8","type":"v3","color":"69321E9E-FEDA-4C3C-B352-38B86C936232","bias":"677A54BE-E14B-407D-858C-09E03F46C782","scale":"1C4F18EC-3AD1-4FF3-9994-F853585E658C","intensity":"36CBC744-30E6-45D0-AE2C-698342A22472","factor":"C49D3A13-0075-49E1-858D-2270B5BEACCA","alpha":"65DAA689-25F9-43D1-9CAF-DDB6F25C351E","mode":"CC8282CE-886F-4E14-81F6-B7DB3FF15A50","calpha":"g621267BAE170449BBC8BC5FF58E39AC8_calpha","nodeType":"Fresnel"},{"uuid":"F9A2B54B-A0C6-42D3-9EF4-2AB70B2B2EE1","type":"f","src":"g621267BAE170449BBC8BC5FF58E39AC8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"C92C5EAD-C12F-4F16-A717-8508BBFF1EC3","type":"f","value":1,"nodeType":"Float"},{"uuid":"7EA264C7-71F4-4ED0-865C-6C54E9FC5CF1","type":"f","value":1,"nodeType":"Float"},{"uuid":"7188159C-7059-47D5-B50E-4E334AF078C3","type":"i","value":0,"nodeType":"Int"},{"uuid":"ABD1597C-BD10-4D9D-BCAC-1ADFF0EE1F3A","type":"f","value":30,"nodeType":"Float"},{"uuid":"10E3486D-3D4E-4548-9B85-5AEB081B5527","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"45C61DEF-0F6A-42C0-AA2F-319A15D506D1","type":"f","value":10,"nodeType":"Float"},{"uuid":"4698B968-6FFD-420E-A6FF-17F5467AB2D8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"185129A1-57D4-4F55-B943-A769D38331D6","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"D31D4156-737F-4739-BA8A-42527B900D56","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"2A69F391-C374-4AA5-AD24-0863926158EA","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"2BB52EBA-C88F-45B4-9552-F245B184FAA9","project":false,"nodeType":"Texture"},{"uuid":"2BB52EBA-C88F-45B4-9552-F245B184FAA9","type":"v2","index":0,"nodeType":"UV"},{"uuid":"B5BC25B7-6C2C-4B28-B3F2-C3E5D67F4426","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"1BF3424E-C909-498C-8FF9-B86A84612224","project":false,"nodeType":"Texture"},{"uuid":"1BF3424E-C909-498C-8FF9-B86A84612224","type":"v2","index":0,"nodeType":"UV"},{"uuid":"5D178FE1-3731-425E-BFDE-A69F17348ECD","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"5EC64A7D-AD82-42E7-A51B-2D0888A442AB","type":"f","value":1,"nodeType":"Float"},{"uuid":"EDEE4CFE-30D5-420A-8C03-D13279B6AE04","type":"i","value":0,"nodeType":"Int"},{"uuid":"8E934677-DA55-4196-A401-AA134FC8EAA2","type":"f","value":59,"nodeType":"Float"},{"uuid":"56E9191A-5B3F-4915-BC24-2611647FA0B6","type":"f","value":223,"nodeType":"Float"},{"uuid":"01F93527-F34F-476B-94A2-FE4680C9E1ED","type":"f","value":1,"nodeType":"Float"},{"uuid":"2CCF293D-69E5-4A65-87AD-269B5F6B1651","type":"f","value":0,"nodeType":"Float"},{"uuid":"EDAC64BD-34DE-48F6-886C-526FA0BD15A3","type":"v3","x":-113,"y":-150,"z":-64,"nodeType":"Vector3"},{"uuid":"19D04065-12F2-4CCF-B395-71539FA99A4C","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"45E9C0BC-3746-43EC-814C-B431EF1D012A","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"0F325D1C-D3F7-40DC-B724-61FC44CFCC82","type":"f","value":1,"nodeType":"Float"},{"uuid":"2112446E-20ED-477C-A8DA-AF264B10497C","type":"i","value":1,"nodeType":"Int"},{"uuid":"98CC315E-4DE1-4C94-A107-4F1A9AB0E8C3","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"FDE56E27-E61F-4F17-9E90-B15F511379E1","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6FC02389-7977-44D5-9559-B4B6409C9143","type":"f","value":1,"nodeType":"Float"},{"uuid":"B44A4EAF-7973-4451-B5C9-574409606811","type":"f","value":2,"nodeType":"Float"},{"uuid":"2629FEC6-D7E8-40BB-B55F-2DE6C05EB03D","type":"f","value":1,"nodeType":"Float"},{"uuid":"A78D6508-A6FD-4CE6-9682-9BC54F81E1F1","type":"f","value":1,"nodeType":"Float"},{"uuid":"0C07548D-2B01-45EA-B9CC-C87AFF51856F","type":"i","value":2,"nodeType":"Int"},{"uuid":"7133BC6B-7D0B-47CA-8558-4BC35835D7A5","type":"phong","color":"3F1A8BCD-2FCA-4C73-B0F6-71C676AD200E","specular":"10E3486D-3D4E-4548-9B85-5AEB081B5527","shininess":"ABD1597C-BD10-4D9D-BCAC-1ADFF0EE1F3A","shadingAlpha":"7EA264C7-71F4-4ED0-865C-6C54E9FC5CF1","shadingBlend":"7188159C-7059-47D5-B50E-4E334AF078C3","afterColor":"1954A22A-E091-4AD3-A1C1-71682AE84FAE","alpha":"6A195C4A-1746-4D1B-AB09-03C7D1FE1AB5","nodeType":"Phong"},{"uuid":"3F1A8BCD-2FCA-4C73-B0F6-71C676AD200E","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"1954A22A-E091-4AD3-A1C1-71682AE84FAE","type":"v3","a":"4EB66A96-E102-4630-93A1-A22F2C76CA09","b":"7C4E512B-20A1-40D4-B2FF-816656D7C319","alpha":"51E29357-4B05-43E8-B28F-9306AC7FA438","mode":"0C07548D-2B01-45EA-B9CC-C87AFF51856F","nodeType":"Blend"},{"uuid":"4EB66A96-E102-4630-93A1-A22F2C76CA09","type":"v3","a":"91DED644-649F-42E0-8557-B767A198BED6","b":"A4423CF9-5EDD-4F76-B348-FE959CE249AD","alpha":"507124F2-E971-407B-838C-798BA11D8A20","mode":"2112446E-20ED-477C-A8DA-AF264B10497C","nodeType":"Blend"},{"uuid":"91DED644-649F-42E0-8557-B767A198BED6","type":"v3","a":"0BC205D9-A092-43EA-93C2-E71ACCD1CA16","b":"B1AE2AFA-4011-47F1-BA2B-0496888F14A3","alpha":"6FBC8F02-0B9A-48A7-80A8-ACE55D8CC66C","mode":"EDEE4CFE-30D5-420A-8C03-D13279B6AE04","nodeType":"Blend"},{"uuid":"0BC205D9-A092-43EA-93C2-E71ACCD1CA16","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B1AE2AFA-4011-47F1-BA2B-0496888F14A3","type":"v3","thickness":"45C61DEF-0F6A-42C0-AA2F-319A15D506D1","ior":"4698B968-6FFD-420E-A6FF-17F5467AB2D8","roughness":"185129A1-57D4-4F55-B943-A769D38331D6","alpha":"5EC64A7D-AD82-42E7-A51B-2D0888A442AB","calpha":"gB1AE2AFA401147F1BA2B0496888F14A3_calpha","nodeType":"Transmission"},{"uuid":"6FBC8F02-0B9A-48A7-80A8-ACE55D8CC66C","type":"f","src":"gB1AE2AFA401147F1BA2B0496888F14A3_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A4423CF9-5EDD-4F76-B348-FE959CE249AD","type":"v3","near":"8E934677-DA55-4196-A401-AA134FC8EAA2","far":"56E9191A-5B3F-4915-BC24-2611647FA0B6","isVector":"01F93527-F34F-476B-94A2-FE4680C9E1ED","isWorldSpace":"2CCF293D-69E5-4A65-87AD-269B5F6B1651","origin":"EDAC64BD-34DE-48F6-886C-526FA0BD15A3","colorA":"19D04065-12F2-4CCF-B395-71539FA99A4C","colorB":"45E9C0BC-3746-43EC-814C-B431EF1D012A","alpha":"0F325D1C-D3F7-40DC-B724-61FC44CFCC82","nodeType":"Depth"},{"uuid":"507124F2-E971-407B-838C-798BA11D8A20","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"0F325D1C-D3F7-40DC-B724-61FC44CFCC82"},"nodeType":"Expression"},{"uuid":"7C4E512B-20A1-40D4-B2FF-816656D7C319","type":"v3","color":"98CC315E-4DE1-4C94-A107-4F1A9AB0E8C3","bias":"FDE56E27-E61F-4F17-9E90-B15F511379E1","scale":"6FC02389-7977-44D5-9559-B4B6409C9143","intensity":"B44A4EAF-7973-4451-B5C9-574409606811","factor":"2629FEC6-D7E8-40BB-B55F-2DE6C05EB03D","alpha":"A78D6508-A6FD-4CE6-9682-9BC54F81E1F1","mode":"0C07548D-2B01-45EA-B9CC-C87AFF51856F","calpha":"g7C4E512B20A140D4B2FF816656D7C319_calpha","nodeType":"Fresnel"},{"uuid":"51E29357-4B05-43E8-B28F-9306AC7FA438","type":"f","src":"g7C4E512B20A140D4B2FF816656D7C319_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"6A195C4A-1746-4D1B-AB09-03C7D1FE1AB5","type":"f","value":1,"nodeType":"Float"},{"uuid":"0E95E98D-0406-4C2F-835A-00E0BB396B12","type":"f","value":1,"nodeType":"Float"},{"uuid":"CF648295-4407-4325-B65A-AACB1FFA63FE","type":"i","value":0,"nodeType":"Int"},{"uuid":"8F05E0AE-A9F1-42D4-BD7C-D404800D1610","type":"f","value":30,"nodeType":"Float"},{"uuid":"A2217AC5-F659-432E-9AD1-5C26E2CD71F9","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"8063481F-9ADE-40AB-B9B4-4E88B23AC97A","type":"f","value":10,"nodeType":"Float"},{"uuid":"EB673A07-F696-4B06-85D3-9B822C18AD92","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"1FD8DA1F-D5FA-4DE6-9382-309010BE637E","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"82E0F7AF-BF80-428E-99CA-4B2D176268AF","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"502889AA-2671-4696-88E6-BA58EB8FCA3B","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"EF72AE14-5ADD-4882-9817-E43A4DCA379E","project":false,"nodeType":"Texture"},{"uuid":"EF72AE14-5ADD-4882-9817-E43A4DCA379E","type":"v2","index":0,"nodeType":"UV"},{"uuid":"650F3016-4457-432A-B6B0-7D274F174844","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"4AF32262-0335-41A4-91A0-878E6C80CA1C","project":false,"nodeType":"Texture"},{"uuid":"4AF32262-0335-41A4-91A0-878E6C80CA1C","type":"v2","index":0,"nodeType":"UV"},{"uuid":"BACB2C4F-16D4-4E58-A040-25277C4B60C1","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"21C63DF7-69E3-4283-969B-DD9F4447C8BE","type":"f","value":1,"nodeType":"Float"},{"uuid":"086BF03A-3629-42F5-8E74-D8A8B87ACB01","type":"i","value":0,"nodeType":"Int"},{"uuid":"9A970DA8-9573-484A-9B99-E50C59D779EB","type":"f","value":125,"nodeType":"Float"},{"uuid":"B7C9393C-01F6-48D7-B973-5A173132FDD9","type":"f","value":248,"nodeType":"Float"},{"uuid":"75454374-339C-4EB4-BFEF-C83FFA405FF6","type":"f","value":1,"nodeType":"Float"},{"uuid":"16FFEA42-9911-4779-8F18-D85C4F3CCE02","type":"f","value":0,"nodeType":"Float"},{"uuid":"B4621C04-9E7B-4BC9-BFB3-516D153427AF","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"5AF33F6F-2D34-4ED7-9A49-8C5526181091","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"16E3E94F-850B-4C1C-B39A-122A2C307A54","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"A8C37B6A-BB6B-46E0-919D-9B428CF91C64","type":"f","value":1,"nodeType":"Float"},{"uuid":"961763ED-D111-4960-8B49-DD285CD33DE6","type":"i","value":1,"nodeType":"Int"},{"uuid":"727E8982-D8FA-4BBE-9AAB-05D17F42E950","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"73C52938-B2DB-45B1-B96F-6335852F1546","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"63656EC1-C09B-4867-BBD5-A85B75794786","type":"f","value":1,"nodeType":"Float"},{"uuid":"026A0CDC-51EB-41F3-BFE6-A6300073DC43","type":"f","value":2,"nodeType":"Float"},{"uuid":"13A946F9-9611-4F71-8B3D-5B0D401110DC","type":"f","value":1,"nodeType":"Float"},{"uuid":"B5B2428A-6294-4367-A611-3D5E1247ACB0","type":"f","value":1,"nodeType":"Float"},{"uuid":"3D729AF1-EAF4-4634-8203-6644E5F51383","type":"i","value":2,"nodeType":"Int"},{"uuid":"9DDD18E4-19DE-407D-976B-D4357825D6F4","type":"phong","color":"1B985890-3962-46CF-8985-6CFA64017F87","specular":"A2217AC5-F659-432E-9AD1-5C26E2CD71F9","shininess":"8F05E0AE-A9F1-42D4-BD7C-D404800D1610","shadingAlpha":"0E95E98D-0406-4C2F-835A-00E0BB396B12","shadingBlend":"CF648295-4407-4325-B65A-AACB1FFA63FE","afterColor":"8143537E-41AA-4C76-B066-C070A6C1B9D5","alpha":"766900B5-871C-448F-BC7B-06376ABD800D","nodeType":"Phong"},{"uuid":"1B985890-3962-46CF-8985-6CFA64017F87","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"8143537E-41AA-4C76-B066-C070A6C1B9D5","type":"v3","a":"15B795A0-0666-4566-A126-3697B2E35128","b":"3EA92458-68B7-4F6F-A8B5-0483E71853E8","alpha":"08503F32-A944-4A8F-93FA-61F703657BFA","mode":"3D729AF1-EAF4-4634-8203-6644E5F51383","nodeType":"Blend"},{"uuid":"15B795A0-0666-4566-A126-3697B2E35128","type":"v3","a":"B7B2CD73-D85B-401B-8BB5-DBEE60320EC5","b":"BDBC0779-44BD-4A12-9163-C1A38B92EAF7","alpha":"DF36C1BE-39B0-4F45-AAAA-AFEEC3B27AC9","mode":"961763ED-D111-4960-8B49-DD285CD33DE6","nodeType":"Blend"},{"uuid":"B7B2CD73-D85B-401B-8BB5-DBEE60320EC5","type":"v3","a":"C04B5BA8-65EE-417C-BE94-7AABA5EABE84","b":"60BC7A11-EB44-45D9-9A93-0E65C84825D8","alpha":"C82EABD9-B215-41D8-96A3-3BEACC644554","mode":"086BF03A-3629-42F5-8E74-D8A8B87ACB01","nodeType":"Blend"},{"uuid":"C04B5BA8-65EE-417C-BE94-7AABA5EABE84","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"60BC7A11-EB44-45D9-9A93-0E65C84825D8","type":"v3","thickness":"8063481F-9ADE-40AB-B9B4-4E88B23AC97A","ior":"EB673A07-F696-4B06-85D3-9B822C18AD92","roughness":"1FD8DA1F-D5FA-4DE6-9382-309010BE637E","alpha":"21C63DF7-69E3-4283-969B-DD9F4447C8BE","calpha":"g60BC7A11EB4445D99A930E65C84825D8_calpha","nodeType":"Transmission"},{"uuid":"C82EABD9-B215-41D8-96A3-3BEACC644554","type":"f","src":"g60BC7A11EB4445D99A930E65C84825D8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BDBC0779-44BD-4A12-9163-C1A38B92EAF7","type":"v3","near":"9A970DA8-9573-484A-9B99-E50C59D779EB","far":"B7C9393C-01F6-48D7-B973-5A173132FDD9","isVector":"75454374-339C-4EB4-BFEF-C83FFA405FF6","isWorldSpace":"16FFEA42-9911-4779-8F18-D85C4F3CCE02","origin":"B4621C04-9E7B-4BC9-BFB3-516D153427AF","colorA":"5AF33F6F-2D34-4ED7-9A49-8C5526181091","colorB":"16E3E94F-850B-4C1C-B39A-122A2C307A54","alpha":"A8C37B6A-BB6B-46E0-919D-9B428CF91C64","nodeType":"Depth"},{"uuid":"DF36C1BE-39B0-4F45-AAAA-AFEEC3B27AC9","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"A8C37B6A-BB6B-46E0-919D-9B428CF91C64"},"nodeType":"Expression"},{"uuid":"3EA92458-68B7-4F6F-A8B5-0483E71853E8","type":"v3","color":"727E8982-D8FA-4BBE-9AAB-05D17F42E950","bias":"73C52938-B2DB-45B1-B96F-6335852F1546","scale":"63656EC1-C09B-4867-BBD5-A85B75794786","intensity":"026A0CDC-51EB-41F3-BFE6-A6300073DC43","factor":"13A946F9-9611-4F71-8B3D-5B0D401110DC","alpha":"B5B2428A-6294-4367-A611-3D5E1247ACB0","mode":"3D729AF1-EAF4-4634-8203-6644E5F51383","calpha":"g3EA9245868B74F6FA8B50483E71853E8_calpha","nodeType":"Fresnel"},{"uuid":"08503F32-A944-4A8F-93FA-61F703657BFA","type":"f","src":"g3EA9245868B74F6FA8B50483E71853E8_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"766900B5-871C-448F-BC7B-06376ABD800D","type":"f","value":1,"nodeType":"Float"},{"uuid":"3AC33494-A00C-4596-9B47-87EC5C087754","type":"f","value":1,"nodeType":"Float"},{"uuid":"A17ED5E9-E311-434F-82D3-0F0714B4F042","type":"i","value":0,"nodeType":"Int"},{"uuid":"88E53EB1-0772-47CE-8680-EF1CC95D8E36","type":"f","value":30,"nodeType":"Float"},{"uuid":"9D2128E5-5051-4E7B-AEA8-E489558CDDD9","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"8D329116-B553-4415-92F9-848A56A299B4","type":"f","value":10,"nodeType":"Float"},{"uuid":"3F77F8A1-0619-4E96-81BA-FA76E4B5A512","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"EF31439C-FD1F-4471-86FB-064EE4CD34CD","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"AA794956-BFD7-4F7B-8B5B-098B0BF5BF75","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"E74D120D-297E-406D-AFCB-9E98307EF4ED","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"596AAB59-28E3-4020-9CCC-B5374617DBB4","project":false,"nodeType":"Texture"},{"uuid":"596AAB59-28E3-4020-9CCC-B5374617DBB4","type":"v2","index":0,"nodeType":"UV"},{"uuid":"9AE2EDCE-1942-4876-9521-3473DFADEAF5","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"0982DB83-A691-46A5-A768-95121B6A0DBA","project":false,"nodeType":"Texture"},{"uuid":"0982DB83-A691-46A5-A768-95121B6A0DBA","type":"v2","index":0,"nodeType":"UV"},{"uuid":"871F8A6C-55EE-48FD-AFC5-DB46C1D691D4","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"2853B03D-ED8E-489F-9669-25490BECA6D0","type":"f","value":1,"nodeType":"Float"},{"uuid":"4F2FFC8F-BE9D-474D-9A0F-364F3A4AEE1F","type":"i","value":0,"nodeType":"Int"},{"uuid":"D34F1186-33FA-4C64-8A71-2927F4DA5F39","type":"f","value":125,"nodeType":"Float"},{"uuid":"58082F32-FF2C-4A74-BD27-AD99BE370E32","type":"f","value":248,"nodeType":"Float"},{"uuid":"6DDE8B9C-FE79-4651-B69C-A4F6FBF819D9","type":"f","value":1,"nodeType":"Float"},{"uuid":"2587B0BC-1F6F-4BF5-B456-3513E6A3CF15","type":"f","value":0,"nodeType":"Float"},{"uuid":"CFFBA6EE-47F0-49DF-B2A3-818868565163","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"464E7BC8-2E26-44BC-963D-369F74889019","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"D6B73F6D-A70B-4EA0-B2F7-20748C0FD912","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"707F8DDE-8EEC-4E8B-84AF-1AF73BB93CE2","type":"f","value":1,"nodeType":"Float"},{"uuid":"D4EDF1FF-669E-402E-9ABF-111C9A761242","type":"i","value":1,"nodeType":"Int"},{"uuid":"14693A23-B842-4A15-9F94-34594E1B5FEB","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"441D2F10-79D5-4C46-801F-8FD6ECFC07E6","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"B922806D-FCDB-4775-970B-79B4C038CFA1","type":"f","value":1,"nodeType":"Float"},{"uuid":"39F27D09-B7CB-4374-A77A-EC295451ADF7","type":"f","value":2,"nodeType":"Float"},{"uuid":"C3A5B73F-C46E-44AA-BFA6-2BAA0A8C3405","type":"f","value":1,"nodeType":"Float"},{"uuid":"80B15F6F-5A1F-44C7-B011-CA3092E9EC3E","type":"f","value":1,"nodeType":"Float"},{"uuid":"80BA7A4E-A1B7-44A1-A44E-05BD1E6AFF13","type":"i","value":2,"nodeType":"Int"},{"uuid":"C91715F8-C49C-4A0F-9B8D-DE59410ECA76","type":"phong","color":"69851A0A-CFDB-4DB6-BDB9-F3422D7EBEE3","specular":"9D2128E5-5051-4E7B-AEA8-E489558CDDD9","shininess":"88E53EB1-0772-47CE-8680-EF1CC95D8E36","shadingAlpha":"3AC33494-A00C-4596-9B47-87EC5C087754","shadingBlend":"A17ED5E9-E311-434F-82D3-0F0714B4F042","afterColor":"4AEFB31A-D9AA-4452-B4F5-5792F14E03B9","alpha":"2055DE37-FC76-45E6-B30B-07280E0D2349","nodeType":"Phong"},{"uuid":"69851A0A-CFDB-4DB6-BDB9-F3422D7EBEE3","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"4AEFB31A-D9AA-4452-B4F5-5792F14E03B9","type":"v3","a":"8FEC6FEA-CE52-414B-B590-E49BE8553F24","b":"1487BF24-2947-4CA3-BAEB-461A8C0E66FF","alpha":"09467DE0-0BCC-411A-80C6-E1BAE371D651","mode":"80BA7A4E-A1B7-44A1-A44E-05BD1E6AFF13","nodeType":"Blend"},{"uuid":"8FEC6FEA-CE52-414B-B590-E49BE8553F24","type":"v3","a":"917E7639-6275-4BBB-92B5-0D6B2CCA9AC6","b":"A901F520-C5AB-4637-B245-56AEDFAE7EE9","alpha":"60499B13-1F1A-475E-9922-3B01536371F5","mode":"D4EDF1FF-669E-402E-9ABF-111C9A761242","nodeType":"Blend"},{"uuid":"917E7639-6275-4BBB-92B5-0D6B2CCA9AC6","type":"v3","a":"80D0520A-693A-41A4-9825-BC42AACB3133","b":"0C1AF89F-8443-4D8D-A109-97E3FE17E791","alpha":"34760F68-3801-4065-AF56-D93A848A251D","mode":"4F2FFC8F-BE9D-474D-9A0F-364F3A4AEE1F","nodeType":"Blend"},{"uuid":"80D0520A-693A-41A4-9825-BC42AACB3133","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"0C1AF89F-8443-4D8D-A109-97E3FE17E791","type":"v3","thickness":"8D329116-B553-4415-92F9-848A56A299B4","ior":"3F77F8A1-0619-4E96-81BA-FA76E4B5A512","roughness":"EF31439C-FD1F-4471-86FB-064EE4CD34CD","alpha":"2853B03D-ED8E-489F-9669-25490BECA6D0","calpha":"g0C1AF89F84434D8DA10997E3FE17E791_calpha","nodeType":"Transmission"},{"uuid":"34760F68-3801-4065-AF56-D93A848A251D","type":"f","src":"g0C1AF89F84434D8DA10997E3FE17E791_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A901F520-C5AB-4637-B245-56AEDFAE7EE9","type":"v3","near":"D34F1186-33FA-4C64-8A71-2927F4DA5F39","far":"58082F32-FF2C-4A74-BD27-AD99BE370E32","isVector":"6DDE8B9C-FE79-4651-B69C-A4F6FBF819D9","isWorldSpace":"2587B0BC-1F6F-4BF5-B456-3513E6A3CF15","origin":"CFFBA6EE-47F0-49DF-B2A3-818868565163","colorA":"464E7BC8-2E26-44BC-963D-369F74889019","colorB":"D6B73F6D-A70B-4EA0-B2F7-20748C0FD912","alpha":"707F8DDE-8EEC-4E8B-84AF-1AF73BB93CE2","nodeType":"Depth"},{"uuid":"60499B13-1F1A-475E-9922-3B01536371F5","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"707F8DDE-8EEC-4E8B-84AF-1AF73BB93CE2"},"nodeType":"Expression"},{"uuid":"1487BF24-2947-4CA3-BAEB-461A8C0E66FF","type":"v3","color":"14693A23-B842-4A15-9F94-34594E1B5FEB","bias":"441D2F10-79D5-4C46-801F-8FD6ECFC07E6","scale":"B922806D-FCDB-4775-970B-79B4C038CFA1","intensity":"39F27D09-B7CB-4374-A77A-EC295451ADF7","factor":"C3A5B73F-C46E-44AA-BFA6-2BAA0A8C3405","alpha":"80B15F6F-5A1F-44C7-B011-CA3092E9EC3E","mode":"80BA7A4E-A1B7-44A1-A44E-05BD1E6AFF13","calpha":"g1487BF2429474CA3BAEB461A8C0E66FF_calpha","nodeType":"Fresnel"},{"uuid":"09467DE0-0BCC-411A-80C6-E1BAE371D651","type":"f","src":"g1487BF2429474CA3BAEB461A8C0E66FF_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"2055DE37-FC76-45E6-B30B-07280E0D2349","type":"f","value":1,"nodeType":"Float"},{"uuid":"96165FFC-AACC-4116-9ECA-1AC5613CB9E2","type":"f","value":1,"nodeType":"Float"},{"uuid":"1FC152A8-357F-43D1-AE5F-DCAE99256AB2","type":"i","value":0,"nodeType":"Int"},{"uuid":"D8073CF0-AE9F-4695-BF3F-1FBA62AF9D9E","type":"f","value":30,"nodeType":"Float"},{"uuid":"1F143F2B-A124-42E4-8116-88AEAAC2431F","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"17C283BD-9ACD-4C6F-8C0C-D6F4AB2C39CD","type":"f","value":10,"nodeType":"Float"},{"uuid":"E11A4249-8C29-4242-8A3D-E9CE2471BD1E","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0482F9D2-542D-4D66-BD9E-2BCBDF9B3742","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"0F883881-760E-4DF8-934A-40704B86ADAE","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"9D655B10-697B-420A-8CA9-87BC5C518E18","type":"v2","x":0.6579925650557621,"y":1,"nodeType":"Vector2"},{"uuid":"6CC6B692-C43C-40E8-BB38-F704381C56F0","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F265BEB-2D6B-458C-8F16-DA203EEA4EB3","type":"i","value":0,"nodeType":"Int"},{"uuid":"52D4EABA-B824-4355-B0C6-91F768F33716","type":"f","value":144,"nodeType":"Float"},{"uuid":"96DA9698-8D92-4969-8A99-12543282F324","type":"f","value":296,"nodeType":"Float"},{"uuid":"F6EDAF8B-018E-44AE-B552-CA5E4752A8D4","type":"f","value":1,"nodeType":"Float"},{"uuid":"42F405AB-C8DD-4C9B-9FF1-14E081B82B3A","type":"f","value":0,"nodeType":"Float"},{"uuid":"A4F66088-6F3A-4A85-85F3-C8AE1A381926","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"B17AB7D1-E955-4503-8B75-96545B54597A","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"7D7B2090-DB08-4587-A4D7-E0C5A1C2BB12","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"DCBEFFB9-9FDE-41FB-80C0-BA224473E67B","type":"f","value":1,"nodeType":"Float"},{"uuid":"701C6761-5DD8-4435-9598-451ED3A1F2C1","type":"i","value":1,"nodeType":"Int"},{"uuid":"10EACED7-3E6E-4109-AF88-47C9ADB40F97","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"CD948738-959A-4FE4-A4A4-7FAE5C8A8964","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"E899863E-C401-45B8-BC12-8DF856238AEB","type":"f","value":1,"nodeType":"Float"},{"uuid":"09610B96-DC77-4693-A357-4BD79E381C0B","type":"f","value":2,"nodeType":"Float"},{"uuid":"FF7BE623-76DD-4B93-928F-CC1957A17521","type":"f","value":1,"nodeType":"Float"},{"uuid":"9C15C6F6-B747-480C-88CF-787ED132C91A","type":"f","value":1,"nodeType":"Float"},{"uuid":"3F6BE5C4-EED1-4529-866E-278E3F2C7787","type":"i","value":2,"nodeType":"Int"},{"uuid":"42D6FE80-1564-48AF-9E44-E840FF2EE16F","type":"f","value":1,"nodeType":"Float"},{"uuid":"8CD06069-BE47-49D9-BFB4-D3AF9B076EBB","type":"i","value":0,"nodeType":"Int"},{"uuid":"72B8C12D-06E0-4795-9179-ED50CC2870A3","type":"f","value":30,"nodeType":"Float"},{"uuid":"30FD1A6B-AD9C-4B9E-AACC-08A087F78FFA","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"0F108852-FA6C-47D5-84DD-4745B7BCF0CC","type":"f","value":10,"nodeType":"Float"},{"uuid":"3E603996-1E6C-4555-AB66-B6B552D54D49","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"BDA7F323-7B98-4757-A3A5-DDA68B849CB7","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"C5B17CF2-D279-4AAC-B58F-AEE55DC63566","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"7273CF3A-320D-44C5-AFC0-A3A7E8A59796","type":"v2","x":0.6579925650557621,"y":1,"nodeType":"Vector2"},{"uuid":"A3A82D63-A6EC-4FA6-B7F5-EC1E48C4039C","type":"f","value":1,"nodeType":"Float"},{"uuid":"BCF14C5C-C0BA-49A0-AFF7-EC0B53DACD81","type":"i","value":0,"nodeType":"Int"},{"uuid":"2331EC1B-1E63-4B15-B33D-6F973F91CE1D","type":"f","value":144,"nodeType":"Float"},{"uuid":"F18B4472-0095-42EF-B65C-0DA6221AC458","type":"f","value":296,"nodeType":"Float"},{"uuid":"6D083AC8-6A5D-4F25-A281-755CD2871F90","type":"f","value":1,"nodeType":"Float"},{"uuid":"837DE60D-D16A-47F5-9C42-6896C601F380","type":"f","value":0,"nodeType":"Float"},{"uuid":"38C4830A-2E5D-411D-A69E-A6649B7F81B7","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"DD24024F-4730-4C35-87C6-F03EB9950DD6","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"100233E0-6F8C-4C01-BA6A-AF9C2A117808","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"893080D1-53E9-4D73-BCEB-2F5CBDFEE270","type":"f","value":1,"nodeType":"Float"},{"uuid":"179AC920-CE63-43B7-8BFD-8052A4E56D37","type":"i","value":1,"nodeType":"Int"},{"uuid":"BF25FD85-A638-49E1-9DE9-388A9CE85125","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"61DE709E-31E6-4DA3-A430-EB4F86EED2AF","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"8D3E28A7-5E1A-4727-B7F6-DBDC452031D8","type":"f","value":1,"nodeType":"Float"},{"uuid":"EFBC2D73-33A9-4732-BEC5-7FDE112F2A64","type":"f","value":2,"nodeType":"Float"},{"uuid":"E3F010C8-F253-4C55-9117-B63535A4CE7B","type":"f","value":1,"nodeType":"Float"},{"uuid":"9ABBDF83-94CA-49B2-AF74-FB060F8E6FBC","type":"f","value":1,"nodeType":"Float"},{"uuid":"66278409-A2BD-4164-BA9E-9A501D7A253A","type":"i","value":2,"nodeType":"Int"},{"uuid":"06B2C305-79AE-4595-A4DD-2F02DE8279F8","type":"f","value":1,"nodeType":"Float"},{"uuid":"201AECEA-F873-4CEE-A859-59D0841FA6FC","type":"i","value":0,"nodeType":"Int"},{"uuid":"22C31676-6862-4B87-AD0D-1E46941CA78B","type":"f","value":30,"nodeType":"Float"},{"uuid":"57D296E1-9AAC-4C27-8419-8304B360517A","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"313A1466-A105-4FCD-8BA4-59ED91DD0AE9","type":"f","value":10,"nodeType":"Float"},{"uuid":"C14171E5-1371-4386-A9E5-13D6701727E8","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"77CEDB05-6CA0-4FDB-A458-ECCCACDC3B41","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"39D36811-F12D-4FA9-BBA0-61C6EFECC018","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"EDFB7028-DA8A-465D-8A67-D3D04CBBB22B","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"6925B44F-38F1-49F8-98D2-6ABBE2E14BB2","project":false,"nodeType":"Texture"},{"uuid":"6925B44F-38F1-49F8-98D2-6ABBE2E14BB2","type":"v2","index":0,"nodeType":"UV"},{"uuid":"73A4B930-11B9-460A-AFBE-332D43838886","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"18353727-5DA9-430F-947E-58028188C34D","project":false,"nodeType":"Texture"},{"uuid":"18353727-5DA9-430F-947E-58028188C34D","type":"v2","index":0,"nodeType":"UV"},{"uuid":"EA4D4EBA-4E12-4DD0-90D0-2522FAA38D0F","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"CE1C084A-2706-4656-BE4E-2503422E2C74","type":"f","value":1,"nodeType":"Float"},{"uuid":"2A75F996-F4F3-453C-8A39-B50F3B6EE02D","type":"i","value":0,"nodeType":"Int"},{"uuid":"3C7E575F-4BC5-4310-8D3F-47884449D43A","type":"f","value":144,"nodeType":"Float"},{"uuid":"7A999A0F-2DB6-4822-9748-0306765F169F","type":"f","value":296,"nodeType":"Float"},{"uuid":"B7B1D442-2543-444F-8C4B-84ABA4CB8436","type":"f","value":1,"nodeType":"Float"},{"uuid":"C90066F8-511B-4B67-905B-B117813574B1","type":"f","value":0,"nodeType":"Float"},{"uuid":"E94ED7D3-445E-4240-9772-5ADF7F910720","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"C1A7B71F-050C-423D-B78D-9EFE8FFC0A84","type":"c","r":0.8352941176470589,"g":0.8666666666666667,"b":1,"value":14015999,"nodeType":"Color"},{"uuid":"2F2FA8E2-3B2F-46F8-8425-FB981AF9DAED","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"D3BF3A9F-1A54-417F-95B8-5D8B2711C767","type":"f","value":1,"nodeType":"Float"},{"uuid":"24F078FE-2EA3-4F0E-B92A-A5ADC7F07CC7","type":"i","value":1,"nodeType":"Int"},{"uuid":"F7B69A82-5DD5-4F0C-ADE9-F77971E18BCC","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"54C0249F-3C10-414D-9011-8D3A607BD3C7","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"7B99B840-2211-4516-B976-E36BF6348A06","type":"f","value":1,"nodeType":"Float"},{"uuid":"C7849E0E-2AF7-409D-9F82-77A34623449D","type":"f","value":2,"nodeType":"Float"},{"uuid":"448D4A9C-FCED-47FF-B746-4818043C05E5","type":"f","value":1,"nodeType":"Float"},{"uuid":"C38BD11C-EC9B-460F-ACF2-412512058AA3","type":"f","value":1,"nodeType":"Float"},{"uuid":"602A72B6-DCEF-4EFB-A2A1-8FBC2921A3D2","type":"i","value":2,"nodeType":"Int"},{"uuid":"251482DA-E119-49C6-9251-F2B54EACC554","type":"phong","color":"86CE3626-ADF3-4471-A66B-76A4CE3C26B2","specular":"57D296E1-9AAC-4C27-8419-8304B360517A","shininess":"22C31676-6862-4B87-AD0D-1E46941CA78B","shadingAlpha":"06B2C305-79AE-4595-A4DD-2F02DE8279F8","shadingBlend":"201AECEA-F873-4CEE-A859-59D0841FA6FC","afterColor":"2AF5BB1B-670B-462E-A0DB-6FA51C3CA085","alpha":"B6BBB44F-8AF8-4CC9-AC4A-CF90355DA755","nodeType":"Phong"},{"uuid":"86CE3626-ADF3-4471-A66B-76A4CE3C26B2","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"2AF5BB1B-670B-462E-A0DB-6FA51C3CA085","type":"v3","a":"74FC6920-79E7-4521-9250-C1085E612886","b":"3D272CF1-C734-4040-90E9-1D59C506667A","alpha":"F7E6D558-319D-4BBB-98D2-968FE604F147","mode":"602A72B6-DCEF-4EFB-A2A1-8FBC2921A3D2","nodeType":"Blend"},{"uuid":"74FC6920-79E7-4521-9250-C1085E612886","type":"v3","a":"B704423C-AE77-4405-BDAF-07A73EC422BD","b":"BF265F01-77F8-42EB-9FEA-2BFAFB6D7472","alpha":"D5D33180-05C8-4445-9A16-C18836BE0BD6","mode":"24F078FE-2EA3-4F0E-B92A-A5ADC7F07CC7","nodeType":"Blend"},{"uuid":"B704423C-AE77-4405-BDAF-07A73EC422BD","type":"v3","a":"FC9BB028-8C35-424F-9C1B-12894FDA9BEE","b":"57B163DB-29FA-43BA-8DEF-FEA71060AFF4","alpha":"5942617B-30CB-4217-BE66-855327042150","mode":"2A75F996-F4F3-453C-8A39-B50F3B6EE02D","nodeType":"Blend"},{"uuid":"FC9BB028-8C35-424F-9C1B-12894FDA9BEE","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"57B163DB-29FA-43BA-8DEF-FEA71060AFF4","type":"v3","thickness":"313A1466-A105-4FCD-8BA4-59ED91DD0AE9","ior":"C14171E5-1371-4386-A9E5-13D6701727E8","roughness":"77CEDB05-6CA0-4FDB-A458-ECCCACDC3B41","alpha":"CE1C084A-2706-4656-BE4E-2503422E2C74","calpha":"g57B163DB29FA43BA8DEFFEA71060AFF4_calpha","nodeType":"Transmission"},{"uuid":"5942617B-30CB-4217-BE66-855327042150","type":"f","src":"g57B163DB29FA43BA8DEFFEA71060AFF4_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"BF265F01-77F8-42EB-9FEA-2BFAFB6D7472","type":"v3","near":"3C7E575F-4BC5-4310-8D3F-47884449D43A","far":"7A999A0F-2DB6-4822-9748-0306765F169F","isVector":"B7B1D442-2543-444F-8C4B-84ABA4CB8436","isWorldSpace":"C90066F8-511B-4B67-905B-B117813574B1","origin":"E94ED7D3-445E-4240-9772-5ADF7F910720","colorA":"C1A7B71F-050C-423D-B78D-9EFE8FFC0A84","colorB":"2F2FA8E2-3B2F-46F8-8425-FB981AF9DAED","alpha":"D3BF3A9F-1A54-417F-95B8-5D8B2711C767","nodeType":"Depth"},{"uuid":"D5D33180-05C8-4445-9A16-C18836BE0BD6","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"D3BF3A9F-1A54-417F-95B8-5D8B2711C767"},"nodeType":"Expression"},{"uuid":"3D272CF1-C734-4040-90E9-1D59C506667A","type":"v3","color":"F7B69A82-5DD5-4F0C-ADE9-F77971E18BCC","bias":"54C0249F-3C10-414D-9011-8D3A607BD3C7","scale":"7B99B840-2211-4516-B976-E36BF6348A06","intensity":"C7849E0E-2AF7-409D-9F82-77A34623449D","factor":"448D4A9C-FCED-47FF-B746-4818043C05E5","alpha":"C38BD11C-EC9B-460F-ACF2-412512058AA3","mode":"602A72B6-DCEF-4EFB-A2A1-8FBC2921A3D2","calpha":"g3D272CF1C734404090E91D59C506667A_calpha","nodeType":"Fresnel"},{"uuid":"F7E6D558-319D-4BBB-98D2-968FE604F147","type":"f","src":"g3D272CF1C734404090E91D59C506667A_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"B6BBB44F-8AF8-4CC9-AC4A-CF90355DA755","type":"f","value":1,"nodeType":"Float"},{"uuid":"D1610997-AD7B-46F0-8B28-6A425E9F591D","type":"f","value":1,"nodeType":"Float"},{"uuid":"FB1D70A1-5C68-4092-910F-A4FAE13D1B99","type":"i","value":0,"nodeType":"Int"},{"uuid":"939E2849-53B4-4785-88AB-EC28175687A1","type":"f","value":30,"nodeType":"Float"},{"uuid":"F478B4F3-0F24-465A-9FA0-698693C78415","type":"c","r":0.06666666666666667,"g":0.06666666666666667,"b":0.06666666666666667,"value":1118481,"nodeType":"Color"},{"uuid":"97FC1ED8-C9C2-45A9-BE43-AFCEA65AAE34","type":"f","value":10,"nodeType":"Float"},{"uuid":"CE37161D-71A8-4C11-B123-36F59B7ECDA9","type":"f","value":1.5,"nodeType":"Float"},{"uuid":"0E2E935B-56BD-4059-9D8D-F2CDDC8075FA","type":"f","value":0.5,"nodeType":"Float"},{"uuid":"D56C4F5D-8772-44E3-93E6-319462EFF8C6","type":"v2","x":2048,"y":2048,"nodeType":"Vector2"},{"uuid":"09C2C057-DAE7-417C-AFF7-4E939F66D7BF","type":"v4","value":"631B423E-AF7A-4534-8C0B-2ECC466BB85B","uv":"76015A97-9F99-42F8-9D99-BFA0AE891F8F","project":false,"nodeType":"Texture"},{"uuid":"76015A97-9F99-42F8-9D99-BFA0AE891F8F","type":"v2","index":0,"nodeType":"UV"},{"uuid":"1815C1A3-62E3-419D-8E6B-CFB9C15FACC5","type":"v4","value":"D5AA9EFC-B3AF-447E-BE7A-CB9D9C016B2D","uv":"ED359C8A-81D4-4C0F-8CE0-49C3DDE53922","project":false,"nodeType":"Texture"},{"uuid":"ED359C8A-81D4-4C0F-8CE0-49C3DDE53922","type":"v2","index":0,"nodeType":"UV"},{"uuid":"CC056B07-F3FB-45DF-A4D6-68CAEAE9C4E0","type":"v2","x":0.5674102812803103,"y":1,"nodeType":"Vector2"},{"uuid":"6115599A-82EA-4A3B-8A61-42443BF44062","type":"f","value":1,"nodeType":"Float"},{"uuid":"6DA3D72E-5861-481C-B2BD-878BF969969E","type":"i","value":0,"nodeType":"Int"},{"uuid":"C11CA0E3-52E8-4794-B6C8-6E4CCC8E27BE","type":"f","value":50,"nodeType":"Float"},{"uuid":"B2672A2B-5949-4339-BC58-A22C7DA2C82B","type":"f","value":346,"nodeType":"Float"},{"uuid":"6DC49C31-303A-4502-8B04-11162A372281","type":"f","value":1,"nodeType":"Float"},{"uuid":"9A68A3DA-9E5D-4294-BF60-B35184AF1707","type":"f","value":0,"nodeType":"Float"},{"uuid":"88A90F92-322D-480C-855E-939DC901CC75","type":"v3","x":-34,"y":-150,"z":-50,"nodeType":"Vector3"},{"uuid":"363B3273-4DB3-41A1-9789-6C59B8BD4C24","type":"c","r":0.9254901960784314,"g":0.9372549019607843,"b":1,"value":15527935,"nodeType":"Color"},{"uuid":"E4436B8F-B34A-48F1-8440-EF1C2BA2F6FB","type":"c","r":0,"g":0.2784313725490196,"b":1,"value":18431,"nodeType":"Color"},{"uuid":"ECFB6211-4B64-48CF-803A-ACDE47F42332","type":"f","value":1,"nodeType":"Float"},{"uuid":"B8EDD030-E150-4773-B31C-31797F1A3235","type":"i","value":1,"nodeType":"Int"},{"uuid":"76B794EB-261A-4DE5-9021-D1C6D95F45CE","type":"c","r":0.5647058823529412,"g":0.6627450980392157,"b":0.984313725490196,"value":9480699,"nodeType":"Color"},{"uuid":"4D6376AE-3A05-4DFD-A858-8A277ED9F665","type":"f","value":0.1,"nodeType":"Float"},{"uuid":"6D290AF5-8209-4551-BE5A-B89BA10B551A","type":"f","value":1,"nodeType":"Float"},{"uuid":"552EF6AA-2259-4D21-92BA-B2A21C60228D","type":"f","value":2,"nodeType":"Float"},{"uuid":"CEE2CE48-6DDC-43F2-9A63-19771B62A08B","type":"f","value":1,"nodeType":"Float"},{"uuid":"805260BC-F0C7-44CF-BCCD-1FADDAD1908F","type":"f","value":1,"nodeType":"Float"},{"uuid":"259C5F30-4C5F-4A19-B6B9-B792098F410F","type":"i","value":2,"nodeType":"Int"},{"uuid":"D4254CF6-451B-423B-B2AC-4694CB4A19C9","type":"phong","color":"839A6024-A070-4F7F-ACF6-D04DC6649351","specular":"F478B4F3-0F24-465A-9FA0-698693C78415","shininess":"939E2849-53B4-4785-88AB-EC28175687A1","shadingAlpha":"D1610997-AD7B-46F0-8B28-6A425E9F591D","shadingBlend":"FB1D70A1-5C68-4092-910F-A4FAE13D1B99","afterColor":"DFB64C1C-2714-4C4A-997E-947B300FE8A9","alpha":"729E4F35-387E-4F03-B2A1-16CF0E67F54B","nodeType":"Phong"},{"uuid":"839A6024-A070-4F7F-ACF6-D04DC6649351","type":"c","r":0.34901960784313724,"g":0.34901960784313724,"b":0.34901960784313724,"value":5855577,"nodeType":"Color"},{"uuid":"DFB64C1C-2714-4C4A-997E-947B300FE8A9","type":"v3","a":"51604C28-E6D9-4C43-BB98-843661BE6945","b":"A92A13C9-CDB3-4120-8B15-1F0C524D0885","alpha":"51DCEFA1-EFD3-4DDC-915E-07547AADC135","mode":"259C5F30-4C5F-4A19-B6B9-B792098F410F","nodeType":"Blend"},{"uuid":"51604C28-E6D9-4C43-BB98-843661BE6945","type":"v3","a":"2D75080C-8554-4E70-8789-FD98E0005498","b":"A825D9DA-CEA9-49EC-9C48-17387B1603EA","alpha":"BAF1C391-B623-437F-A184-41DFE29E34D1","mode":"B8EDD030-E150-4773-B31C-31797F1A3235","nodeType":"Blend"},{"uuid":"2D75080C-8554-4E70-8789-FD98E0005498","type":"v3","a":"50E697A4-313E-4FD5-A9E9-98A49F2A7B3E","b":"5EAC3B09-C784-4908-9DC7-81EED20B510F","alpha":"2170E0F0-3BF8-47E2-A812-EE06F3248E9E","mode":"6DA3D72E-5861-481C-B2BD-878BF969969E","nodeType":"Blend"},{"uuid":"50E697A4-313E-4FD5-A9E9-98A49F2A7B3E","type":"f","src":"outgoingLight","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"5EAC3B09-C784-4908-9DC7-81EED20B510F","type":"v3","thickness":"97FC1ED8-C9C2-45A9-BE43-AFCEA65AAE34","ior":"CE37161D-71A8-4C11-B123-36F59B7ECDA9","roughness":"0E2E935B-56BD-4059-9D8D-F2CDDC8075FA","alpha":"6115599A-82EA-4A3B-8A61-42443BF44062","calpha":"g5EAC3B09C78449089DC781EED20B510F_calpha","nodeType":"Transmission"},{"uuid":"2170E0F0-3BF8-47E2-A812-EE06F3248E9E","type":"f","src":"g5EAC3B09C78449089DC781EED20B510F_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"A825D9DA-CEA9-49EC-9C48-17387B1603EA","type":"v3","near":"C11CA0E3-52E8-4794-B6C8-6E4CCC8E27BE","far":"B2672A2B-5949-4339-BC58-A22C7DA2C82B","isVector":"6DC49C31-303A-4502-8B04-11162A372281","isWorldSpace":"9A68A3DA-9E5D-4294-BF60-B35184AF1707","origin":"88A90F92-322D-480C-855E-939DC901CC75","colorA":"363B3273-4DB3-41A1-9789-6C59B8BD4C24","colorB":"E4436B8F-B34A-48F1-8440-EF1C2BA2F6FB","alpha":"ECFB6211-4B64-48CF-803A-ACDE47F42332","nodeType":"Depth"},{"uuid":"BAF1C391-B623-437F-A184-41DFE29E34D1","type":"f","src":"alpha / clamp(alpha + accumAlpha, 0.001, 1.0 )","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{"alpha":"ECFB6211-4B64-48CF-803A-ACDE47F42332"},"nodeType":"Expression"},{"uuid":"A92A13C9-CDB3-4120-8B15-1F0C524D0885","type":"v3","color":"76B794EB-261A-4DE5-9021-D1C6D95F45CE","bias":"4D6376AE-3A05-4DFD-A858-8A277ED9F665","scale":"6D290AF5-8209-4551-BE5A-B89BA10B551A","intensity":"552EF6AA-2259-4D21-92BA-B2A21C60228D","factor":"CEE2CE48-6DDC-43F2-9A63-19771B62A08B","alpha":"805260BC-F0C7-44CF-BCCD-1FADDAD1908F","mode":"259C5F30-4C5F-4A19-B6B9-B792098F410F","calpha":"gA92A13C9CDB341208B151F0C524D0885_calpha","nodeType":"Fresnel"},{"uuid":"51DCEFA1-EFD3-4DDC-915E-07547AADC135","type":"f","src":"gA92A13C9CDB341208B151F0C524D0885_calpha","isMethod":false,"useKeywords":true,"extensions":{},"keywords":{},"nodeType":"Expression"},{"uuid":"729E4F35-387E-4F03-B2A1-16CF0E67F54B","type":"f","value":1,"nodeType":"Float"}],"frames":{"currentId":"default-frame-id","coords":[0,0],"frames":{"default-frame-id":{"id":"default-frame-id","name":"Frame","preset":"fullscreen","size":[1336,1111],"coords":[0,0],"editorScale":1,"backgroundColor":{"r":255,"g":255,"b":255,"a":1},"color":{"r":0,"g":0,"b":0,"a":0.5},"guides":true,"hasSceneScaling":false,"sceneScale":1}}},"assets":{"materials":{}},"needsTransmission":true,"editor":{"orbitControls":{"useKeyEvents":false,"enableDamping":true,"enablePan":false,"enableZoom":false,"enableRotate":false,"rotationLimitsMode":0,"rotationVerticalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"rotationHorizontalOffset":{"min":1.5707963267948966,"max":1.5707963267948966},"autoRotate":false,"autoRotateSpeed":2,"autoRotateClockwise":true},"helperState":true,"publish":{"type":2,"web":{"logo":true}},"settings":{"wireframe":false,"helpers":true}}} \ No newline at end of file diff --git a/site/src/components/avatar.vue b/site/src/components/avatar.vue index 3df541f47..9bc162f5f 100644 --- a/site/src/components/avatar.vue +++ b/site/src/components/avatar.vue @@ -1,6 +1,6 @@ @@ -78,7 +78,7 @@ function onError(_event: Event): void { } &__default { - background: url(http://tdesign.gtimg.com/docs/male.png) no-repeat center; + background: url('http://tdesign.gtimg.com/docs/male.png') no-repeat center; background-size: 100%; } diff --git a/site/src/components/design-source.vue b/site/src/components/design-source.vue index 555f472a8..f9de27066 100644 --- a/site/src/components/design-source.vue +++ b/site/src/components/design-source.vue @@ -5,7 +5,7 @@

    基础资源10

    -
    +
    @@ -27,7 +27,7 @@

    其他6

    -
    +
    diff --git a/site/src/components/download-dialog.vue b/site/src/components/download-dialog.vue index 3661ba813..6f9139996 100644 --- a/site/src/components/download-dialog.vue +++ b/site/src/components/download-dialog.vue @@ -44,9 +44,7 @@ const props = withDefaults( visible: false, }, ); -const emit = defineEmits<{ - (event: 'update:visible', value: boolean): void; -}>(); +const emit = defineEmits<(event: 'update:visible', value: boolean) => void>(); const email = ref(''); const visibleSync = computed({ @@ -81,6 +79,7 @@ function downloadConfirm(): void { flex-direction: column; align-items: center; } + .dialog-describe { font-weight: 600; font-size: 36px; @@ -89,10 +88,12 @@ function downloadConfirm(): void { text-align: center; margin: 30px 0 24px; } + .dialog-email { width: 100%; padding: 0 2px; } + .dialog-footer { text-align: center; } diff --git a/site/src/main.ts b/site/src/main.ts index e370a9fdc..89177f15f 100644 --- a/site/src/main.ts +++ b/site/src/main.ts @@ -1,4 +1,3 @@ -/* eslint-disable */ import { createApp } from 'vue'; import { createRouter, createWebHistory } from 'vue-router'; import TDesign from 'tdesign-vue-next'; diff --git a/site/src/pages/about/release.vue b/site/src/pages/about/release.vue index cd4a82d0c..9d368e024 100644 --- a/site/src/pages/about/release.vue +++ b/site/src/pages/about/release.vue @@ -5,7 +5,7 @@
    -
    +

    {{ releaseTimeList[index].title }}

    @@ -149,7 +149,7 @@ onMounted(() => { } div[name='DOC'] { - a:not(class) { + a:not(.header-anchor) { opacity: 0.9; transition: all 0.2s linear; @@ -175,7 +175,7 @@ onMounted(() => { line-height: 28px; margin-top: 48px; - > a:not(class) { + > a:not(.header-anchor) { color: var(--text-primary); margin-left: 4px; } @@ -202,43 +202,43 @@ onMounted(() => { background-size: 20px 20px; &[name^='Vue'] { - background-image: url(@/assets/vue-logo.svg); + background-image: url('@/assets/vue-logo.svg'); } &[name^='React'] { - background-image: url(@/assets/react-logo.svg); + background-image: url('@/assets/react-logo.svg'); } &[name^='Miniprogram'] { - background-image: url(@/assets/miniprogram-logo.svg); + background-image: url('@/assets/miniprogram-logo.svg'); } &[name^='Flutter'] { - background-image: url(@/assets/flutter-logo.svg); + background-image: url('@/assets/flutter-logo.svg'); } &[name^='Uniapp'] { - background-image: url(@/assets/uniapp-logo.svg); + background-image: url('@/assets/uniapp-logo.svg'); } &[name^='Figma'] { - background-image: url(@/assets/figma-logo.svg); + background-image: url('@/assets/figma-logo.svg'); } &[name^='Sketch'] { - background-image: url(@/assets/sketch-logo.svg); + background-image: url('@/assets/sketch-logo.svg'); } &[name^='Axure'] { - background-image: url(@/assets/axure-logo.svg); + background-image: url('@/assets/axure-logo.svg'); } &[name^='AdobeXD'] { - background-image: url(@/assets/xd-logo.svg); + background-image: url('@/assets/xd-logo.svg'); } &[name^='TDesign'] { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeB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0nV0NaAVzbmrZw7srEmOTQEMay5HDnZnP0pXOwVNGczYPVJwR6DtCHXyfrTHgJjMfgZLsYfAvAOo3yEH8Cnd351DULpaQjBAgXGvs79bmwDNHm7HdLkNPcIC6hCMYr7jvxKmIGjId9tSKsY9BtTRbUYwdnMI5c9lugyGLMpG7rOTHCjSVSqXYjgeqZw7Aja7SncHvYGb7V5ClwOC3ZLGJC7YTvBw9kcK8rPJh/J77Y7pUkBsDgEuCW1E+yCCxO6lo7Tehh5Bf+Y/bDJs/a+r8ZsfsiU17/cD0FU2dOrC4Oimg1S4uu0zeX6iPaD/ABNQaKL7Yj85AAAAAElFTkSuQmCC'); } } } diff --git a/site/src/pages/design/color.vue b/site/src/pages/design/color.vue index 550c16e2c..9ecaadb47 100644 --- a/site/src/pages/design/color.vue +++ b/site/src/pages/design/color.vue @@ -3,10 +3,10 @@